Block
Simple block and inline block display utility classes with module mixins for responsive modifiers.
Utilities (anchor)
Utility name | Property values |
---|---|
.block | display: block |
.inline | display: inline |
.block-inline | display: inline-block |
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:
.block
.block-xxl
.block-xl
.block-lg
.block-md
.block-sm
.block-xs
.block-xxs
Using the module (anchor)
Load StyleMods as demonstrated (change file path as required) then include the Sass mixin anywhere below.
@use "stylemods/scss" as *;
@include block-css;
// Example breakpoint
@media (width <= 480px) {
@include block-sm-css;
}
See the using modules page for more information including how to compile the modules in cascade layers and include and reuse them in multiple source files.
Using the framework (anchor)
Using the recommended custom setup enable the styles (and required breakpoints) in an overrides document:
@use "stylemods/scss/configuration" as *;
$enable-block: true;
$enable-block-sm: true;
Include the overrides and the framework styles with your custom document for compiling the framework:
@use "overrides";
@use "stylemods/scss/stylemods";
See using the framework for more information including how the styles can also be compiled within cascade layers.
Source code (anchor)
The modules and framework use the same source code, see Sass maps to learn how to customize the values below.
block.scss
// ------------------------------------------------------------
// Block
// ------------------------------------------------------------
$block-values: (
"block": block,
"inline": inline,
"block-inline": inline-block,
) !default;
@mixin block-css {
@each $name, $value in $block-values {
.#{$name} {
display: #{$value};
}
}
}
@mixin block-xxl-css {
@each $name, $value in $block-values {
.#{$name}-xxl {
display: #{$value};
}
}
}
@mixin block-xl-css {
@each $name, $value in $block-values {
.#{$name}-xl {
display: #{$value};
}
}
}
@mixin block-lg-css {
@each $name, $value in $block-values {
.#{$name}-lg {
display: #{$value};
}
}
}
@mixin block-md-css {
@each $name, $value in $block-values {
.#{$name}-md {
display: #{$value};
}
}
}
@mixin block-sm-css {
@each $name, $value in $block-values {
.#{$name}-sm {
display: #{$value};
}
}
}
@mixin block-xs-css {
@each $name, $value in $block-values {
.#{$name}-xs {
display: #{$value};
}
}
}
@mixin block-xxs-css {
@each $name, $value in $block-values {
.#{$name}-xxs {
display: #{$value};
}
}
}