Skip to content

Commit f3f82aa

Browse files
remove display aliases
1 parent 3b092b4 commit f3f82aa

File tree

5 files changed

+28
-44
lines changed

5 files changed

+28
-44
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
## Migration Tips
1212

1313
* Dropped support for font-sizes in pixels, all font-sizes are in rem now.
14+
* Removed `text-display-*` mixins. See migration notes for version 11.0.2.
1415
* See notes for [Protocol Assets 5.4.0](https://github.com/mozilla/protocol-assets/blob/main/CHANGELOG.md#540)
1516

1617
# 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
@@ -43,6 +43,12 @@
4343
}
4444
}
4545

46+
// * -------------------------------------------------------------------------- */
47+
// Consistent font sizes. Avoid sizing text arbitrarily and use this
48+
// set of predefined sizes. Sizes adapt at common breakpoints, and
49+
// there's some redundancy at smaller sizes because we don't want things
50+
// getting too tiny.
51+
4652
// Example usage:
4753
// .title { @include text-title-xl; }
4854
// .subtitle { @include text-title-lg; }
@@ -91,48 +97,26 @@
9197
// body copy
9298
@mixin text-body-xl {
9399
font-size: var(--scale-body-xl);
94-
line-height: var(--title-body-line-height);
100+
line-height: var(--body-line-height);
95101
}
96102

97103
@mixin text-body-lg {
98104
font-size: var(--scale-body-lg);
99-
line-height: var(--title-body-line-height);
105+
line-height: var(--body-line-height);
100106
}
101107

102108
@mixin text-body-md {
103109
font-size: var(--scale-body-md);
104-
line-height: var(--title-body-line-height);
110+
line-height: var(--body-line-height);
105111
}
106112

107113
@mixin text-body-sm {
108114
font-size: var(--scale-body-sm);
109-
line-height: var(--title-body-line-height);
115+
line-height: var(--body-line-height);
110116
}
111117

112118
@mixin text-body-xs {
113119
font-size: var(--scale-body-xs);
114-
line-height: var(--title-body-line-height);
120+
line-height: var(--body-line-height);
115121
}
116122

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

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

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -37,27 +37,27 @@
3737
%mozilla-type-scale {
3838
// type scale
3939
--title-2xl-size: 4.125rem;
40-
--title-2xl-line-height: 1;
40+
--title-2xl-line-height: 1.1;
4141
--title-xl-size: 3.5rem;
42-
--title-xl-line-height: 1;
42+
--title-xl-line-height: 1.1;
4343
--title-lg-size: 3rem;
44-
--title-lg-line-height: 1;
44+
--title-lg-line-height: 1.1;
4545
--title-md-size: 2.375rem;
46-
--title-md-line-height: 1.05;
46+
--title-md-line-height: 1.1;
4747
--title-sm-size: 1.75rem;
48-
--title-sm-line-height: 1.07;
48+
--title-sm-line-height: 1.1;
4949
--title-xs-size: 1.5rem;
50-
--title-xs-line-height: 1.08;
50+
--title-xs-line-height: 1.1;
5151
--title-2xs-size: 1.125rem;
52-
--title-2xs-line-height: 1.11;
52+
--title-2xs-line-height: 1.1;
5353
--title-3xs-size: 1.125rem;
54-
--title-3xs-line-height: 1.11;
54+
--title-3xs-line-height: 1.1;
5555
--body-xl-size: 1.125rem;
5656
--body-lg-size: 1rem;
5757
--body-md-size: 0.875rem;
5858
--body-sm-size: 0.75rem;
5959
--body-xs-size: 0.75rem;
60-
--body-line-height: 1.5;
60+
--body-line-height: 1.2;
6161

6262
@media #{tokens.$mq-md} {
6363
--title-2xl-size: 4.75rem;
@@ -69,19 +69,19 @@
6969
--title-md-size: 3rem;
7070
--title-md-line-height: 1;
7171
--title-sm-size: 2.375rem;
72-
--title-sm-line-height: 1.05;
72+
--title-sm-line-height: 1;
7373
--title-xs-size: 1.75rem;
74-
--title-xs-line-height: 1.07;
74+
--title-xs-line-height: 1;
7575
--title-2xs-size: 1.5rem;
76-
--title-2xs-line-height: 1.08;
76+
--title-2xs-line-height: 1;
7777
--title-3xs-size: 1.125rem;
78-
--title-3xs-line-height: 1.11;
78+
--title-3xs-line-height: 1;
7979
--body-xl-size: 1.313rem;
8080
--body-lg-size: 1.125rem;
8181
--body-md-size: 1rem;
8282
--body-sm-size: 0.875rem;
8383
--body-xs-size: 0.75rem;
84-
--body-line-height: 1.5;
84+
// --body-line-height: 1.2; doesn't change, no need to update
8585
}
8686
}
8787

@@ -132,6 +132,6 @@
132132
--body-md-size: 0.875rem;
133133
--body-sm-size: 0.75rem;
134134
--body-xs-size: 0.688rem;
135-
--body-line-height: 1.5;
135+
// --body-line-height: 1.5; doesn't change, no need to update
136136
}
137137
}

0 commit comments

Comments
 (0)