Skip to content

Justify

Justify utilities for grid and flex display with module mixins for responsive modifiers.

Utilities (anchor)

Justify utility names and property values
Utility name Property values
Justify content
.justify-content-flex-start justify-content: flex-start
.justify-content-flex-end justify-content: flex-end
.justify-content-start justify-content: start
.justify-content-end justify-content: end
.justify-content-center justify-content: center
.justify-content-around justify-content: space-around
.justify-content-between justify-content: space-between
.justify-content-evenly justify-content: space-evenly
Justify items
.justify-items-flex-start justify-items: flex-start
.justify-items-flex-end justify-items: flex-end
.justify-items-start justify-items: start
.justify-items-end justify-items: end
.justify-items-center justify-items: center
Justify self
.justify-self-flex-start justify-self: flex-start
.justify-self-flex-end justify-self: flex-end
.justify-self-start justify-self: start
.justify-self-end justify-self: end
.justify-self-center justify-self: center

Responsive mixins (anchor)

Responsive modifier mixins are provided to include where required in custom breakpoints, the utilities available use the following modifier class naming convention:

.justify-content-start
.justify-content-start-xxl
.justify-content-start-xl
.justify-content-start-lg
.justify-content-start-md
.justify-content-start-sm
.justify-content-start-xs
.justify-content-start-xxs

The optional align and place utility styles can also be used with the justify utilities if included.

Using the module (anchor)

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

Each set of utilities can be included individually:

custom.scss
@use "stylemods/scss" as *;
@include justify-content-css;
@include justify-items-css;
@include justify-self-css;

// Example breakpoint
@media (width < 480px) {
  @include justify-content-sm-css;
  @include justify-items-sm-css;
  @include justify-self-sm-css;
}

Or included grouped in a single mixin:

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

// Example breakpoint
@media (width < 480px) {
  @include justify-sm-css;
}

See the using modules page for more information.

Using the framework (anchor)

Using the recommended custom setup enable the styles (and required breakpoints) in an overrides document:

overrides.scss
@use "stylemods/scss/configuration" as *;
$enable-justify:      true;
$enable-justify-sm:   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 Justify 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/justify.scss
View on Github
https://github.com/pmbrown/StyleMods/blob/main/scss/layout/justify.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.