Skip to content

Commit 1d59bc4

Browse files
remove display aliases
1 parent 40a6684 commit 1d59bc4

File tree

5 files changed

+21
-37
lines changed

5 files changed

+21
-37
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* **fonts:** Any use of `font-mozilla` mixin should be replaced with `font-mozilla-headline`. NOTE: we recommend `font-mozilla-headline` only for text over 24px (below should be `font-mozilla-text`)
1414
* Headings are now [balanced](https://developer.mozilla.org/docs/Web/CSS/text-wrap-style#balanced_text), which can impact other wrapping rules. Make sure any changes to `h1``h6` rendering end up styled as expected, especially if you apply any `white-space`, `word-break` or `hyphens` customizations.
1515
* Dropped support for font-sizes in pixels, all font-sizes are in rem now.
16+
* Removed `text-display-*` mixins. See migration notes for version 11.0.2.
1617
* See notes for [Protocol Assets 5.4.0](https://github.com/mozilla/protocol-assets/blob/main/CHANGELOG.md#540)
1718

1819
# 19.3.0

assets/sass/protocol/components/_sticky-promo.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ $logos: (
9292
}
9393

9494
.mzp-c-sticky-promo-title {
95-
@include text-display-xs;
95+
@include text-title-xs;
9696
margin-bottom: $spacing-xl;
9797
}
9898

assets/sass/protocol/includes/forms/_index.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ $line-height-shim: 0.15em; // two elements with text appear to have more space b
6767
@include text-body-sm;
6868
display: block;
6969
font-weight: bold;
70-
line-height: $text-body-line-height;
7170
margin: 0;
7271
padding-bottom: $label-v-spacing;
7372

assets/sass/protocol/includes/mixins/_typography.scss

Lines changed: 11 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@
4747
}
4848
}
4949

50+
// * -------------------------------------------------------------------------- */
51+
// Consistent font sizes. Avoid sizing text arbitrarily and use this
52+
// set of predefined sizes. Sizes adapt at common breakpoints, and
53+
// there's some redundancy at smaller sizes because we don't want things
54+
// getting too tiny.
55+
5056
// Example usage:
5157
// .title { @include text-title-xl; }
5258
// .subtitle { @include text-title-lg; }
@@ -95,48 +101,26 @@
95101
// body copy
96102
@mixin text-body-xl {
97103
font-size: var(--scale-body-xl);
98-
line-height: var(--title-body-line-height);
104+
line-height: var(--body-line-height);
99105
}
100106

101107
@mixin text-body-lg {
102108
font-size: var(--scale-body-lg);
103-
line-height: var(--title-body-line-height);
109+
line-height: var(--body-line-height);
104110
}
105111

106112
@mixin text-body-md {
107113
font-size: var(--scale-body-md);
108-
line-height: var(--title-body-line-height);
114+
line-height: var(--body-line-height);
109115
}
110116

111117
@mixin text-body-sm {
112118
font-size: var(--scale-body-sm);
113-
line-height: var(--title-body-line-height);
119+
line-height: var(--body-line-height);
114120
}
115121

116122
@mixin text-body-xs {
117123
font-size: var(--scale-body-xs);
118-
line-height: var(--title-body-line-height);
124+
line-height: var(--body-line-height);
119125
}
120126

121-
122-
123-
// Aliases for backwards compatibility
124-
$text-body-line-height: themes.$body-line-height;
125-
$text-title-line-height: themes.$title-md-line-height;
126-
$text-display-line-height: $text-title-line-height;
127-
128-
@mixin text-display-xxl { @include text-title-2xl; }
129-
130-
@mixin text-display-xl { @include text-title-xl; }
131-
132-
@mixin text-display-lg { @include text-title-lg; }
133-
134-
@mixin text-display-md { @include text-title-md; }
135-
136-
@mixin text-display-sm { @include text-title-sm; }
137-
138-
@mixin text-display-xs { @include text-title-xs; }
139-
140-
@mixin text-display-xxs { @include text-title-2xs; }
141-
142-
@mixin text-body-cta { @include text-body-md; }

assets/sass/protocol/includes/themes/_mozilla.scss

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,21 +47,21 @@
4747
--title-lg-size: 3rem;
4848
--title-lg-line-height: 1.1;
4949
--title-md-size: 2.375rem;
50-
--title-md-line-height: 1.05;
50+
--title-md-line-height: 1.1;
5151
--title-sm-size: 1.75rem;
52-
--title-sm-line-height: 1.07;
52+
--title-sm-line-height: 1.1;
5353
--title-xs-size: 1.5rem;
54-
--title-xs-line-height: 1.08;
54+
--title-xs-line-height: 1.1;
5555
--title-2xs-size: 1.125rem;
56-
--title-2xs-line-height: 1.11;
56+
--title-2xs-line-height: 1.1;
5757
--title-3xs-size: 1.125rem;
58-
--title-3xs-line-height: 1.11;
58+
--title-3xs-line-height: 1.1;
5959
--body-xl-size: 1.125rem;
6060
--body-lg-size: 1rem;
6161
--body-md-size: 0.875rem;
6262
--body-sm-size: 0.75rem;
6363
--body-xs-size: 0.75rem;
64-
--body-line-height: 1.5;
64+
--body-line-height: 1.2;
6565

6666
@media #{tokens.$mq-md} {
6767
--title-2xl-size: 4.75rem;
@@ -85,7 +85,7 @@
8585
--body-md-size: 1rem;
8686
--body-sm-size: 0.875rem;
8787
--body-xs-size: 0.75rem;
88-
--body-line-height: 1.2;
88+
// --body-line-height: 1.2; doesn't change, no need to update
8989
}
9090
}
9191

@@ -136,6 +136,6 @@
136136
--body-md-size: 0.875rem;
137137
--body-sm-size: 0.75rem;
138138
--body-xs-size: 0.688rem;
139-
--body-line-height: 1.5;
139+
// --body-line-height: 1.5; doesn't change, no need to update
140140
}
141141
}

0 commit comments

Comments
 (0)