Basis
Basic formatting styles for web applications.
github.com/tobento-ch/css-basis
Import CSS
Links
Anchor tags will be styled with the defined "click colors" css custom properties.
You may use the link class for any other elements.
You may use the active
class indicating that the link is active.
Typography
Text Sizes
Lorem ipsum
Lorem ipsum
Lorem ipsum
Lorem ipsum
Lorem ipsum
Lorem ipsum
Lorem ipsum
Lorem ipsum
Text Weight
Text weight might depend on the font family set!
thin
light
regular
medium
bold
black
Text Alignment
text-left
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
text-right
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
text-center
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
text-justify
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
Text Transformation
Lorem ipsum
Lorem ipsum
Lorem ipsum
Lorem ipsum
Lorem ipsum
Truncate String with Ellipsis
Titles
Lorem ipsum
Lorem ipsum
Fonts
Lorem ipsum
Lorem ipsum
@font-face
Example of importing font families with its weight range corresponding to the basis.css weights.
Colors
Signal Colors
text-success
background-success
text-warning
background-warning
text-error
background-error
text-info
background-info
text-highlight
background-highlight
Design Colors
text-primary
background-primary
text-secondary
background-secondary
Gray Colors
You may use the following CSS custom properties for other design element classes.
var(--color-gray-900)
var(--color-gray-700)
var(--color-gray-500)
var(--color-gray-400)
var(--color-gray-300)
var(--color-gray-100)
Buttons
Button Types
Button Sizes
Text Sizes
fit
Button Styles
Button States
Button Icons
List Of Buttons
Spaced
Grouped
Grouped Small
Expanded
Grouped and Expanded
Icons
You may check out the Icon Service to easily manage your icons for your application.
SVG Icons
Font Awesome and others
DownloadIcon Sizes
You may use the Text Sizes for the icon size. Only svg or text icons scales though.
Icon Text
You may use the icon-text
class within any paragraph of text.
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
Lists
Bulleted List
- Coffee
- Tea
- Black tea
- Green tea
- Milk
Numbered List
- Coffee
- Tea
- Black tea
- Green tea
- Milk
Unstyled List
- Coffee
- Tea
- Black tea
- Green tea
- Milk
Description List
- Coffee
- - black hot drink
- Milk
- - white cold drink
Menus
Vertical
Spaced
The spaced
class assigns default paddings for the items which can be used in combination with your menu style class.
Icons and Badges
You may use the Icons structure! For badges add the badge
class.
Horizontal
Spaced
The spaced
class assigns default paddings for the items which can be used in combination with your menu style class.
Horizontal and vertical
Add the top
class as to align to the top.
Form
Elements
Input
Textarea
Select
Element Sizes
Fit Width
Use the fit
class to fit its parent container.
Small
Use the small
class for small elements.
Input Icons
Small Input
Field
Vertical field
Some description or message.
Horizontal field
The field gets vertical on mobile breakpoint.
Some description or message.
Vertical checkbox or radio
Some description or message.
Horizontal checkbox or radio
Some description or message.
Vertical example
Some description or message.
Some description or message.
Some description or message.
Some description or message.
Horizontal example
Some description or message.
Some description or message.
Content
You may use the content
class to format content text.
First heading
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.
Second heading
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.
- Coffee
- Tea
- Black tea
- Green tea
- Milk
Third heading
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.
- Coffee
- Tea
- Black tea
- Green tea
- Milk
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.
- Coffee
- - black hot drink
- Milk
- - white cold drink
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.
Fourth heading
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
One | Two |
---|---|
Three | Four |
Five | Six |
Seven | Eight |
Nine | Ten |
Eleven | Twelve |
Fifth heading
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.
Sixth heading
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
Helpers
Position
Class | Css |
---|---|
position-sticky |
position: sticky; |
position-absolute |
position: absolute; |
position-relative |
position: relative; |
position-fixed |
position: fixed; |
Display
Class | Css |
---|---|
display-none |
display: none; |
display-block |
display: block; |
display-inline-block |
display: inline-block; |
display-flex |
display: flex; |
display-inline-flex |
display: inline-flex; |
Float
Class | Css |
---|---|
float-left |
float: left; |
float-right |
float: right; |
Overflow
Class | Css |
---|---|
overflow-hidden |
overflow: hidden; |
overflow-visible |
overflow: visible; |
overflow-auto |
overflow: auto; |
overflow-x-auto |
overflow-x: auto; |
overflow-y-auto |
overflow-y: auto; |
Cursor
Class | Css |
---|---|
cursor-pointer |
cursor: pointer; |
cursor-move |
cursor: move; |
Misc
Class | Css |
---|---|
scroll-behavior-smooth |
scroll-behavior: smooth; |
Sizing
Max Width
max-width-xxs
is of width4rem
max-width-xs
is of width8rem
max-width-s
is of width16rem
max-width-m
is of width32rem
max-width-l
is of width48rem
max-width-xl
is of width64rem
max-width-xxl
is of width80rem
max-width-min
is equal to cssmax-width: min-content;
max-width-max
is equal to cssmax-width: max-content;
max-width-fit
is equal to cssmax-width: fit-content;
max-width-full
is equal to cssmax-width: 100%;
Spacing
Margin
Available margin directions:
m
for top, right, bottom, leftmt
for topmr
for rightmb
for bottomml
for leftmx
horizontally for both left and rightmy
vertically for both top and bottom
Available sizes to be appended to margin directions like mt-s
:
0
is of size0
xxs
is of size0.25rem
xs
is of size0.5rem
s
is of size1rem
m
is of size2rem
l
is of size4rem
xl
is of size6rem
xxl
is of size8rem
auto
Padding
Available padding directions:
p
for top, right, bottom, leftpt
for toppr
for rightpb
for bottompl
for leftpx
horizontally for both left and rightpy
vertically for both top and bottom
Available sizes to be appended to padding directions like pt-s
:
0
is of size0
xxs
is of size0.25rem
xs
is of size0.5rem
s
is of size1rem
m
is of size2rem
l
is of size4rem
xl
is of size6rem
xxl
is of size8rem
Columns
Columns is a simple grid system based on CSS flexbox. It is a desktop-first approach.
Sizes
Compose column by column with class like col-1 to col-12.
Auto width column
Keep in mind that in this way, your columns will only be a row!
Content width column
Just leave the col class out if you want to fit the width of the content.
Options for columns
Nowrap
Columns will only be a row.
Horizontal alignment: left, center and right
Vertical alignment: top, middle and bottom
Lorem Ispsum
Lorem Ispsum
Lorem Ispsum
Lorem Ispsum
Lorem Ispsum
Lorem Ispsum
Lorem Ispsum
Lorem Ispsum
Lorem Ispsum
Lorem Ispsum
Lorem Ispsum
Lorem Ispsum
Reverse
Single row per column
Single row per column reversed
Space between
Space around
Options for column
Vertical alignment: top, middle and bottom
Lorem Ispsum
Lorem Ispsum
Lorem Ispsum
Lorem Ispsum
Column Gaps
You may use the padding spacing for gaps.
Column Responsiveness
Sizes
widescreen-1
towidescreen-12
desktop-1
todesktop-12
tablet-1
totablet-12
mobile-1
tomobile-12
Options for columns
Use widescreen-*
, desktop-*
, tablet-*
, mobile-*
with the following alignment classes like tablet-middle.
*-nowrap
*-center
*-right
*-top
*-middle
*-bottom
*-reverse
Lorem Ispsum
Lorem Ispsum
Lorem Ispsum
Lorem Ispsum
Options for column
Use widescreen-*
, desktop-*
, tablet-*
, mobile-*
with the following alignment classes like tablet-middle.
*-top
*-middle
*-bottom
Lorem Ispsum
Lorem Ispsum
Lorem Ispsum
Lorem Ispsum
Responsiveness
Basis.css uses the following breakpoints for its core classes.