# Introduction
If you're working with backend language on your localhost, you would not like to write CSS to style default web elements.
Now either you will install bootstrap or any other UI framework on your localhost project but would you like to add bunch of classes to add stylings?
You are working on backend and probably you don't want to worry about front end design right now.
This is where sementic css framework like localhost UI helps you. That means you won't need to add classes to style elements.
What is sementic styling?
For instance, you want to add a button like this :
To generate this pre-sytled button, all you need to write the following default code of HTML
Despite of being a sementic CSS framework, localhost UI is highly customizable according to your need.
# Setup
You can install localhost UI into your system via these following methods
1. Use the CDN (Easy way)
Copy this following link into <head></head>
tags
2. via npm
npm i localhost-ui
to implement this into your javascript project like ReactJS, Import the module like this :
import 'localhost-ui'
After adding localhost UI into your practice project, you can play with your backend without worrying about styling.
# Layout
localhost is based on 12-grid sytem layout but you can also use flexbox Utilities to get desired results.
Most used grid is column 6/6
Here are how to use localhost-ui to plan layout for your website
col-1
col-11
col-2
col-10
col-3
col-9
col-4
col-8
col-5
col-7
col-6
col-6
col-12
col-12
# Containers
Containers are required to seprate website components.
You have to use class .container for div element to make it a container.
Containers in localhost-ui are given padding of 1rem which is essential to give white space between components
There are three kinds of containers are available here : default container, container-1280, container-980
Default Container
It is flexible container with 100% width. It takes full-width of the parent element
Default Container
Container 1280
Container 1280 is a continer with max-width of 1280px, that means if screen-size exceeds 1280px, it will maintain fixed width of 1280px.
If screen size is less than 1280px, it will aquire full width of the screen and work like a default container
Container 1280
Container 980
Container 980 is a continer with max-width of 980px, that means if screen-size exceeds 980px, it will maintain fixed width of 980px.
If screen size is less than 980px, it will aquire full width of the screen and work like a default container
Container 980
Container 720
Container 720 is a continer with max-width of 720px, that means if screen-size exceeds 720px, it will maintain fixed width of 720px.
If screen size is less than 720px, it will aquire full width of the screen and work like a default container
Container 720
Try minimizing browser's screen using CTRL - up to 50% to see containers in action.
# Typography
Responsive & fluid typography is used which is fully sementic and class-less.
You don't have to change font-size or line-height for various screens, so that you can just focus on your learnings
Here are Typography conponents :
Headings
Heading one h1
Heading two h2
Heading three h3
Heading four h4
Heading five h5
Heading six h6
This is a paragraph line
Heading one h1
Heading two h2
Heading three h3
Heading four h4
Heading five h5
Heading six h6
This is a paragraph line
# Utilities
localhost UI has some sementic and class based elements or utilities that will help you to achieve styling without wrting extra css for them
Alert
This is info alert!
This is error alert!
This is success alert!
This is warning alert!
This is info alert!
This is error alert!
This is success alert!
This is warning alert!
Text Colors
This is info text
This is error text
This is success text
This is warning text
This is gray text
This is dark text
This is light text
This is display text
This is info text
This is error text
This is success text
This is warning text
This is gray text
This is dark text
This is light text
This is display text
Text Alignment
Text Left
Lorem ipsum dolor sit, amet consectetur adipisicing elit. Temporibus minus beatae quia perferendis dignissimos nulla animi ex, unde facilis, ratione, consequatur at qui iusto. Tenetur earum veritatis qui perferendis asperiores?
Lorem ipsum dolor sit, amet consectetur adipisicing elit. Temporibus minus beatae quia perferendis dignissimos nulla animi ex, unde facilis, ratione, consequatur at qui iusto. Tenetur earum veritatis qui perferendis asperiores?
Text Center
Lorem ipsum dolor sit, amet consectetur adipisicing elit. Temporibus minus beatae quia perferendis dignissimos nulla animi ex, unde facilis, ratione, consequatur at qui iusto. Tenetur earum veritatis qui perferendis asperiores?
Lorem ipsum dolor sit, amet consectetur adipisicing elit. Temporibus minus beatae quia perferendis dignissimos nulla animi ex, unde facilis, ratione, consequatur at qui iusto. Tenetur earum veritatis qui perferendis asperiores?
Text Right
Lorem ipsum dolor sit, amet consectetur adipisicing elit. Temporibus minus beatae quia perferendis dignissimos nulla animi ex, unde facilis, ratione, consequatur at qui iusto. Tenetur earum veritatis qui perferendis asperiores?
Lorem ipsum dolor sit, amet consectetur adipisicing elit. Temporibus minus beatae quia perferendis dignissimos nulla animi ex, unde facilis, ratione, consequatur at qui iusto. Tenetur earum veritatis qui perferendis asperiores?
Text Justify
Lorem ipsum dolor sit, amet consectetur adipisicing elit. Temporibus minus beatae quia perferendis dignissimos nulla animi ex, unde facilis, ratione, consequatur at qui iusto. Tenetur earum veritatis qui perferendis asperiores?
Lorem ipsum dolor sit, amet consectetur adipisicing elit. Temporibus minus beatae quia perferendis dignissimos nulla animi ex, unde facilis, ratione, consequatur at qui iusto. Tenetur earum veritatis qui perferendis asperiores?
Text Formatting
This is a bold text
This is a strong text
This is an Underlined text
This is a hyperlink text
This is an italic text
This is a highlighted text
This is a small text
This is a superscripted text
This is a subscripted text
This is a inserted text
This is a deleted text
This is a bold text
This is a strong text
This is an Underlined text
This is a hyperlink text
This is an italic text
This is a highlighted text
This is a small text
This is a superscripted text
This is a subscripted text
This is a inserted text
This is a deleted text
This is code
text
This is a Keyboard key
This is a computer output
This is a variable
This is a citation
This is a short quotation
This is an abbreviation
This is a definition
Time is now
Address is :
123 Fake StreetSpringfield, USA
This is code
text
This is a Keyboard key
This is a computer output
This is a variable
This is a citation
This is a short quotation
This is an abbreviation
This is a definition
Time is now
Address is :
123 Fake Street
Springfield, USA
Blockquote
To add quotes you can use blockquote tag like this :
This world shall know pain! - Pain from Naruto Shippuden
This world shall know pain!
- Pain from Naruto Shippuden
Font Weight
You can change font-weight by adding a fw-xxx
to class attribute of the element, like this
Font Weight 100
Font Weight 200
Font Weight 300
Font Weight 400
Font Weight 500
Font Weight 600
Font Weight 700
Font Weight 800
Font Weight 900
Font Weight 100
Font Weight 200
Font Weight 300
Font Weight 400
Font Weight 500
Font Weight 600
Font Weight 700
Font Weight 800
Font Weight 900
# Flexbox
In localhost UI, flexbox is class-atributes based and simplified to a good extent.
Add following classes into your element to get flexbox layout
Class | What it will do |
---|---|
.flex-l | { display: flex; justify-content: flex-start; } |
.flex-c | { display: flex; justify-content: center; } |
.flex-r | { display: flex; justify-content: flex-end; } |
.flex-t | { display: flex; align-items: flex-start; } |
.flex-m | { display: flex; align-items: center; } |
.flex-b | { display: flex; align-items: flex-end; } |
.flex-sa | { display: flex; justify-content: space-around; } |
.flex-sb | { display: flex; justify-content: space-between; } |
.flex-str | { display: flex; align-items: stretch; } |
.flex-col | { display: flex; flex-direction: column; } |
.flex-row | { display: flex; flex-direction: row; } |
.flex-wrap | { display: flex; flex-wrap: wrap; } |
Here is a chart to tell about these flexbox classes
Item
Item
Item
Item
Item
Item
You can combination of those flex classes to get desired results
Item
Item
# Lists
There are three kinds of lists in HTML : ordered list, un-ordered list, defination lists
Here are all sementic list components
1. Ordered list
-
List item one
- Nested list item
- List item two
- List item three
-
List item one
- Nested list item
- List item two
- List item three
2. Unordered list
-
List item one
- Nested list item
- List item two
- List item three
-
List item one
- Nested list item
- List item two
- List item three
3. Definition list
- Definition One
- Definition one description
- Definition Two
- Definition two description
- Definition One
- Definition one description
- Definition Two
- Definition two description
# Table
Sementic and basic table syling using localhost-ui
Head 1 | Head 2 |
---|---|
Description 1 | Description 2 |
Description 1 | Description 2 |
Footer 1 | Footer 2 |
Head 1
Head 2
Description 1
Description 2
Description 1
Description 2
Footer 1
Footer 2
# Buttons
There are three patterns of buttons given here : default, lined and round.
Buttons can be generated using three tags : <input>, <button>, <a>
Hence, here are all kind of buttons you can use.
Use lined buttons for accent/secondary buttons
Using <input> tag:
Using <button> tag:
Using <a>(anchor) tag:
# Form
Forms in localhost-ui are made so simple and designed for better ease.
All kinds of form input types are given with their sementic code
Fieldset and legend form
Let's make a simple login form