Sabo CSS style guidelines

This is a variant of the SABO CSS Styleguid which has its own project. In this project, it is styled and has come overrides specific only for SABO WEBSITE.

Color variables and Dark mode

Components and layout elements should have all colors assigned through variables. There is a set of basic bradn colors and Specific Use colors (simmilar to setup in figma). To allow simple swap between light and dark modes without the need to duplicate css classes, there are 2 variable modes basic and Darkmode. Each has a pair of colors for a concrete, specific use: for example text primary color. In light mode it is black, on darkmode it is white.

Attach specific use pairs to the css classes, elements and components, so that whole sections/subsections can have a variable mode set to globally switch the whole design between light and dark modes.

Naming

Utility classes – "u-name" (i.e. u-bgcolor, u-tile...)

– "Global" classes that can be added as a combo class to any element to apply its styling.
– Meant for basic, repeated layout elements.
– pre-set with styling for all breakpoints.

Combo classes – "cc-name" (i.e. cc-primary...)

– pre-made combo classes for some utility classes, prepared for variants of the same class
– usually for size, color or layout variations

Repeated divs – page-wrap, sect, cont...

– divs that are not meant for building styling, but are reused throughout the page (like section or container divs), simple name connected with "-" is used. For their combo classes, keep the "cc-name" naming.

Custom divs

– for specialised, one-time use divs, keep naming in format "pagename"-"sectionname"-"name". For example: "home-hero-illutration-wrap" or "about-contact-form-infographics"

Page content structure

Body (no class)

Any styling changes to body should be done on Body (All pages), not on a new body class.

Styling of a Body tag through new body css class should only be done when major design changes are done on the WHOLE page. Otherwise, changes should be made on Section elements.

page-wrap

Div for all page content, right under the BODY tag. Allows easy "whole-page" copy/paste. Carries no formatting.

code (optional)

Any code embeds should be kept here before the header and "u-main" divs.

header

Div containing the main top navigation. Should contain both desktop and mobile navigation, all dropdowns, modals, etc. has to be set to "Header" tag.

main

Has the page content. Tag needs to be set to "Main" to correctly structure the page divs.

sect

Section tag (set to "Section") is the main tag used for structuring content on the page. Has a pre-set side paddings to make sure content does not ever "touch" the side of the screen.

cont

container is the div that defines the max width of the content. combo classes serve tu set the max width.

Content itself

The website page goes inside the container.

footer

Div containing the footer. Set to "Footer".

Classes

u-page-wrap
main
sect
cont
Max width 100rem (1600px

cont cc-xtra-narrow
Max width 40rem (640px)

cont cc-narrow
Max width 60rem (960px)

cont cc-wide
Max width 120rem (1920px)

Fluid sizing

Sizes for Paddings, Margins and Text are fluid, computed dynamically for any screen size, so that the shift in layout is minimized.

We have sizes defined as a values in Variables (listed below) and these variables are linked in a Utility classes (listed below). This way we can either attach the variable when we are styling a new class, or simply add a utility class, whenever we build a generic element.

The system is based on the fluid type sizing in S2 framework.

The sizes can be easily caluclated with this calculator.

There are a clamp() values for variables for spacings and for text sizes (described in sections below)

Fluid spacing

For spacings we have defined sizes as a advanced variable:

XS = xtra small = simmilar to 4px or 0.25rem
clamp(0.125rem, calc(0.083rem + 0.13vw), 0.25rem);

SM = Small = similar to 8px or 0.5rem
clamp(0.3125rem, calc(0.25rem + 0.2vw), 0.5rem);

ME = Medium = similar to 16 px or 1 rem
clamp(0.75rem, calc(0.667rem + 0.26vw), 1rem);

LA = Large = similar to 24 px or 1.5 rem
clamp(1rem, calc(0.833rem + 0.52vw), 1.5rem);

XL = Xtra-Large = similar to 32 px or 2 rem
clamp(1.5rem, calc(1.333rem + 0.52vw), 2rem);

2XL = 2 Xtra-Large = similar to 48 px or 3 rem
clamp(2rem, calc(1.667rem + 1.04vw), 3rem);

We also have extra large spacings for section paddings or margins between larger, complex elements

4R = similar to 4 rem (64px)
clamp(2rem, calc(0.83rem + 3.65vw), 5.5rem);

6R = similar to 6 rem (96px)
clamp(3.5rem, calc(2.67rem + 2.6vw), 7.5rem);

8R = similar to 8 rem (128px)
clamp(5rem, calc(3.67rem + 4.17vw), 10rem);

10R = similar to 10 rem (160px)
clamp(6rem, calc(4.67rem + 4.17vw), 13rem);

The spacings have more dramatic change from desktop to mobile: i.e. The 4r drops to ~2rem on mobile, and the 10r drops to ~ 6rem on mobile: this to to make the spaces less priominent on mobile and not waste too much space.

We have this values added to the corresponding utility classes for paddings, and margins.

Fluid text sizes

For text sizes we have defined sizes as a advanced variable:

Basic text sizes:

SM = small = similar to 0.875rem (14px)
clamp(0.901rem, 0.158vi + 0.866rem, 0.992rem);

Base = similar to 1rem (16px)
clamp(1rem, 0.217vi + 0.951rem, 1.125rem);

LA = Large = similar to 1.125rem(18px)
clamp(1.057rem, 0.42vi + 0.963rem, 1.299rem);

XL = Xtra-Large = similar to 1.25rem (20px)
clamp(1.118rem, 0.664vi + 0.969rem, 1.5rem);

2XL = 2 xtra large = similar to 1.5rem (24px)
clamp(1.183rem, 0.956vi + 0.967rem, 1.732rem);

Heading text sizes:

H1 =  similar to 4rem(64px)
clamp(3rem, 3.478vi + 2.218rem, 5rem);

H2 =  similar to 3rem(48px)
clamp(2.409rem, 2.264vi + 1.899rem, 3.71rem);

H3 =  similar to 2.5rem(40px)
clamp(1.933rem, 1.426vi + 1.613rem, 2.753rem);

H4 =  similar to 1.75rem(28px)
clamp(1.552rem, 0.854vi + 1.36rem, 2.043rem);

H5 =  similar to 1.5rem(24px)
clamp(1.246rem, 0.47vi + 1.14rem, 1.516rem);

H6 =  similar to 1rem(16px)
clamp(1rem, 0.217vi + 0.951rem, 1.125rem);

We have this values added to the corresponding utility classes for typography.

Padding

Below are utility classes for top, bot and all paddings.
Horizontal padding only – Should not be necessary. If so, create a custom class for the one specific element.

Names are derived from the REM sizes they are based on.

Top padding

u-pad-top-2r
u-pad-top-4r
u-pad-top-6r
u-pad-top-8r
u-pad-top-10r

Bot padding

u-pad-bot-2r
u-pad-bot-4r
u-pad-bot-6r
u-pad-bot-8r
u-pad-bot-10r

All padding

u-pad-all2
u-pad-all4
u-pad-all6

Margins

Below are utility classes for top and bot margins.
Horizontal ONLY margins should not be necessary. If so, create a custom class for the one specific element.

Names are derived from the REM sizes they are based on.

Top margins

u-margin-top-05
u-margin-top-1
u-margin-top-2
u-margin-top-4

Bot margins

u-margin-bot-05
u-margin-bot-1
u-margin-bot-2
u-margin-bot-4

Special margins for alignment

u-margin-top-auto

Margin Top set to Auto. Used when positioning a child element to a bottom side and flex layout cannot be set tu spaced.
u-margin-rl-auto

Margin Right and Left set to auto. Used when centering and element horizontally and flex layout cannot be used.

Backgrounds

Below are utility classes for background colors. by default, we expect to have 3 different backgrounds. If more are needed (more colors, gradients..) create new classes on Per-Project basis. You can rename the classes to i.e. "u-bgcolor-beige" if you want more ease of use.
u-bgcolor-primary

Primary BG color - White
u-bgcolor-neutral

Secondary BG color - grey
u-bgcolor-cold

Secondary BG color - light blue
u-bgcolor-warm

Secondary BG color - beige
u-bgcolor-darkblue

Inverted BG color – should have a variable mode switched to darkmode to have a textcolor set to white.
u-bgcolor-darkblue

Inverted BG color – should have a variable mode switched to darkmode to have a textcolor set to white.

Tiles and cards

Below are utility classes for tile elements. To reduce complexity, Radiuses in this system are static, only changing on breakpoints (not fluidly).
By default there are primary tiles ( usually slightly different shade of primary bg) and secondary tiles (usually contrasting to primary bg). Any other can be created by adding new combo class.

Tile class itself carries just the corner and BG styling. Paddings and layouts are hangled by divs inside the tile.

Darkmode

Simple tile

u-tile

Primary tile, flat color - neutral
Primary tile, flat color - cold
Primary tile, flat color - warm

Color tile

u-tile cc-color-red

Tertiary tile with a colorful BG
u-tile cc-color-blue

Tertiary tile with a colorful BG
u-tile cc-color-yellow

Tertiary tile with a colorful BG
u-tile cc-color-brown

Tertiary tile with a colorful BG

Glass tile

u-tile cc-glass

Secondary tile with a frost glass effect

Darkmode

Simple tile

u-tile

Primary tile, flat color - neutral
Primary tile, flat color - cold
Primary tile, flat color - warm

Color tile

u-tile cc-color-red

Tertiary tile with a colorful BG
u-tile cc-color-blue

Tertiary tile with a colorful BG
u-tile cc-color-yellow

Tertiary tile with a colorful BG
u-tile cc-color-brown

Tertiary tile with a colorful BG

Glass tile

u-tile cc-glass

Secondary tile with a frost glass effect

Flex layouts

Basic flex layouts carry information about direction based on breakpoints.
How to: insert a flex element (H flex or V flex) add class and combo class:
– Class defines the alignment of the content on primary axis (hflex-top/hflex-mid/hflex-bot and vflex-left/vflex-center/vflex-right).
– Combo class defines slignment on secondary axis (Hflex: left, center, right, spaced and Vflex: top, middle, bot, spaced)
– Child elements can have utility class for stretching or shrinking inside the flex itself.

H Flex layouts:
(breaks to vertical on Mobile landcape)

Hflex

Top:

Top left

hflex-top cc-left

Top center

hflex-top cc-center

Top right

hflex-top cc-right

Top spaced

hflex-top cc-spaced

Hflex

Middle:

Mid left

hflex-mid cc-left

Mid center

hflex-mid cc-center

Mid right

hflex-mid cc-right

Mid spaced

hflex-mid cc-spaced

Hflex

Bottom:

Bottom left

hflex-bot cc-left

Bottom center

hflex-bot cc-center

Bottom right

hflex-bot cc-right

Bottom spaced

hflex-bot cc-spaced

Hflex

Stretched:

Stretched left

hflex-stretched cc-left

Stretched center

hflex-stretched cc-center

Stretched right

hflex-stretched cc-left

Stretched spaced

hflex-stretched cc-spaced

V Flex layouts:

Vflex

Left:

Left top

vflex-left cc-top

Left middle

vflex-left cc-middle

Left bottom

vflex-left cc-bot

Left spaced

vflex-left cc-spaced

Vflex

Center:

Center top

vflex-center cc-top

Center middle

vflex-center cc-middle

Center bottom

vflex-center cc-bot

Center spaced

vflex-center cc-spaced

Vflex

Right:

Right top

vflex-right cc-top

Right middle

vflex-right cc-middle

Right bottom

vflex-right cc-bot

Right spaced

vflex-right cc-spaced

Vflex

Stretched:

Stretched top

vflex-stretched cc-top

Stretched middle

vflex-stretched cc-middle

Stretched bottom

vflex-stretched cc-bot

Stretched spaced

vflex-stretched cc-spaced

Flex child elements:

u-flex-child-stretch

Child element in flex layout is stretched to max size.
u-flex-child-shrink

Child element in flex layout is shrunk to min size.

Grid layouts

2, 3 and 4 column layouts
2 col: Breaking to 1 column on mobile portrait
3 col: Breaking to 1 column on mobile portrait
4 col: Breaking to 2 column on mobile landscape and 1 column on mobile portrait
2 column
u-grid cc-2col

3 column

u-grid cc-3col

4 column

u-grid cc-4col

Gaps

Applicable to flex and grid layouts. Affets the size of the gap between the child elements.
Defined in fluid sizes, naming is based on the REM size it is based on.
Gap - 1 rem
u-gap-1r
Gap - 2 rem
u-gap-2r
Gap - 4 rem
u-gap-4r

Text styling

Utility classes basic text styling: bodycopy, headings, text colors, text alignment etc.
Bodycopy
Styling of the primary text should be done on <Body>(All pages) tag. This should set to primary font, and font color (set from variables)

Headings
Headings should use the text sizes defined in he fluid size system.
In our system margins for the classes are set to 0, while maring for the "All headings" top margins are 0 and bot margins are set – This way, Rich text fields keep margin under the headings, while headings on page can be styled through margin utility classes.

Do not forget to style the "All headings" tag when starting a new project.

Display style

H1 Heading style

H2 Heading style

H3 Heading style

H4 Heading style

H5 Heading style

Large bodycopy

Formating
Tags for basic text formating
u-bold

Tagged font is BOLD
u-font-normal

Tagged font is switched from bold to 400Normal
u-italic

Tagged font is Italic
u-caps

Tagged font is ALL CAPS
u-no-underline

Turns off font Decor – used on Links to get rid of the default underline.

Text colors
Tags for changing the default color of text. By default we expect Primary and Secondary type colors and Primary and secondary brand colors. Add more if needed per project.
u-fontcolor-primary

Color changed to primary font color
u-fontcolor-secondary

Color changed to secondary font color
u-fontcolor-brand-green

Color changed to primary brand color
u-fontcolor-brand-blue

Color changed to secondary brand color
u-fontcolor-brand-darkblue

Color changed to secondary brand color
u-fontcolor-inverted

Color changed to secondary brand color
u-fontcolor-inverted-secondary

Color changed to secondary brand color

Text align

Classes for setting text align on an element.
u-text-align-center

Align all text to center
u-text-align-right

Align all text to right

Images

Styling and placing images
image-wrap

Universal image wrapper.
img

Image element.
Without CC has 100% width and auto height. to take in any image in its original size.
cc-16-9 for landscape format
cc-1-1 for 1:1 square format

u-img-stretch-full

Utility class for image element – stretches the image to full size of parent container.
u-img-cover

Sets image fitting to cover
u-img-fit

Sets image fitting to fit

Specialised

special classes for quick and fast builds
u-relative

Set position to relative (i.e. when absolutely positioning child elements)
u-tablet-hidden

Hide element on tablet and smaller.
u-mob-hidden

Hide elements on mobile landscape and smaller.

Componens and UI elements

List of webflow components and UI assets

SVG icons


Icon tag - by default same size and color as the text in the parent element. Can be changed to fixed size by combo classes cc-24 and cc-32.
icon

List of icons:

Buttons

btn

Large button. Do not forget to style hover, focus and active states.
label
label
Label

Combo classes: cc-secondary, cc-outline, cc-ghost
LABEL
LABEL
LABEL
LABEL
LABEL
LABEL
Label
Label
Label

Compact button.
btn-compact

Do not forget to style hover, focus and active states.
Button label
Button label
Button label

Combo classes: cc-secondary, cc-outline, cc-ghost
Button label
Button label
Button label
Button label
Button label
Button label
Button label
Button label
Button label

Darkmode

Button label
Button label
Button label
Button label
Button label
Button label
Button label
Button label
Button label
Button label
Button label
Button label
label
label
Label
LABEL
LABEL
LABEL
LABEL
LABEL
LABEL

Form inputs


Text input:
"input" and "input-label" are both inside "input-wrap"

Text field:
"text-field" and "input-label" are both inside "input-wrap"

Checkbox:
class "checkbox-wrap" with "checkbox" and "checkbox-label" inside

Radio button:
class "radio-wrap" with "radio" and "radio-label" inside
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Darkmode


Text field:
"text-field" and "input-label" are both inside "input-wrap"

Checkbox:
class "checkbox-wrap" with "checkbox" and "checkbox-label" inside

Radio button:
class "radio-wrap" with "radio" and "radio-label" inside
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Tabs


tab-menu:
wrapper of menu with styling of the whole tab row

tab-link:
each of the items

Tabs content not styled by default.

Type underline:
Tab content
Tab content
Tab content

Type Filled:
Tab content
Tab content
Tab content

Compact:
Tab content
Tab content
Tab content
Tab content
Tab content
Tab content

Darkmode

Tab content
Tab content
Tab content
Tab content
Tab content
Tab content
Tab content
Tab content
Tab content
Tab content
Tab content
Tab content

Chips


Large:
Chip label
Chip label
Chip label
Chip label
Chip label

Compact:
Chip label
Chip label
Chip label
Chip label
Chip label

When starting a new project

1/ Copy paste the whole styleguide (the "stylguide-wrapper" div on this page) to a new "Styleguide" page int he new project.

2/ Define size variables

When starting a new project, the variables for sizes need to be defined. Please keep the naming so that the links are not broken.

3/ Create color variables and link them in classes

Define variables for colors – primary, secondary, backgrouns, typography etc. and link them to the classes

4/ Style global tags:

Body (All pages), All H1-6 Headings, All paragraphs.

Keep the colors and font sizes, set "All headings" and "All paragraphs" top margin to 0 and Bot margins to set values.

How to use utility, combo and custom classes

Generally, the utility classes, their combo classes and pre-made components should cover most basic layouts, elements and their mobile breakpoints. For example basic 2,3 column layouts, layout text on left image on right, tile grids, headings, button rows etc.

For more specialised sections (i.e. Hero sections, unique one-time layouts..) it is recomended to create either a new combo class (i.e. "sect cc-home-hero") or a completely new custom-named div (i.e. "home-hero-illustration-wrap").

How to use