diff --git a/CHANGELOG.md b/CHANGELOG.md index 1e9136f62..5f8dbbcee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,7 +28,7 @@ Introducing theme variables! CSS variables beginning with `--theme-` will adjust * Reorganization: * (breaking) Renamed `-title-` to `-heading-` in mixins and CSS vars * and `mzp-u-heading-*` utility classes - * component HTML/CSS classes will follow in a separate PR + * component HTML/CSS classes: see Component Naming below * Added font-family declaration to `@include text-body-*` mixins * Added `--theme-` prefix to variables expected to morph * Added `--token-` prefix to unchanging variables @@ -49,6 +49,20 @@ Introducing theme variables! CSS variables beginning with `--theme-` will adjust * Added status color variables (`--theme-color-success-*`, `--theme-color-error-*`, `--theme-color-warning-*`, `--theme-color-info-*`) * Removed Sass color variables from `_themes-sass.scss` (use CSS variables instead) +### Component Naming + +* (breaking) Renamed the remaining `-title`/`-subtitle` component classes to `-heading`/`-subheading`, finishing the rename the Typography section above started for mixins/utility classes/CSS vars. Affects Article, Billboard, Callout, Card, Form, Menu, Menu Item, Menu List, Newsletter, Sidebar Menu, and Sticky Promo (#668): + * `mzp-c-menu-title` → `mzp-c-menu-heading` + * `mzp-c-form-title` → `mzp-c-form-heading`, `mzp-c-form-subtitle` → `mzp-c-form-subheading` + * `mzp-c-card-title` → `mzp-c-card-heading` + * `mzp-c-menu-item-title`, `mzp-c-callout-title`, `mzp-c-sticky-promo-title`, `mzp-c-newsletter-title`, `mzp-c-menu-list-title`, `mzp-c-sidemenu-title`, `mzp-c-billboard-title`, `mzp-c-article-title` → the equivalent `-heading` +* (breaking) Renamed the remaining `-desc` component classes to `-body`, matching the `desc`/`body` naming already used by Picto. Affects Billboard, Callout, Card, and Menu Item: + * `mzp-c-callout-desc` → `mzp-c-callout-body` + * `mzp-c-card-desc` → `mzp-c-card-body` + * `mzp-c-menu-item-desc` → `mzp-c-menu-item-body` + * `mzp-c-billboard-desc` → `mzp-c-billboard-body` +* Clean break, no aliases -- see the [Migration Guide](https://protocol.mozilla.org/docs/usage/migration) for find/replace scripts + ## Component changes ### Feature Card diff --git a/assets/sass/protocol/components/_callout.scss b/assets/sass/protocol/components/_callout.scss index 3d203fff9..03c28de89 100644 --- a/assets/sass/protocol/components/_callout.scss +++ b/assets/sass/protocol/components/_callout.scss @@ -10,7 +10,7 @@ .mzp-c-callout { text-align: center; - .mzp-c-callout-desc { + .mzp-c-callout-body { margin-bottom: $spacing-lg; @include text-body-lg; } @@ -35,7 +35,7 @@ @include text-heading-sm; } - .mzp-c-callout-desc { + .mzp-c-callout-body { @include text-body-md; } @@ -65,11 +65,11 @@ } .mzp-c-callout-heading, - .mzp-c-callout-desc { + .mzp-c-callout-body { margin-bottom: 0; } - .mzp-c-callout-heading + .mzp-c-callout-desc { + .mzp-c-callout-heading + .mzp-c-callout-body { margin-top: $spacing-sm; } } diff --git a/assets/sass/protocol/components/_card.scss b/assets/sass/protocol/components/_card.scss index 5ad65d78e..43cb1a98f 100644 --- a/assets/sass/protocol/components/_card.scss +++ b/assets/sass/protocol/components/_card.scss @@ -81,7 +81,7 @@ border-bottom: 2px solid transparent; } - .mzp-c-card-desc { + .mzp-c-card-body { margin: $spacing-xs 0 0; } @@ -161,7 +161,7 @@ @include text-heading-md; } - .mzp-c-card-desc { + .mzp-c-card-body { @include text-body-lg; } } @@ -179,7 +179,7 @@ @include text-heading-2xs; } - .mzp-c-card-desc { + .mzp-c-card-body { @include text-body-sm; } diff --git a/assets/sass/protocol/components/_menu-item.scss b/assets/sass/protocol/components/_menu-item.scss index bd160383f..a3aa55982 100644 --- a/assets/sass/protocol/components/_menu-item.scss +++ b/assets/sass/protocol/components/_menu-item.scss @@ -60,7 +60,7 @@ $icon-size: 24px; display: inline; } - .mzp-c-menu-item-desc { + .mzp-c-menu-item-body { margin: $spacing-sm 0 0; @include text-body-sm; } diff --git a/components/billboard/billboard.config.yml b/components/billboard/billboard.config.yml index 28ec8125b..aa2fdf45b 100644 --- a/components/billboard/billboard.config.yml +++ b/components/billboard/billboard.config.yml @@ -1,6 +1,6 @@ preview: '@preview-unpadded' context: heading: Example headline with 35 characters - desc: A description with a maximum of 100 characters. That usually means only one or two sentences. + body: A description with a maximum of 100 characters. That usually means only one or two sentences. cta: Learn more cta_link: '#' diff --git a/components/billboard/billboard.html b/components/billboard/billboard.html index f93246fe0..314d4fecf 100644 --- a/components/billboard/billboard.html +++ b/components/billboard/billboard.html @@ -5,7 +5,7 @@ # image - path # heading - string # heading_el - HTML heading element (h1, h2, h3, h4, h5, h6) -# desc - string +# body - string # cta - string # cta_link - url #} @@ -17,8 +17,8 @@
{{ desc }}
+ {%- if body %} +{{ body }}
{% endif -%} {%- if cta %} {{ cta }} diff --git a/components/callout/callout--example.html b/components/callout/callout--example.html index 6d45916ff..13fe87a81 100644 --- a/components/callout/callout--example.html +++ b/components/callout/callout--example.html @@ -3,7 +3,7 @@This is an example of a more elaborate Callout component like you might see as a page header or other prominent callout. It features a logo and two short paragraphs as a description, one of which is perhaps a little too long. Centered text is hard to read in large blocks so it‘s best to keep it short.
It also has a video.
{{ desc }}
+ {%- if body %} +{{ body }}
{{ desc }}
{% endif %} + {% if body %}{{ body }}
{% endif %} {% if cta %}{{ cta }}
{% endif %} {% if meta %}{% endif %}