diff --git a/scss/_maps.scss b/scss/_maps.scss index a00532630d..a91bf69447 100644 --- a/scss/_maps.scss +++ b/scss/_maps.scss @@ -85,22 +85,22 @@ $ouds-elevations: ( // scss-docs-start ouds-maps-font $ouds-font-sizes: ( - dl: "/display-large", - dm: "/display-medium", - ds: "/display-small", - hxl: "/heading-xlarge", - hl: "/heading-large", - hm: "/heading-medium", - hs: "/heading-small", - bl: "/body-large", - bm: "/body-medium", - bs: "/body-small", - lxl: "/label-xlarge", - ll: "/label-large", - lm: "/label-medium", - ls: "/label-small", + cs: "/code-small", cm: "/code-medium", - cs: "/code-small" + ls: "/label-small", + lm: "/label-medium", + ll: "/label-large", + lxl: "/label-xlarge", + bs: "/body-small", + bm: "/body-medium", + bl: "/body-large", + hs: "/heading-small", + hm: "/heading-medium", + hl: "/heading-large", + hxl: "/heading-xlarge", + ds: "/display-small", + dm: "/display-medium", + dl: "/display-large", ) !default; $ouds-font-weights: ( diff --git a/scss/_reboot.scss b/scss/_reboot.scss index ca22e52446..a5329ebd89 100644 --- a/scss/_reboot.scss +++ b/scss/_reboot.scss @@ -57,7 +57,7 @@ // 2. As a best practice, apply a default `background-color`. // 3. Prevent adjustments of font size after orientation changes in iOS. // 4. Change the default tap highlight to be completely transparent in iOS. -// 5. Prevent faux-bold/italic maybe for some RTL fonts +// 5. Prevent faux-bold/italic especially for some RTL fonts // See https://developer.mozilla.org/fr/docs/Web/CSS/font-synthesis // scss-docs-start reboot-body-rules diff --git a/scss/_root.scss b/scss/_root.scss index c6173c5da6..b181ee518a 100644 --- a/scss/_root.scss +++ b/scss/_root.scss @@ -79,6 +79,7 @@ --#{$prefix}font-size-label-large: #{px-to-rem($ouds-font-size-label-large)}; --#{$prefix}font-size-label-medium: #{px-to-rem($ouds-font-size-label-medium)}; --#{$prefix}font-size-label-small: #{px-to-rem($ouds-font-size-label-small)}; + --#{$prefix}font-size-code-medium: #{px-to-rem($ouds-font-size-code-medium)}; --#{$prefix}font-line-height-display-large: #{divide($ouds-font-line-height-display-large-mobile, $ouds-font-size-display-large-mobile)}; --#{$prefix}font-line-height-display-medium: #{divide($ouds-font-line-height-display-medium-mobile, $ouds-font-size-display-medium-mobile)}; --#{$prefix}font-line-height-display-small: #{divide($ouds-font-line-height-display-small-mobile, $ouds-font-size-display-small-mobile)}; @@ -93,6 +94,7 @@ --#{$prefix}font-line-height-label-large: #{divide($ouds-font-line-height-label-large, $ouds-font-size-label-large)}; --#{$prefix}font-line-height-label-medium: #{divide($ouds-font-line-height-label-medium, $ouds-font-size-label-medium)}; --#{$prefix}font-line-height-label-small: #{divide($ouds-font-line-height-label-small, $ouds-font-size-label-small)}; + --#{$prefix}font-line-height-code-medium: #{divide($ouds-font-line-height-label-small, $ouds-font-size-code-medium)}; --#{$prefix}font-letter-spacing-display-large: #{px-to-rem($ouds-font-letter-spacing-display-large-mobile)}; --#{$prefix}font-letter-spacing-display-medium: #{px-to-rem($ouds-font-letter-spacing-display-medium-mobile)}; --#{$prefix}font-letter-spacing-display-small: #{px-to-rem($ouds-font-letter-spacing-display-small-mobile)}; @@ -107,6 +109,7 @@ --#{$prefix}font-letter-spacing-label-large: #{px-to-rem($ouds-font-letter-spacing-label-large)}; --#{$prefix}font-letter-spacing-label-medium: #{px-to-rem($ouds-font-letter-spacing-label-medium)}; --#{$prefix}font-letter-spacing-label-small: #{px-to-rem($ouds-font-letter-spacing-label-small)}; + --#{$prefix}font-letter-spacing-code-medium: #{px-to-rem($ouds-font-letter-spacing-code-medium)}; --#{$prefix}font-max-width-display-large: #{px-to-rem($ouds-size-max-width-type-display-large-mobile)}; --#{$prefix}font-max-width-display-medium: #{px-to-rem($ouds-size-max-width-type-display-medium-mobile)}; --#{$prefix}font-max-width-display-small: #{px-to-rem($ouds-size-max-width-type-display-small-mobile)}; diff --git a/scss/tests/customize/_ouds-web-bootstrap-utilities.test.scss b/scss/tests/customize/_ouds-web-bootstrap-utilities.test.scss index 75e4a0741d..f0c332711a 100644 --- a/scss/tests/customize/_ouds-web-bootstrap-utilities.test.scss +++ b/scss/tests/customize/_ouds-web-bootstrap-utilities.test.scss @@ -3041,76 +3041,61 @@ $utilities: (); /* rtl:end:remove */ - .fs-dl { - max-width: var(--bs-font-max-width-display-large); - font-size: var(--bs-font-size-display-large); - line-height: var(--bs-font-line-height-display-large); - - /* rtl:remove */ - letter-spacing: var(--bs-font-letter-spacing-display-large); - } - - .fs-dm { - max-width: var(--bs-font-max-width-display-medium); - font-size: var(--bs-font-size-display-medium); - line-height: var(--bs-font-line-height-display-medium); + .fs-cs { + font-size: var(--bs-font-size-code-small); + line-height: var(--bs-font-line-height-code-small); /* rtl:remove */ - letter-spacing: var(--bs-font-letter-spacing-display-medium); + letter-spacing: var(--bs-font-letter-spacing-code-small); } - .fs-ds { - max-width: var(--bs-font-max-width-display-small); - font-size: var(--bs-font-size-display-small); - line-height: var(--bs-font-line-height-display-small); + .fs-cm { + font-size: var(--bs-font-size-code-medium); + line-height: var(--bs-font-line-height-code-medium); /* rtl:remove */ - letter-spacing: var(--bs-font-letter-spacing-display-small); + letter-spacing: var(--bs-font-letter-spacing-code-medium); } - .fs-hxl { - max-width: var(--bs-font-max-width-heading-xlarge); - font-size: var(--bs-font-size-heading-xlarge); - line-height: var(--bs-font-line-height-heading-xlarge); + .fs-ls { + font-size: var(--bs-font-size-label-small); + line-height: var(--bs-font-line-height-label-small); /* rtl:remove */ - letter-spacing: var(--bs-font-letter-spacing-heading-xlarge); + letter-spacing: var(--bs-font-letter-spacing-label-small); } - .fs-hl { - max-width: var(--bs-font-max-width-heading-large); - font-size: var(--bs-font-size-heading-large); - line-height: var(--bs-font-line-height-heading-large); + .fs-lm { + font-size: var(--bs-font-size-label-medium); + line-height: var(--bs-font-line-height-label-medium); /* rtl:remove */ - letter-spacing: var(--bs-font-letter-spacing-heading-large); + letter-spacing: var(--bs-font-letter-spacing-label-medium); } - .fs-hm { - max-width: var(--bs-font-max-width-heading-medium); - font-size: var(--bs-font-size-heading-medium); - line-height: var(--bs-font-line-height-heading-medium); + .fs-ll { + font-size: var(--bs-font-size-label-large); + line-height: var(--bs-font-line-height-label-large); /* rtl:remove */ - letter-spacing: var(--bs-font-letter-spacing-heading-medium); + letter-spacing: var(--bs-font-letter-spacing-label-large); } - .fs-hs { - max-width: var(--bs-font-max-width-heading-small); - font-size: var(--bs-font-size-heading-small); - line-height: var(--bs-font-line-height-heading-small); + .fs-lxl { + font-size: var(--bs-font-size-label-xlarge); + line-height: var(--bs-font-line-height-label-xlarge); /* rtl:remove */ - letter-spacing: var(--bs-font-letter-spacing-heading-small); + letter-spacing: var(--bs-font-letter-spacing-label-xlarge); } - .fs-bl { - max-width: var(--bs-font-max-width-body-large); - font-size: var(--bs-font-size-body-large); - line-height: var(--bs-font-line-height-body-large); + .fs-bs { + max-width: var(--bs-font-max-width-body-small); + font-size: var(--bs-font-size-body-small); + line-height: var(--bs-font-line-height-body-small); /* rtl:remove */ - letter-spacing: var(--bs-font-letter-spacing-body-large); + letter-spacing: var(--bs-font-letter-spacing-body-small); } .fs-bm { @@ -3122,61 +3107,76 @@ $utilities: (); letter-spacing: var(--bs-font-letter-spacing-body-medium); } - .fs-bs { - max-width: var(--bs-font-max-width-body-small); - font-size: var(--bs-font-size-body-small); - line-height: var(--bs-font-line-height-body-small); + .fs-bl { + max-width: var(--bs-font-max-width-body-large); + font-size: var(--bs-font-size-body-large); + line-height: var(--bs-font-line-height-body-large); /* rtl:remove */ - letter-spacing: var(--bs-font-letter-spacing-body-small); + letter-spacing: var(--bs-font-letter-spacing-body-large); } - .fs-lxl { - font-size: var(--bs-font-size-label-xlarge); - line-height: var(--bs-font-line-height-label-xlarge); + .fs-hs { + max-width: var(--bs-font-max-width-heading-small); + font-size: var(--bs-font-size-heading-small); + line-height: var(--bs-font-line-height-heading-small); /* rtl:remove */ - letter-spacing: var(--bs-font-letter-spacing-label-xlarge); + letter-spacing: var(--bs-font-letter-spacing-heading-small); } - .fs-ll { - font-size: var(--bs-font-size-label-large); - line-height: var(--bs-font-line-height-label-large); + .fs-hm { + max-width: var(--bs-font-max-width-heading-medium); + font-size: var(--bs-font-size-heading-medium); + line-height: var(--bs-font-line-height-heading-medium); /* rtl:remove */ - letter-spacing: var(--bs-font-letter-spacing-label-large); + letter-spacing: var(--bs-font-letter-spacing-heading-medium); } - .fs-lm { - font-size: var(--bs-font-size-label-medium); - line-height: var(--bs-font-line-height-label-medium); + .fs-hl { + max-width: var(--bs-font-max-width-heading-large); + font-size: var(--bs-font-size-heading-large); + line-height: var(--bs-font-line-height-heading-large); /* rtl:remove */ - letter-spacing: var(--bs-font-letter-spacing-label-medium); + letter-spacing: var(--bs-font-letter-spacing-heading-large); } - .fs-ls { - font-size: var(--bs-font-size-label-small); - line-height: var(--bs-font-line-height-label-small); + .fs-hxl { + max-width: var(--bs-font-max-width-heading-xlarge); + font-size: var(--bs-font-size-heading-xlarge); + line-height: var(--bs-font-line-height-heading-xlarge); /* rtl:remove */ - letter-spacing: var(--bs-font-letter-spacing-label-small); + letter-spacing: var(--bs-font-letter-spacing-heading-xlarge); } - .fs-cm { - font-size: var(--bs-font-size-code-medium); - line-height: var(--bs-font-line-height-code-medium); + .fs-ds { + max-width: var(--bs-font-max-width-display-small); + font-size: var(--bs-font-size-display-small); + line-height: var(--bs-font-line-height-display-small); /* rtl:remove */ - letter-spacing: var(--bs-font-letter-spacing-code-medium); + letter-spacing: var(--bs-font-letter-spacing-display-small); } - .fs-cs { - font-size: var(--bs-font-size-code-small); - line-height: var(--bs-font-line-height-code-small); + .fs-dm { + max-width: var(--bs-font-max-width-display-medium); + font-size: var(--bs-font-size-display-medium); + line-height: var(--bs-font-line-height-display-medium); /* rtl:remove */ - letter-spacing: var(--bs-font-letter-spacing-code-small); + letter-spacing: var(--bs-font-letter-spacing-display-medium); + } + + .fs-dl { + max-width: var(--bs-font-max-width-display-large); + font-size: var(--bs-font-size-display-large); + line-height: var(--bs-font-line-height-display-large); + + /* rtl:remove */ + letter-spacing: var(--bs-font-letter-spacing-display-large); } .fw-normal { @@ -13319,76 +13319,61 @@ $utilities: (); /* rtl:end:remove */ - .fs-dl { - max-width: var(--bs-font-max-width-display-large); - font-size: var(--bs-font-size-display-large); - line-height: var(--bs-font-line-height-display-large); - - /* rtl:remove */ - letter-spacing: var(--bs-font-letter-spacing-display-large); - } - - .fs-dm { - max-width: var(--bs-font-max-width-display-medium); - font-size: var(--bs-font-size-display-medium); - line-height: var(--bs-font-line-height-display-medium); + .fs-cs { + font-size: var(--bs-font-size-code-small); + line-height: var(--bs-font-line-height-code-small); /* rtl:remove */ - letter-spacing: var(--bs-font-letter-spacing-display-medium); + letter-spacing: var(--bs-font-letter-spacing-code-small); } - .fs-ds { - max-width: var(--bs-font-max-width-display-small); - font-size: var(--bs-font-size-display-small); - line-height: var(--bs-font-line-height-display-small); + .fs-cm { + font-size: var(--bs-font-size-code-medium); + line-height: var(--bs-font-line-height-code-medium); /* rtl:remove */ - letter-spacing: var(--bs-font-letter-spacing-display-small); + letter-spacing: var(--bs-font-letter-spacing-code-medium); } - .fs-hxl { - max-width: var(--bs-font-max-width-heading-xlarge); - font-size: var(--bs-font-size-heading-xlarge); - line-height: var(--bs-font-line-height-heading-xlarge); + .fs-ls { + font-size: var(--bs-font-size-label-small); + line-height: var(--bs-font-line-height-label-small); /* rtl:remove */ - letter-spacing: var(--bs-font-letter-spacing-heading-xlarge); + letter-spacing: var(--bs-font-letter-spacing-label-small); } - .fs-hl { - max-width: var(--bs-font-max-width-heading-large); - font-size: var(--bs-font-size-heading-large); - line-height: var(--bs-font-line-height-heading-large); + .fs-lm { + font-size: var(--bs-font-size-label-medium); + line-height: var(--bs-font-line-height-label-medium); /* rtl:remove */ - letter-spacing: var(--bs-font-letter-spacing-heading-large); + letter-spacing: var(--bs-font-letter-spacing-label-medium); } - .fs-hm { - max-width: var(--bs-font-max-width-heading-medium); - font-size: var(--bs-font-size-heading-medium); - line-height: var(--bs-font-line-height-heading-medium); + .fs-ll { + font-size: var(--bs-font-size-label-large); + line-height: var(--bs-font-line-height-label-large); /* rtl:remove */ - letter-spacing: var(--bs-font-letter-spacing-heading-medium); + letter-spacing: var(--bs-font-letter-spacing-label-large); } - .fs-hs { - max-width: var(--bs-font-max-width-heading-small); - font-size: var(--bs-font-size-heading-small); - line-height: var(--bs-font-line-height-heading-small); + .fs-lxl { + font-size: var(--bs-font-size-label-xlarge); + line-height: var(--bs-font-line-height-label-xlarge); /* rtl:remove */ - letter-spacing: var(--bs-font-letter-spacing-heading-small); + letter-spacing: var(--bs-font-letter-spacing-label-xlarge); } - .fs-bl { - max-width: var(--bs-font-max-width-body-large); - font-size: var(--bs-font-size-body-large); - line-height: var(--bs-font-line-height-body-large); + .fs-bs { + max-width: var(--bs-font-max-width-body-small); + font-size: var(--bs-font-size-body-small); + line-height: var(--bs-font-line-height-body-small); /* rtl:remove */ - letter-spacing: var(--bs-font-letter-spacing-body-large); + letter-spacing: var(--bs-font-letter-spacing-body-small); } .fs-bm { @@ -13400,61 +13385,76 @@ $utilities: (); letter-spacing: var(--bs-font-letter-spacing-body-medium); } - .fs-bs { - max-width: var(--bs-font-max-width-body-small); - font-size: var(--bs-font-size-body-small); - line-height: var(--bs-font-line-height-body-small); + .fs-bl { + max-width: var(--bs-font-max-width-body-large); + font-size: var(--bs-font-size-body-large); + line-height: var(--bs-font-line-height-body-large); /* rtl:remove */ - letter-spacing: var(--bs-font-letter-spacing-body-small); + letter-spacing: var(--bs-font-letter-spacing-body-large); } - .fs-lxl { - font-size: var(--bs-font-size-label-xlarge); - line-height: var(--bs-font-line-height-label-xlarge); + .fs-hs { + max-width: var(--bs-font-max-width-heading-small); + font-size: var(--bs-font-size-heading-small); + line-height: var(--bs-font-line-height-heading-small); /* rtl:remove */ - letter-spacing: var(--bs-font-letter-spacing-label-xlarge); + letter-spacing: var(--bs-font-letter-spacing-heading-small); } - .fs-ll { - font-size: var(--bs-font-size-label-large); - line-height: var(--bs-font-line-height-label-large); + .fs-hm { + max-width: var(--bs-font-max-width-heading-medium); + font-size: var(--bs-font-size-heading-medium); + line-height: var(--bs-font-line-height-heading-medium); /* rtl:remove */ - letter-spacing: var(--bs-font-letter-spacing-label-large); + letter-spacing: var(--bs-font-letter-spacing-heading-medium); } - .fs-lm { - font-size: var(--bs-font-size-label-medium); - line-height: var(--bs-font-line-height-label-medium); + .fs-hl { + max-width: var(--bs-font-max-width-heading-large); + font-size: var(--bs-font-size-heading-large); + line-height: var(--bs-font-line-height-heading-large); /* rtl:remove */ - letter-spacing: var(--bs-font-letter-spacing-label-medium); + letter-spacing: var(--bs-font-letter-spacing-heading-large); } - .fs-ls { - font-size: var(--bs-font-size-label-small); - line-height: var(--bs-font-line-height-label-small); + .fs-hxl { + max-width: var(--bs-font-max-width-heading-xlarge); + font-size: var(--bs-font-size-heading-xlarge); + line-height: var(--bs-font-line-height-heading-xlarge); /* rtl:remove */ - letter-spacing: var(--bs-font-letter-spacing-label-small); + letter-spacing: var(--bs-font-letter-spacing-heading-xlarge); } - .fs-cm { - font-size: var(--bs-font-size-code-medium); - line-height: var(--bs-font-line-height-code-medium); + .fs-ds { + max-width: var(--bs-font-max-width-display-small); + font-size: var(--bs-font-size-display-small); + line-height: var(--bs-font-line-height-display-small); /* rtl:remove */ - letter-spacing: var(--bs-font-letter-spacing-code-medium); + letter-spacing: var(--bs-font-letter-spacing-display-small); } - .fs-cs { - font-size: var(--bs-font-size-code-small); - line-height: var(--bs-font-line-height-code-small); + .fs-dm { + max-width: var(--bs-font-max-width-display-medium); + font-size: var(--bs-font-size-display-medium); + line-height: var(--bs-font-line-height-display-medium); /* rtl:remove */ - letter-spacing: var(--bs-font-letter-spacing-code-small); + letter-spacing: var(--bs-font-letter-spacing-display-medium); + } + + .fs-dl { + max-width: var(--bs-font-max-width-display-large); + font-size: var(--bs-font-size-display-large); + line-height: var(--bs-font-line-height-display-large); + + /* rtl:remove */ + letter-spacing: var(--bs-font-letter-spacing-display-large); } .fw-normal { diff --git a/site/content/docs/0.0/content/reboot.md b/site/content/docs/0.0/content/reboot.md index 375c997323..b9bfa0a81d 100644 --- a/site/content/docs/0.0/content/reboot.md +++ b/site/content/docs/0.0/content/reboot.md @@ -17,10 +17,10 @@ Reboot builds upon Normalize, providing many HTML elements with somewhat opinion Here are our guidelines and reasons for choosing what to override in Reboot: -- Update some browser default values to use `px`s instead of `em`s for scalable component spacing. +- Update some browser default values to use `px`s instead of `em`s for fixed component spacing, to keep as much space as possible for meaningful content on zoom. - Avoid `margin-top`. Vertical margins can collapse, yielding unexpected results. More importantly though, a single direction of `margin` is a simpler mental model. - For easier scaling across device sizes, block elements should use `px`s for `margin`s. -- Keep declarations of `font`-related properties to a minimum, using `inherit` whenever possible. We use `max-width` on all font references for readability reasons. If you want to get rid of the `max-width`, please make sure to use our `.mw-none` [width utilities]({{< docsref "/utilities/sizing" >}}). +- Keep declarations of `font`-related properties to a minimum, using `inherit` whenever possible. We use `max-width` on all font references for readability reasons. If you want to get rid of the `max-width`, please make sure to use our `.mw-none` [width utility]({{< docsref "/utilities/sizing" >}}). ## CSS variables diff --git a/site/content/docs/0.0/content/typography.md b/site/content/docs/0.0/content/typography.md index f2182a9a2c..5a5bfc9f59 100644 --- a/site/content/docs/0.0/content/typography.md +++ b/site/content/docs/0.0/content/typography.md @@ -1,7 +1,7 @@ --- layout: docs title: Typography -description: Documentation and examples for OUDS Web typography, including global settings, headings, body text, and more. +description: Documentation and examples for OUDS Web typography, including global settings, headings, body text, and more. group: content aliases: - "/docs/content/typography/" @@ -15,7 +15,7 @@ OUDS Web sets basic global display, typography. When mor - Use a [native font stack]({{< docsref "/content/reboot#native-font-stack" >}}) that selects the best `font-family` for each OS and device. - For a more inclusive and accessible type scale, we use the browser's default root `font-size` (typically 16px) so visitors can customize their browser defaults as needed. - Use the `$font-family-base`, `$font-size-base`, and `$line-height-base` attributes as our typographic base applied to the `
`. -- Use `max-width` on all font references for readability reasons. If you want to get rid of the `max-width`, please make sure to use our `.mw-none` [width utilities]({{< docsref "/utilities/sizing" >}}). +- Use `max-width` on all font references for readability reasons. If you want to get rid of the `max-width`, please make sure to use our `.mw-none` [width utility]({{< docsref "/utilities/sizing" >}}). @@ -27,7 +27,7 @@ If you need need to include a font reference inside a custom component, please r ## Headings -All HTML headings, `@@ -196,7 +196,7 @@ Make a paragraph stand out by adding `.lead`. It uses [Regular text](#regular-te ### Small -Render a paragraph with a small `font-size` by adding `.small` or use ``. It uses [Regular text](#regular-text) body small. +Render a paragraph with a small `font-size` by adding `.small` or use ``. It uses [Regular text](#regular-texts) body small. {{< example >}}
@@ -225,7 +225,7 @@ Styling for common inline HTML5 elements.
Beware that those tags should be used for semantic purpose:
- `` represents text which is marked or highlighted for reference or notation purposes.
-- `` represents side-comments and small print, like copyright and legal text. It uses [Regular text](#regular-text) body small.
+- `` represents side-comments and small print, like copyright and legal text. It uses [Regular text](#regular-texts) body small.
- `` represents element that are no longer relevant or no longer accurate.
- `` represents a span of inline text which should be rendered in a way that indicates that it has a non-textual annotation.
@@ -252,7 +252,7 @@ Stylized implementation of HTML's `` element for abbreviations and acronym
## Blockquotes
-For quoting blocks of content from another source within your document. Wrap `` around any HTML as the quote. It uses [Regular text](#regular-text) body large.
+For quoting blocks of content from another source within your document. Wrap `
` around any HTML as the quote. It uses [Regular text](#regular-texts) body large.
{{< example >}}
@@ -262,7 +262,7 @@ For quoting blocks of content from another source within your document. Wrap ``. When providing attribution, wrap your `
` in a `