Mixins for modern CSS layout techniques.
Generated from the doc blocks in the core source when the site is built, so it always matches the current release of @wovenui/core. Every example is compiled against core during the build; open Compiled CSS under an example to see its output. The A to Z index lists every public mixin and function.
Source: tools/_modern-layout.scss
Mixins aspect-ratio dvh safe-area-inset print supports
aspect-ratio mixin Sets the aspect-ratio property from a width and height (emitted as 16 / 9), a single number, auto, calc() or var(); anything else raises an error.
An unquoted 16/9 is Sass division: Sass warns and passes 1.7777777778. Write aspect-ratio(16, 9) or "16/9".
@mixin aspect-ratio ( $ratio , $height : null )
Parameter Type Default Description $ratioNumber|String|ListRequired Width (with $height), a ratio as text ("16/9"), list.slash(16, 9), a positive number (1.5), auto, calc() or var() $heightNumber|NullnullHeight of the ratio, when $ratio is the width
Example 1
@include aspect-ratio ( 16 , 9 ) ; // aspect-ratio: 16 / 9
Compiled CSS Example 2
@include apply ( aspect-ratio ( " 4/3 " ) ) ; // aspect-ratio: 4 / 3
Compiled CSS aspect-ratio on MDN
Source: tools/_modern-layout.scss:72
dvh mixin Sets height to 100dvh where supported and to 100vh otherwise, each inside an @supports block.
Example
Compiled CSS @supports ( height : 100 dvh ) {
@supports not ( height : 100 dvh ) {
Source: tools/_modern-layout.scss:81
safe-area-inset mixin Sets a property to the device safe area inset for one side, for notches and rounded screens.
@mixin safe-area-inset ( $property , $position )
Parameter Type Default Description $propertyStringRequired CSS property to set, e.g. padding-top $positionStringRequired Inset side (top, right, bottom, left); any other value raises an error
Example
@include safe-area-inset ( padding-bottom , bottom ) ; // padding-bottom: env(safe-area-inset-bottom)
Compiled CSS padding-bottom : env(safe-area-inset-bottom);
Source: tools/_modern-layout.scss:98
print mixin Wraps styles in a print media query.
Content block Styles for printed output Source: tools/_modern-layout.scss:118
supports mixin Wraps styles in an @supports query for the given declaration; pass it as a quoted string.
@mixin supports ( $property )
Parameter Type Default Description $propertyStringRequired Declaration to test, e.g. "display: grid"; a value without a colon raises an error
Content block Styles to apply when the declaration is supported Example
@include supports ( " display: grid " ) {
Compiled CSS @supports ( display : grid ) {
Source: tools/_modern-layout.scss:133