mainComponents 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.
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"

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".
u-page-wrapmainsectcontcont cc-xtra-narrowcont cc-narrowcont cc-wideSizes 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)
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.
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.
u-pad-top-2ru-pad-top-4ru-pad-top-6ru-pad-top-8r
u-pad-top-10r
u-pad-bot-2ru-pad-bot-4ru-pad-bot-6ru-pad-bot-8ru-pad-bot-10ru-pad-all2u-pad-all4u-pad-all6u-margin-top-05u-margin-top-1u-margin-top-2u-margin-top-4u-margin-bot-05u-margin-bot-1u-margin-bot-2u-margin-bot-4u-margin-top-autou-margin-rl-autou-bgcolor-primaryu-bgcolor-neutralu-bgcolor-coldu-bgcolor-warmu-bgcolor-darkblueu-bgcolor-darkblueu-tileu-tile cc-color-redu-tile cc-color-blueu-tile cc-color-yellowu-tile cc-color-brownu-tile cc-glassu-tileu-tile cc-color-redu-tile cc-color-blueu-tile cc-color-yellowu-tile cc-color-brownu-tile cc-glassu-flex-child-stretchu-flex-child-shrinku-boldu-font-normalu-italicu-capsu-no-underlineu-fontcolor-primaryu-fontcolor-secondaryu-fontcolor-brand-greenu-fontcolor-brand-blueu-fontcolor-brand-darkblueu-fontcolor-invertedu-fontcolor-inverted-secondaryu-text-align-centeru-text-align-rightimage-wrapimgu-img-stretch-fullu-img-coveru-img-fitu-relativeu-tablet-hiddenu-mob-hiddenicon1/ 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.
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").