refactor: modules and css vars

This commit is contained in:
Lucas Larroche 2022-10-23 10:47:50 +07:00
parent 2e4d6c66ec
commit ce2ed6826d
46 changed files with 3874 additions and 3534 deletions

View file

@ -1,182 +1,185 @@
@use "sass:map";
@use "../settings" as *;
/**
* Button
*/
@if map.get($modules, "content/button") {
/**
* Button
*/
// Reboot based on :
// - normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css
// - sanitize.css v13.0.0 | CC0 1.0 Universal | github.com/csstools/sanitize.css
//
// Reboot based on :
// - normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css
// - sanitize.css v13.0.0 | CC0 1.0 Universal | github.com/csstools/sanitize.css
//
// 1. Change the font styles in all browsers
// 2. Remove the margin on controls in Safari
// 3. Show the overflow in Edge
button {
margin: 0; // 2
overflow: visible; // 3
font-family: inherit; // 1
text-transform: none; // 1
}
// Correct the inability to style buttons in iOS and Safari
button,
[type="button"],
[type="reset"],
[type="submit"] {
-webkit-appearance: button;
}
// Pico
//
button {
display: block;
width: 100%;
margin-bottom: var(#{$}spacing);
}
[role="button"] {
display: inline-block;
text-decoration: none;
}
button,
input[type="submit"],
input[type="button"],
input[type="reset"],
[role="button"] {
#{$✨}background-color: var(#{$}primary);
#{$✨}border-color: var(#{$}primary);
#{$✨}color: var(#{$}primary-inverse);
#{$✨}box-shadow: var(#{$}button-box-shadow, 0 0 0 rgba(0, 0, 0, 0));
padding: var(#{$}form-element-spacing-vertical) var(#{$}form-element-spacing-horizontal);
border: var(#{$}border-width) solid var(#{$}border-color);
border-radius: var(#{$}border-radius);
outline: none;
background-color: var(#{$}background-color);
box-shadow: var(#{$}box-shadow);
color: var(#{$}color);
font-weight: var(#{$}font-weight);
font-size: 1rem;
line-height: var(#{$}line-height);
text-align: center;
cursor: pointer;
@if $enable-transitions {
transition: background-color var(#{$}transition), border-color var(#{$}transition),
color var(#{$}transition), box-shadow var(#{$}transition);
// 1. Change the font styles in all browsers
// 2. Remove the margin on controls in Safari
// 3. Show the overflow in Edge
button {
margin: 0; // 2
overflow: visible; // 3
font-family: inherit; // 1
text-transform: none; // 1
}
&:is([aria-current], :hover, :active, :focus) {
#{$✨}background-color: var(#{$}primary-hover);
#{$✨}border-color: var(#{$}primary-hover);
#{$✨}box-shadow: var(#{$}button-hover-box-shadow, 0 0 0 rgba(0, 0, 0, 0));
// Correct the inability to style buttons in iOS and Safari
button,
[type="button"],
[type="reset"],
[type="submit"] {
-webkit-appearance: button;
}
// Pico
//
button {
display: block;
width: 100%;
margin-bottom: var(#{$}spacing);
}
[role="button"] {
display: inline-block;
text-decoration: none;
}
button,
input[type="submit"],
input[type="button"],
input[type="reset"],
[role="button"] {
#{$✨}background-color: var(#{$}primary);
#{$✨}border-color: var(#{$}primary);
#{$✨}color: var(#{$}primary-inverse);
}
&:focus {
#{$✨}box-shadow: var(#{$}button-hover-box-shadow, 0 0 0 rgba(0, 0, 0, 0)),
0 0 0 var(#{$}outline-width) var(#{$}primary-focus);
}
}
// .secondary, .contrast & .outline
@if $enable-classes {
// Secondary
:is(button, input[type="submit"], input[type="button"], [role="button"]).secondary,
input[type="reset"] {
#{$✨}background-color: var(#{$}secondary);
#{$✨}border-color: var(#{$}secondary);
#{$✨}color: var(#{$}secondary-inverse);
#{$✨}box-shadow: var(#{$}button-box-shadow, 0 0 0 rgba(0, 0, 0, 0));
padding: var(#{$}form-element-spacing-vertical) var(#{$}form-element-spacing-horizontal);
border: var(#{$}border-width) solid var(#{$}border-color);
border-radius: var(#{$}border-radius);
outline: none;
background-color: var(#{$}background-color);
box-shadow: var(#{$}box-shadow);
color: var(#{$}color);
font-weight: var(#{$}font-weight);
font-size: 1rem;
line-height: var(#{$}line-height);
text-align: center;
cursor: pointer;
@if $enable-transitions {
transition: background-color var(#{$}transition), border-color var(#{$}transition),
color var(#{$}transition), box-shadow var(#{$}transition);
}
&:is([aria-current], :hover, :active, :focus) {
#{$✨}background-color: var(#{$}secondary-hover);
#{$✨}border-color: var(#{$}secondary-hover);
#{$✨}background-color: var(#{$}primary-hover);
#{$✨}border-color: var(#{$}primary-hover);
#{$✨}box-shadow: var(#{$}button-hover-box-shadow, 0 0 0 rgba(0, 0, 0, 0));
#{$✨}color: var(#{$}primary-inverse);
}
&:focus {
#{$✨}box-shadow: var(#{$}button-hover-box-shadow, 0 0 0 rgba(0, 0, 0, 0)),
0 0 0 var(#{$}outline-width) var(#{$}primary-focus);
}
}
// .secondary, .contrast & .outline
@if $enable-classes {
// Secondary
:is(button, input[type="submit"], input[type="button"], [role="button"]).secondary,
input[type="reset"] {
#{$✨}background-color: var(#{$}secondary);
#{$✨}border-color: var(#{$}secondary);
#{$✨}color: var(#{$}secondary-inverse);
cursor: pointer;
&:is([aria-current], :hover, :active, :focus) {
#{$✨}background-color: var(#{$}secondary-hover);
#{$✨}border-color: var(#{$}secondary-hover);
#{$✨}color: var(#{$}secondary-inverse);
}
&:focus {
#{$✨}box-shadow: var(#{$}button-hover-box-shadow, 0 0 0 rgba(0, 0, 0, 0)),
0 0 0 var(#{$}outline-width) var(#{$}secondary-focus);
}
}
&:focus {
#{$✨}box-shadow: var(#{$}button-hover-box-shadow, 0 0 0 rgba(0, 0, 0, 0)),
0 0 0 var(#{$}outline-width) var(#{$}secondary-focus);
}
}
// Contrast
:is(button, input[type="submit"], input[type="button"], [role="button"]).contrast {
#{$✨}background-color: var(#{$}contrast);
#{$✨}border-color: var(#{$}contrast);
#{$✨}color: var(#{$}contrast-inverse);
&:is([aria-current], :hover, :active, :focus) {
#{$✨}background-color: var(#{$}contrast-hover);
#{$✨}border-color: var(#{$}contrast-hover);
// Contrast
:is(button, input[type="submit"], input[type="button"], [role="button"]).contrast {
#{$✨}background-color: var(#{$}contrast);
#{$✨}border-color: var(#{$}contrast);
#{$✨}color: var(#{$}contrast-inverse);
&:is([aria-current], :hover, :active, :focus) {
#{$✨}background-color: var(#{$}contrast-hover);
#{$✨}border-color: var(#{$}contrast-hover);
#{$✨}color: var(#{$}contrast-inverse);
}
&:focus {
#{$✨}box-shadow: var(#{$}button-hover-box-shadow, 0 0 0 rgba(0, 0, 0, 0)),
0 0 0 var(#{$}outline-width) var(#{$}contrast-focus);
}
}
&:focus {
#{$✨}box-shadow: var(#{$}button-hover-box-shadow, 0 0 0 rgba(0, 0, 0, 0)),
0 0 0 var(#{$}outline-width) var(#{$}contrast-focus);
}
}
// Outline (primary)
:is(button, input[type="submit"], input[type="button"], [role="button"]).outline,
input[type="reset"].outline {
#{$✨}background-color: transparent;
#{$✨}color: var(#{$}primary);
&:is([aria-current], :hover, :active, :focus) {
// Outline (primary)
:is(button, input[type="submit"], input[type="button"], [role="button"]).outline,
input[type="reset"].outline {
#{$✨}background-color: transparent;
#{$✨}color: var(#{$}primary-hover);
#{$✨}color: var(#{$}primary);
&:is([aria-current], :hover, :active, :focus) {
#{$✨}background-color: transparent;
#{$✨}color: var(#{$}primary-hover);
}
}
// Outline (secondary)
:is(button, input[type="submit"], input[type="button"], [role="button"]).outline.secondary,
input[type="reset"].outline {
#{$✨}color: var(#{$}secondary);
&:is([aria-current], :hover, :active, :focus) {
#{$✨}color: var(#{$}secondary-hover);
}
}
// Outline (contrast)
:is(button, input[type="submit"], input[type="button"], [role="button"]).outline.contrast {
#{$✨}color: var(#{$}contrast);
&:is([aria-current], :hover, :active, :focus) {
#{$✨}color: var(#{$}contrast-hover);
}
}
} @else {
// Secondary button without .class
input[type="reset"] {
#{$✨}background-color: var(#{$}secondary);
#{$✨}border-color: var(#{$}secondary);
#{$✨}color: var(#{$}secondary-inverse);
cursor: pointer;
&:is([aria-current], :hover, :active, :focus) {
#{$✨}background-color: var(#{$}secondary-hover);
#{$✨}border-color: var(#{$}secondary-hover);
}
&:focus {
#{$✨}box-shadow: var(#{$}button-hover-box-shadow, 0 0 0 rgba(0, 0, 0, 0)),
0 0 0 var(#{$}outline-width) var(#{$}secondary-focus);
}
}
}
// Outline (secondary)
:is(button, input[type="submit"], input[type="button"], [role="button"]).outline.secondary,
input[type="reset"].outline {
#{$✨}color: var(#{$}secondary);
&:is([aria-current], :hover, :active, :focus) {
#{$✨}color: var(#{$}secondary-hover);
}
}
// Outline (contrast)
:is(button, input[type="submit"], input[type="button"], [role="button"]).outline.contrast {
#{$✨}color: var(#{$}contrast);
&:is([aria-current], :hover, :active, :focus) {
#{$✨}color: var(#{$}contrast-hover);
}
}
} @else {
// Secondary button without .class
input[type="reset"] {
#{$✨}background-color: var(#{$}secondary);
#{$✨}border-color: var(#{$}secondary);
#{$✨}color: var(#{$}secondary-inverse);
cursor: pointer;
&:is([aria-current], :hover, :active, :focus) {
#{$✨}background-color: var(#{$}secondary-hover);
#{$✨}border-color: var(#{$}secondary-hover);
}
&:focus {
#{$✨}box-shadow: var(#{$}button-hover-box-shadow, 0 0 0 rgba(0, 0, 0, 0)),
0 0 0 var(#{$}outline-width) var(#{$}secondary-focus);
}
// Button [disabled]
// Links without href are disabled by default
:where(button, [type="submit"], [type="button"], [type="reset"], [role="button"])[disabled],
:where(fieldset[disabled])
:is(button, [type="submit"], [type="button"], [type="reset"], [role="button"]),
a[role="button"]:not([href]) {
opacity: 0.5;
pointer-events: none;
}
}
// Button [disabled]
// Links without href are disabled by default
:where(button, [type="submit"], [type="button"], [type="reset"], [role="button"])[disabled],
:where(fieldset[disabled])
:is(button, [type="submit"], [type="button"], [type="reset"], [role="button"]),
a[role="button"]:not([href]) {
opacity: 0.5;
pointer-events: none;
}

View file

@ -1,93 +1,96 @@
@use "sass:map";
@use "../settings" as *;
/**
* Code
*/
@if map.get($modules, "content/code") {
/**
* Code
*/
// Reboot based on :
// - normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css
// - sanitize.css v13.0.0 | CC0 1.0 Universal | github.com/csstools/sanitize.css
//
// Reboot based on :
// - normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css
// - sanitize.css v13.0.0 | CC0 1.0 Universal | github.com/csstools/sanitize.css
//
// 1. Correct the inheritance and scaling of font size in all browsers
// 2. Correct the odd `em` font sizing in all browsers
pre,
code,
kbd,
samp {
font-size: 0.875em; // 2
font-family: var(#{$}font-family); // 1
}
// Prevent overflow of the container in all browsers (opinionated)
pre {
-ms-overflow-style: scrollbar;
overflow: auto;
}
// Pico
//
pre,
code,
kbd {
border-radius: var(#{$}border-radius);
background: var(#{$}code-background-color);
color: var(#{$}code-color);
font-weight: var(#{$}font-weight);
line-height: initial;
}
code,
kbd {
display: inline-block;
padding: 0.375rem 0.5rem;
}
pre {
display: block;
margin-bottom: var(#{$}spacing);
overflow-x: auto;
> code {
display: block;
padding: var(#{$}spacing);
background: none;
font-size: 14px;
line-height: var(#{$}line-height);
// 1. Correct the inheritance and scaling of font size in all browsers
// 2. Correct the odd `em` font sizing in all browsers
pre,
code,
kbd,
samp {
font-size: 0.875em; // 2
font-family: var(#{$}font-family); // 1
}
}
// Code Syntax
code {
// Tags
b {
color: var(#{$}code-tag-color);
// Prevent overflow of the container in all browsers (opinionated)
pre {
-ms-overflow-style: scrollbar;
overflow: auto;
}
// Pico
//
pre,
code,
kbd {
border-radius: var(#{$}border-radius);
background: var(#{$}code-background-color);
color: var(#{$}code-color);
font-weight: var(#{$}font-weight);
line-height: initial;
}
// Properties
i {
color: var(#{$}code-property-color);
font-style: normal;
code,
kbd {
display: inline-block;
padding: 0.375rem 0.5rem;
}
// Values
u {
color: var(#{$}code-value-color);
text-decoration: none;
pre {
display: block;
margin-bottom: var(#{$}spacing);
overflow-x: auto;
> code {
display: block;
padding: var(#{$}spacing);
background: none;
font-size: 14px;
line-height: var(#{$}line-height);
}
}
// Comments
em {
color: var(#{$}code-comment-color);
font-style: normal;
// Code Syntax
code {
// Tags
b {
color: var(#{$}code-tag-color);
font-weight: var(#{$}font-weight);
}
// Properties
i {
color: var(#{$}code-property-color);
font-style: normal;
}
// Values
u {
color: var(#{$}code-value-color);
text-decoration: none;
}
// Comments
em {
color: var(#{$}code-comment-color);
font-style: normal;
}
}
// kbd
kbd {
background-color: var(#{$}code-kbd-background-color);
color: var(#{$}code-kbd-color);
vertical-align: baseline;
}
}
// kbd
kbd {
background-color: var(#{$}code-kbd-background-color);
color: var(#{$}code-kbd-color);
vertical-align: baseline;
}

View file

@ -1,50 +1,53 @@
@use "sass:map";
@use "../settings" as *;
/**
* Embedded content
*/
@if map.get($modules, "content/embedded") {
/**
* Embedded content
*/
// Reboot based on :
// - normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css
// - sanitize.css v13.0.0 | CC0 1.0 Universal | github.com/csstools/sanitize.css
//
// Reboot based on :
// - normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css
// - sanitize.css v13.0.0 | CC0 1.0 Universal | github.com/csstools/sanitize.css
//
// Change the alignment on media elements in all browsers (opinionated)
:where(audio, canvas, iframe, img, svg, video) {
vertical-align: middle;
}
// Add the correct display in IE 9-
audio,
video {
display: inline-block;
}
// Add the correct display in iOS 4-7
audio:not([controls]) {
display: none;
height: 0;
}
// Remove the border on iframes in all browsers (opinionated)
:where(iframe) {
border-style: none;
}
// 1. Remove the border on images inside links in IE 10.
// 2. Responsive by default
img {
max-width: 100%; // 2
height: auto; // 2
border-style: none; // 1
}
// Change the fill color to match the text color in all browsers (opinionated)
:where(svg:not([fill])) {
fill: currentColor;
}
// Hide the overflow in IE
svg:not(:root) {
overflow: hidden;
// Change the alignment on media elements in all browsers (opinionated)
:where(audio, canvas, iframe, img, svg, video) {
vertical-align: middle;
}
// Add the correct display in IE 9-
audio,
video {
display: inline-block;
}
// Add the correct display in iOS 4-7
audio:not([controls]) {
display: none;
height: 0;
}
// Remove the border on iframes in all browsers (opinionated)
:where(iframe) {
border-style: none;
}
// 1. Remove the border on images inside links in IE 10.
// 2. Responsive by default
img {
max-width: 100%; // 2
height: auto; // 2
border-style: none; // 1
}
// Change the fill color to match the text color in all browsers (opinionated)
:where(svg:not([fill])) {
fill: currentColor;
}
// Hide the overflow in IE
svg:not(:root) {
overflow: hidden;
}
}

60
scss/content/_link.scss Normal file
View file

@ -0,0 +1,60 @@
@use "sass:map";
@use "../settings" as *;
@if map.get($modules, "content/link") {
/**
* Link
*/
a,
[role="link"] {
#{$✨}color: var(#{$}primary);
#{$✨}background-color: transparent;
outline: none;
background-color: var(#{$}background-color); // 1
color: var(#{$}color);
text-decoration: var(#{$}text-decoration);
@if $enable-transitions {
transition: background-color var(#{$}transition), color var(#{$}transition),
text-decoration var(#{$}transition), box-shadow var(#{$}transition);
}
&:is([aria-current], :hover, :active, :focus) {
#{$✨}color: var(#{$}primary-hover);
#{$✨}text-decoration: underline;
}
&:focus {
#{$✨}background-color: var(#{$}primary-focus);
}
@if $enable-classes {
// Secondary
&.secondary {
#{$✨}color: var(#{$}secondary);
&:is([aria-current], :hover, :active, :focus) {
#{$✨}color: var(#{$}secondary-hover);
}
&:focus {
#{$✨}background-color: var(#{$}secondary-focus);
}
}
// Contrast
&.contrast {
#{$✨}color: var(#{$}contrast);
&:is([aria-current], :hover, :active, :focus) {
#{$✨}color: var(#{$}contrast-hover);
}
&:focus {
#{$✨}background-color: var(#{$}contrast-focus);
}
}
}
}
}

View file

@ -1,34 +1,37 @@
@use "sass:map";
@use "../settings" as *;
/**
* Miscs
*/
@if map.get($modules, "content/miscs") {
/**
* Miscs
*/
// Reboot based on :
// - normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css
// - sanitize.css v13.0.0 | CC0 1.0 Universal | github.com/csstools/sanitize.css
//
// Reboot based on :
// - normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css
// - sanitize.css v13.0.0 | CC0 1.0 Universal | github.com/csstools/sanitize.css
//
// 1. Correct the inheritance of border color in Firefox
// 2. Add the correct box sizing in Firefox
hr {
height: 0; // 2
border: 0;
border-top: 1px solid var(#{$}muted-border-color);
color: inherit; // 1
}
// 1. Correct the inheritance of border color in Firefox
// 2. Add the correct box sizing in Firefox
hr {
height: 0; // 2
border: 0;
border-top: 1px solid var(#{$}muted-border-color);
color: inherit; // 1
}
// Add the correct display in IE 10+
[hidden],
template {
@if $enable-important {
display: none !important;
} @else {
display: none;
// Add the correct display in IE 10+
[hidden],
template {
@if $enable-important {
display: none !important;
} @else {
display: none;
}
}
// Add the correct display in IE 9-
canvas {
display: inline-block;
}
}
// Add the correct display in IE 9-
canvas {
display: inline-block;
}

View file

@ -1,52 +1,55 @@
@use "sass:map";
@use "../settings" as *;
/**
* Table
*/
@if map.get($modules, "content/table") {
/**
* Table
*/
// Reboot based on :
// - normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css
// - sanitize.css v13.0.0 | CC0 1.0 Universal | github.com/csstools/sanitize.css
//
// Reboot based on :
// - normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css
// - sanitize.css v13.0.0 | CC0 1.0 Universal | github.com/csstools/sanitize.css
//
// 1. Collapse border spacing in all browsers (opinionated)
// 2. Remove text indentation from table contents in Chrome, Edge, and Safari
:where(table) {
width: 100%;
border-collapse: collapse; // 1
border-spacing: 0;
text-indent: 0; // 2
}
// 1. Collapse border spacing in all browsers (opinionated)
// 2. Remove text indentation from table contents in Chrome, Edge, and Safari
:where(table) {
width: 100%;
border-collapse: collapse; // 1
border-spacing: 0;
text-indent: 0; // 2
}
// Pico
//
// Pico
//
// Cells
th,
td {
padding: calc(var(#{$}spacing) / 2) var(#{$}spacing);
border-bottom: var(#{$}border-width) solid var(#{$}table-border-color);
color: var(#{$}color);
font-weight: var(#{$}font-weight);
font-size: var(#{$}font-size);
text-align: left;
text-align: start;
}
// Footer
tfoot {
// Cells
th,
td {
border-top: var(#{$}border-width) solid var(#{$}table-border-color);
border-bottom: 0;
padding: calc(var(#{$}spacing) / 2) var(#{$}spacing);
border-bottom: var(#{$}border-width) solid var(#{$}table-border-color);
color: var(#{$}color);
font-weight: var(#{$}font-weight);
font-size: var(#{$}font-size);
text-align: left;
text-align: start;
}
}
// Striped
table {
&[role="grid"] {
tbody tr:nth-child(odd) {
background-color: var(#{$}table-row-stripped-background-color);
// Footer
tfoot {
th,
td {
border-top: var(#{$}border-width) solid var(#{$}table-border-color);
border-bottom: 0;
}
}
// Striped
table {
&[role="grid"] {
tbody tr:nth-child(odd) {
background-color: var(#{$}table-row-stripped-background-color);
}
}
}
}

View file

@ -1,266 +1,215 @@
@use "sass:map";
@use "../settings" as *;
/**
* Typography
*/
@if map.get($modules, "content/typography") {
/**
* Typography
*/
// Reboot based on :
// - normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css
// - sanitize.css v13.0.0 | CC0 1.0 Universal | github.com/csstools/sanitize.css
//
// Reboot based on :
// - normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css
// - sanitize.css v13.0.0 | CC0 1.0 Universal | github.com/csstools/sanitize.css
//
// Add the correct font weight in Chrome, Edge, and Safari
b,
strong {
font-weight: bolder;
}
// Prevent `sub` and `sup` elements from affecting the line height in all browsers
sub,
sup {
position: relative;
font-size: 0.75em;
line-height: 0;
vertical-align: baseline;
}
sub {
bottom: -0.25em;
}
sup {
top: -0.5em;
}
// Pico
//
address,
blockquote,
dl,
figure,
form,
ol,
p,
pre,
table,
ul {
margin-top: 0;
margin-bottom: var(#{$}typography-spacing-vertical);
color: var(#{$}color);
font-style: normal;
font-weight: var(#{$}font-weight);
font-size: var(#{$}font-size);
}
// Links
// 1. Remove the gray background on active links in IE 10
a,
[role="link"] {
#{$✨}color: var(#{$}primary);
#{$✨}background-color: transparent;
outline: none;
background-color: var(#{$}background-color); // 1
color: var(#{$}color);
text-decoration: var(#{$}text-decoration);
@if $enable-transitions {
transition: background-color var(#{$}transition), color var(#{$}transition),
text-decoration var(#{$}transition), box-shadow var(#{$}transition);
// Add the correct font weight in Chrome, Edge, and Safari
b,
strong {
font-weight: bolder;
}
&:is([aria-current], :hover, :active, :focus) {
#{$✨}color: var(#{$}primary-hover);
#{$✨}text-decoration: underline;
// Prevent `sub` and `sup` elements from affecting the line height in all browsers
sub,
sup {
position: relative;
font-size: 0.75em;
line-height: 0;
vertical-align: baseline;
}
sub {
bottom: -0.25em;
}
sup {
top: -0.5em;
}
&:focus {
#{$✨}background-color: var(#{$}primary-focus);
// Pico
//
address,
blockquote,
dl,
figure,
form,
ol,
p,
pre,
table,
ul {
margin-top: 0;
margin-bottom: var(#{$}typography-spacing-vertical);
color: var(#{$}color);
font-style: normal;
font-weight: var(#{$}font-weight);
font-size: var(#{$}font-size);
}
// Headings
h1,
h2,
h3,
h4,
h5,
h6 {
margin-top: 0;
margin-bottom: var(#{$}typography-spacing-vertical);
color: var(#{$}color);
font-weight: var(#{$}font-weight);
font-size: var(#{$}font-size);
font-family: var(#{$}font-family);
}
h1 {
#{$✨}color: var(#{$}h1-color);
}
h2 {
#{$✨}color: var(#{$}h2-color);
}
h3 {
#{$✨}color: var(#{$}h3-color);
}
h4 {
#{$✨}color: var(#{$}h4-color);
}
h5 {
#{$✨}color: var(#{$}h5-color);
}
h6 {
#{$✨}color: var(#{$}h6-color);
}
// Margin-top for headings after a typography block
:where(address, blockquote, dl, figure, form, ol, p, pre, table, ul) {
~ :is(h1, h2, h3, h4, h5, h6) {
margin-top: var(#{$}typography-spacing-vertical);
}
}
// Heading group
@if $enable-classes == false {
hgroup {
margin-bottom: var(#{$}typography-spacing-vertical);
> * {
margin-bottom: 0;
}
> *:last-child {
#{$✨}color: var(#{$}muted-color);
#{$✨}font-weight: unset;
font-size: 1rem;
font-family: unset;
}
}
}
@if $enable-classes {
// Secondary
&.secondary {
#{$✨}color: var(#{$}secondary);
hgroup,
.headings {
margin-bottom: var(#{$}typography-spacing-vertical);
&:is([aria-current], :hover, :active, :focus) {
#{$✨}color: var(#{$}secondary-hover);
> * {
margin-bottom: 0;
}
&:focus {
#{$✨}background-color: var(#{$}secondary-focus);
}
}
// Contrast
&.contrast {
#{$✨}color: var(#{$}contrast);
&:is([aria-current], :hover, :active, :focus) {
#{$✨}color: var(#{$}contrast-hover);
}
&:focus {
#{$✨}background-color: var(#{$}contrast-focus);
> *:last-child {
#{$✨}color: var(#{$}muted-color);
#{$✨}font-weight: unset;
font-size: 1rem;
font-family: unset;
}
}
}
}
// Headings
h1,
h2,
h3,
h4,
h5,
h6 {
margin-top: 0;
margin-bottom: var(#{$}typography-spacing-vertical);
color: var(#{$}color);
font-weight: var(#{$}font-weight);
font-size: var(#{$}font-size);
font-family: var(#{$}font-family);
}
h1 {
#{$✨}color: var(#{$}h1-color);
}
h2 {
#{$✨}color: var(#{$}h2-color);
}
h3 {
#{$✨}color: var(#{$}h3-color);
}
h4 {
#{$✨}color: var(#{$}h4-color);
}
h5 {
#{$✨}color: var(#{$}h5-color);
}
h6 {
#{$✨}color: var(#{$}h6-color);
}
// Margin-top for headings after a typography block
:where(address, blockquote, dl, figure, form, ol, p, pre, table, ul) {
~ :is(h1, h2, h3, h4, h5, h6) {
margin-top: var(#{$}typography-spacing-vertical);
}
}
// Heading group
@if $enable-classes == false {
hgroup {
// Paragraphs
p {
margin-bottom: var(#{$}typography-spacing-vertical);
}
> * {
margin-bottom: 0;
}
// Small
small {
font-size: var(#{$}font-size);
}
> *:last-child {
#{$✨}color: var(#{$}muted-color);
#{$✨}font-weight: unset;
font-size: 1rem;
font-family: unset;
// Lists
:where(dl, ol, ul) {
padding-right: 0;
padding-left: var(#{$}spacing);
padding-inline-start: var(#{$}spacing);
padding-inline-end: 0;
li {
margin-bottom: calc(var(#{$}typography-spacing-vertical) * 0.25);
}
}
}
@if $enable-classes {
hgroup,
.headings {
margin-bottom: var(#{$}typography-spacing-vertical);
> * {
margin-bottom: 0;
}
> *:last-child {
#{$✨}color: var(#{$}muted-color);
#{$✨}font-weight: unset;
font-size: 1rem;
font-family: unset;
// Margin-top for nested lists
// 1. Remove the margin on nested lists in Chrome, Edge, IE, and Safari
:where(dl, ol, ul) {
:is(dl, ol, ul) {
margin: 0; // 1
margin-top: calc(var(#{$}typography-spacing-vertical) * 0.25);
}
}
}
// Paragraphs
p {
margin-bottom: var(#{$}typography-spacing-vertical);
}
ul li {
list-style: square;
}
// Small
small {
font-size: var(#{$}font-size);
}
// Highlighted text
mark {
padding: 0.125rem 0.25rem;
background-color: var(#{$}mark-background-color);
color: var(#{$}mark-color);
vertical-align: baseline;
}
// Lists
:where(dl, ol, ul) {
padding-right: 0;
padding-left: var(#{$}spacing);
padding-inline-start: var(#{$}spacing);
padding-inline-end: 0;
// Blockquote
blockquote {
display: block;
margin: var(#{$}typography-spacing-vertical) 0;
padding: var(#{$}spacing);
border-right: none;
border-left: 0.25rem solid var(#{$}blockquote-border-color);
border-inline-start: 0.25rem solid var(#{$}blockquote-border-color);
border-inline-end: none;
li {
margin-bottom: calc(var(#{$}typography-spacing-vertical) * 0.25);
footer {
margin-top: calc(var(#{$}typography-spacing-vertical) * 0.5);
color: var(#{$}blockquote-footer-color);
}
}
// Abbreviations
// 1. Remove underline decoration in Chrome, Edge, IE, Opera, and Safari
abbr[title] {
border-bottom: 1px dotted;
text-decoration: none; // 1
cursor: help;
}
// Ins
ins {
color: var(#{$}ins-color);
text-decoration: none;
}
// del
del {
color: var(#{$}del-color);
}
// selection
::selection {
background-color: var(#{$}primary-focus);
}
}
// Margin-top for nested lists
// 1. Remove the margin on nested lists in Chrome, Edge, IE, and Safari
:where(dl, ol, ul) {
:is(dl, ol, ul) {
margin: 0; // 1
margin-top: calc(var(#{$}typography-spacing-vertical) * 0.25);
}
}
ul li {
list-style: square;
}
// Highlighted text
mark {
padding: 0.125rem 0.25rem;
background-color: var(#{$}mark-background-color);
color: var(#{$}mark-color);
vertical-align: baseline;
}
// Blockquote
blockquote {
display: block;
margin: var(#{$}typography-spacing-vertical) 0;
padding: var(#{$}spacing);
border-right: none;
border-left: 0.25rem solid var(#{$}blockquote-border-color);
border-inline-start: 0.25rem solid var(#{$}blockquote-border-color);
border-inline-end: none;
footer {
margin-top: calc(var(#{$}typography-spacing-vertical) * 0.5);
color: var(#{$}blockquote-footer-color);
}
}
// Abbreviations
// 1. Remove underline decoration in Chrome, Edge, IE, Opera, and Safari
abbr[title] {
border-bottom: 1px dotted;
text-decoration: none; // 1
cursor: help;
}
// Ins
ins {
color: var(#{$}ins-color);
text-decoration: none;
}
// del
del {
color: var(#{$}del-color);
}
// selection
::selection {
background-color: var(#{$}primary-focus);
}