Skip to content

Containers

Responsive content container utilities that can be customized using CSS variables inline.

Utilities (anchor)

Container utility class names and default size values
Utility Size
.container var(--size)
.container-xxl 1920px
.container-xl 1600px
.container-lg 1280px
.container-md 1024px
.container-sm 768px
.container-xs 480px
.container-xxs 360px
.container-rem-xxl 120rem
.container-rem-xl 100rem
.container-rem-lg 80rem
.container-rem-md 64rem
.container-rem-sm 48rem
.container-rem-xs 30rem
.container-rem-xxs 22.5rem

Using the module (anchor)

Load StyleMods as demonstrated (change file path as required) then include the Sass mixin anywhere below.

custom.scss
@use "stylemods/scss" as *;
@include containers-css;

See the using modules page for more information.

Using the framework (anchor)

Using the recommended custom setup enable the styles in an overrides document:

overrides.scss
@use "stylemods/scss/configuration" as *;
$enable-containers: true;

Include the overrides and the framework styles with your custom document for compiling the framework:

custom.scss
@use "overrides";
@use "stylemods/scss/stylemods";

See using the framework for more information.

Source code (anchor)

The Containers source file is included with the layout module files, you can view the source code from the latest release (v1.5.0) via the Github link below.

Source document
stylemods/scss/layout/containers.scss
View on Github
https://github.com/pmbrown/StyleMods/blob/main/scss/layout/containers.scss

Shared documentation about how to customize the default property values for the styles using the Sass and CSS variables is provided on the customizing page.