Elementary Variants
These are classes for marking up variants of specific types of elements.
Naming Convention
Elementary variants classes carry the var-
prefix, e. g. var-standard-table
.
figure.var-feature
scss
figure.var-feature {
@include coloring.set-colors("feature", "alternate");
@include coloring.use-colors;
margin-inline: 0;
padding: svar(spacing-block-lg);
blockquote {
---no-stroke: true;
---indent: 0ch;
---marker-outdent: 1ch;
font-size: svar(font-size-4);
line-height: svar(line-3);
font-family: svar(font-family-display, svar(font-family-body));
}
> * {
max-inline-size: 85.7%;
margin-inline-start: auto;
@media (min-width: map.get(container.$sizes, "sm")) {
// Occupy bigger golden ratio part.
max-inline-size: 61.8%;
}
@media (min-width: map.get(container.$sizes, "lg")) {
// Occupy smaller golden ratio part.
max-inline-size: 38.2%;
}
}
}
Requires
$sizes@container (Map)
Modifier: +end
scss
nav.var-foldable.\+end {
flex-direction: row-reverse;
& > #{$popOn} {
margin-inline: auto var(---toggle-size);
}
}
Places toggle to the inline end (rhs in Latin). This only has an effect if the menu is foldable.
Foldable Navigation Menu
@mixin toggle()
Toggle.
Requires
@function svar()
Used By
@mixin menu-foldable()
@mixin toggle-off()
Toggle when folded.
Used By
@mixin menu-foldable()
Modifier: +always
scss
nav.var-foldable:where(.\+always) {
@include menu-foldable;
}
Apply folding also to leveled menu. (The backdrop is kept transparent in this case.) This module is optional and can be included on demand.
Sticky Navigation Menu
table.var-standard-table
scss
table.var-standard-table {
---table-border-width: #{svar(stroke-width-table, svar(stroke-width-default))};
---table-border-style: #{svar(stroke-style-table, svar(stroke-style-default))};
---table-border-color: #{svar(stroke-color-table, svar(stroke-color-default))};
thead {
background-color: var(---background-heavy, svar(color-mark-contra));
}
tr:nth-child(2n) {
background-color: var(---background-light, svar(color-alternate-contra));
}
// Do not center `th` in vertical tables.
thead + tbody {
th:first-child {
text-align: start;
}
}
}
Standard table style.
In contrast to the neutral styles applied to the bare table
element
this adds some borders and stripes.