Skip to main content

Developers - CSS Layout System

Properties

Section requires a few CSS Custom Properties to function properly.

You can grab a sample setup-file here:

page.html
<link href="https://cdn.perfection.dev/layouts/layout.props.css" rel="stylesheet" />

Replace the required properties with the values from your site’s design.


Required Properties


Spacing Units

PropertyDescription
--section-page-gapGap between outer-sections
--section-gapGap between inner-sections within a outer-section
--section-col-gapColumn-gap within a inner-section
--section-row-gapRow-gap within a inner-section

Widths

PropertyDescription
--section-w-xxsXXS, default: 240px
--section-w-xsXS, default: 360px
--section-w-smSM, default: 480px
--section-w-mdMD, default: 768px
--section-w-lgLG, default: 1024px
--section-w-xlXL, default: 1440px
--section-w-xxlXXL, default: 1920px

Optional Properties


Utility Units

PropertyDescription
--section-margin-unitMargin-unit, used in utility-modifiers
--section-padding-unitPadding-unit, used in utility-modifiers

Focus

PropertyDescription
--section-focus-olcOutline color
--section-focus-oloOutline offset
--section-focus-olsOutline style
--section-focus-owOutline width

Scrollbar

PropertyDescription
--section-scroll-gapGap between the scrollbar and it’s inner-section
--section-scroll-thumb-bdrsborder-radius of the draggable part of a scrollbar
--section-scroll-track-bdrsborder-radius of a scrollbar-track
--section-scroll-wWidth of a scrollbar

Slider

If you're using one of our slider-templates, you can fine-tune their appearance by updating these values:

PropertyDescription
--slider-timeUnit-less, read by JavaScript. Time between slides when autoplay is used
--slider-nav-gutterSets the amount of space between the slider and the navigation buttons
--slider-nav-hSets the height of the navigation buttons
--slider-nav-ico-bdwSets the border width of the navigation buttons' icons
--slider-nav-ico-szSets the size of the navigation buttons' icons
--slider-nav-wSets the width of the navigation buttons
--slider-nav-zSets the z-index of the navigation buttons
--slider-pg-gapSets the amount of space between the slider and the pagination buttons
--slider-pg-hSets the height of the pagination buttons
--slider-pg-wSets the width of the pagination buttons
--slider-pg-zSets the z-index of the pagination buttons
--slider-tx-cSets the color of the text
--slider-tx-lhSets the line height of the text
--slider-tx-szSets the size of the text


Tabs

If you're using one of our tabs-templates, you can fine-tune their appearance by updating these values:

PropertyDescription
--section-tabs-active-bdcThe border color of the active tab.
--section-tabs-active-bdwThe border width of the active tab.
--section-tabs-active-bgThe background color of the active tab.
--section-tabs-active-cThe text color of the active tab.
--section-tabs-bdcThe border color of the tab.
--section-tabs-bg-hoverThe background color of the tab when hovered.
--section-tabs-bdc-hoverThe border color of the tab when hovered.
--section-tabs-bar-bdcThe border color of the bar.
--section-tabs-bar-bdrsThe border radius of the bar.
--section-tabs-bar-bdwThe border width of the bar.
--section-tabs-bar-pThe padding of the bar.
--section-tabs-line-pThe padding of the line.
--section-tabs-pill-bdrsThe border radius of the pill.
--section-tabs-pill-pThe padding of the pill.

Internal Properties

Internal properties are the ones we're using within Section to control "number of columns", "grid-column-span" and much more. Our internal properties are prefixed with a underscore, to indicate that they're "private", but you are of course welcome to update them from your own CSS.

In fact, if you want to write your own template, you have to use them.

PropertyDescriptionApplies to
--_cnumber of columnsinner-section
--_cegrid-column-endcontent
--_cgcolumn-gap†inner-section
--_csgrid-column-startcontent
--_mismax-inline-sizeinner-section
--_pgpage-gap†section-wrapper, outer-section
--_pipadding-inlineinner-section
--_regrid-row-endcontent
--_rgrow-gap†inner-section
--_rsgrid-row-startcontent
--_sgsection-gap†outer-section
--_wcalculated widthcontent

† Indicates that the property is a multiplier, and used to multiply the corresponding public property, such as --section-gap.


Internal properties used in utilities

PropertyDescriptionApplies to
--_acalign-contentany element
--_jcjustify-contentany element
--_jijustify-itemsany element
--_jsjustify-selfany element
--_pbepadding-block-end†any element
--_pbspadding-block-start†any element
--_piepadding-inline-end†any element
--_pispadding-inline-start†any element
--_tatext-alignany element

† Indicates that the property is a multiplier, and used to multiply the corresponding public property, such as --section-padding-unit.