Skip to content

Commit 19d2f6c

Browse files
Remove all mixins supporting vendor prefixes (Fix #957)
This version removes mixins which added vendor-prefixes. Browser support for these is now excellent. - One migration path is to edit your code to use the unprefixed versions. - Another option is to move these utility mixins into your own code base (though, be aware they are no longer used in Protocol and this will not give you backwards compatible Protocol components). - If you need that level of vendor prefix support consider adding a tool such as [autoprefixer](https://github.com/postcss/autoprefixer) to your code base. - Effected mixins are: - `animation` - `appearance` - `background-size` - `box-decoration-break` - `box-sizing` - `flexbox`, `flex`, `flex-direction`, `flex-wrap`, `align-itmes`, `justify-content,` - `transform`, `transform-origin`, `transform-style` - `transition`, `transition-property`, `transition-duration`, `transition-delay` Disable no-unknown-animation rule on animations
1 parent 054482e commit 19d2f6c

23 files changed

+98
-223
lines changed

CHANGELOG.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,28 @@
1+
# HEAD
2+
3+
* **css:** (breaking) Remove support for vendor prefixing (#957)
4+
5+
## Migration Tips
6+
7+
* This version removes mixins which added vendor-prefixes. Browser support for these is now excellent.
8+
- One migration path is to edit your code to use the unprefixed versions.
9+
- Another option is to move these utility mixins into your own code base (though, be aware they are
10+
no longer used in Protocol and this will not give you backwards compatible Protocol components).
11+
- If you need that level of vendor prefix support consider adding a tool such as
12+
[autoprefixer](https://github.com/postcss/autoprefixer) to your code base.
13+
- Affected mixins are:
14+
- `animation`
15+
- `appearance`
16+
- `background-size`
17+
- `box-decoration-break`
18+
- `box-sizing`
19+
- `flexbox`, `flex`, `flex-direction`, `flex-wrap`, `align-items`, `justify-content`
20+
- `grid*-gap`
21+
- `inline-block`
22+
- `multi-column*`
23+
- `transform`, `transform-origin`, `transform-style`
24+
- `transition`, `transition-property`, `transition-duration`, `transition-delay`
25+
126
# 22.0.0
227

328
## Features
@@ -84,6 +109,7 @@
84109

85110
* **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`)
86111
* 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.
112+
87113
* See notes for [Protocol Assets 5.4.0](https://github.com/mozilla/protocol-assets/blob/main/CHANGELOG.md#540)
88114

89115
# 19.3.0

assets/sass/protocol/base/elements/_forms.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,8 +297,8 @@ input[type='file'] {
297297
// with thanks to https://www.filamentgroup.com/lab/select-css.html
298298

299299
select {
300-
@include appearance(none);
301-
@include border-box;
300+
appearance: none;
301+
box-sizing: border-box;
302302
@include bidi((
303303
(background-position, right 8px top 50%, left 8px top 50%),
304304
(padding, forms.$field-padding forms.$symbol-spacing forms.$field-padding forms.$field-padding, forms.$field-padding forms.$field-padding forms.$field-padding forms.$symbol-spacing),

assets/sass/protocol/components/_billboard.scss

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ $billboard-content-width-lg: 374px + $spacing-md; // content width + spacing med
1313
position: relative;
1414

1515
.mzp-c-billboard-content {
16-
@include border-box;
16+
box-sizing: border-box;
1717
margin: 0 auto;
1818
max-width: 346px;
1919
text-align: center;
@@ -51,9 +51,9 @@ $billboard-content-width-lg: 374px + $spacing-md; // content width + spacing med
5151
}
5252

5353
.mzp-c-billboard-content-container {
54-
@include align-items(center);
55-
@include flexbox;
56-
@include justify-content(center);
54+
align-items: center;
55+
display: flex;
56+
justify-content: center;
5757
}
5858

5959
.mzp-c-billboard-image-container {
@@ -98,7 +98,7 @@ $billboard-content-width-lg: 374px + $spacing-md; // content width + spacing med
9898
margin: $layout-xl 0;
9999

100100
.mzp-c-billboard-content {
101-
@include border-box;
101+
box-sizing: border-box;
102102
max-width: 374px;
103103
}
104104

assets/sass/protocol/components/_button.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
// Button shape and size
1111

1212
.mzp-c-button {
13-
@include border-box;
13+
box-sizing: border-box;
1414
@include font-size(16px);
15-
@include transition(background-color 100ms, border-color 100ms, color 100ms);
15+
transition: background-color 100ms, box-shadow 100ms, color 100ms;
1616
border: 2px solid transparent;
1717
cursor: pointer;
1818
display: inline-block;

assets/sass/protocol/components/_callout.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
@supports (display: grid) {
7272
@media #{$mq-md} {
7373
.mzp-l-content {
74-
@include grid-column-gap($spacing-xl);
74+
grid-column-gap: $spacing-xl;
7575
display: grid;
7676
grid-template-columns: 2fr 1fr;
7777
}
@@ -82,7 +82,7 @@
8282
}
8383

8484
.mzp-c-callout-cta {
85-
@include flexbox;
85+
display: flex;
8686
align-items: center;
8787
justify-content: flex-end;
8888
width: auto;

assets/sass/protocol/components/_card.scss

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// Base card class
99

1010
.mzp-c-card {
11-
@include border-box;
11+
box-sizing: border-box;
1212
background: $color-white;
1313
margin-bottom: $spacing-lg;
1414

@@ -40,7 +40,7 @@
4040
}
4141

4242
.mzp-c-card-content {
43-
@include border-box;
43+
box-sizing: border-box;
4444
padding: $spacing-sm;
4545
}
4646

@@ -103,12 +103,12 @@
103103
&:hover,
104104
&:active,
105105
&:focus {
106-
@include transition(box-shadow 0.1s ease-in-out);
106+
transition: box-shadow 0.1s ease-in-out;
107107
box-shadow: 0 0 0 4px $color-marketing-gray-20;
108108

109109
.mzp-c-card-title,
110110
.mzp-c-card-cta-text {
111-
@include transition(border-bottom-color 100ms ease-in-out);
111+
transition: border-bottom-color 100ms ease-in-out;
112112
border-bottom: 2px solid;
113113
}
114114
}

assets/sass/protocol/components/_feature-card.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,11 +159,11 @@
159159
&.mzp-l-card-feature-right-half,
160160
&.mzp-l-card-feature-left-third,
161161
&.mzp-l-card-feature-right-third {
162-
@include grid-column-gap($spacing-xl);
162+
grid-column-gap: $spacing-xl;
163163
display: grid;
164164

165165
.mzp-c-card-feature-content {
166-
@include flexbox;
166+
display: flex;
167167
align-items: center;
168168
}
169169
}
@@ -220,7 +220,7 @@
220220
&.mzp-l-card-feature-right-half,
221221
&.mzp-l-card-feature-left-third,
222222
&.mzp-l-card-feature-right-third {
223-
@include grid-column-gap($spacing-2xl);
223+
grid-column-gap: $spacing-2xl;
224224
}
225225
}
226226
}

assets/sass/protocol/components/_footer.scss

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838

3939
.mzp-c-footer-primary {
4040
@include text-body-md;
41-
@include border-box;
41+
box-sizing: border-box;
4242
@include clearfix;
4343
margin: 0 auto $layout-sm;
4444

@@ -59,7 +59,7 @@
5959

6060
a {
6161
background: url('#{$image-path}/logos/mozilla/logo-lockup-hor-white.svg') no-repeat;
62-
@include background-size(134px, 32px);
62+
background-size: 134px, 32px;
6363
@include image-replaced;
6464
display: inline-block;
6565
height: 32px;
@@ -171,10 +171,9 @@
171171

172172
button::before {
173173
background: $url-image-expand-white top left no-repeat;
174-
175-
@include background-size(24px, 24px);
174+
background-size: 24px, 24px;
176175
@include bidi(((right, 8px, left, auto),));
177-
@include transition(transform 100ms ease-in-out);
176+
transition: transform 100ms ease-in-out;
178177
content: '';
179178
height: 24px;
180179
margin-top: -12px;
@@ -184,7 +183,7 @@
184183
}
185184

186185
button[aria-expanded='true']::before {
187-
@include transform(rotate(45deg));
186+
transform: rotate(45deg);
188187
}
189188
}
190189

assets/sass/protocol/components/_menu-item.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ $icon-size: 24px;
1919
&:active,
2020
&:focus {
2121
.mzp-c-menu-item-title {
22-
@include transition(border-bottom-color 100ms ease-in-out);
22+
transition: border-bottom-color 100ms ease-in-out;
2323
border-bottom: 2px solid $color-black;
2424
color: $color-black;
2525
}
@@ -114,7 +114,7 @@ $icon-size: 24px;
114114

115115
@media #{$mq-md} {
116116
&:hover {
117-
@include transition(box-shadow 0.1s ease-in-out);
117+
transition: box-shadow 0.1s ease-in-out;
118118
box-shadow: 0 0 0 4px $color-marketing-gray-20;
119119
}
120120

assets/sass/protocol/components/_menu-list.scss

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
@include bidi(((padding-right, $spacing-sm * 2 + 14px, padding-left, $spacing-sm),));
3939

4040
&::after {
41-
@include background-size(20px, 20px);
41+
background-size: 20px, 20px;
4242
@include bidi(((right, $spacing-sm, left, auto),));
4343
bottom: $spacing-sm;
4444
content: '';
@@ -87,7 +87,6 @@
8787
width: 100%;
8888

8989
&::after {
90-
@include background-size(20px, 20px);
9190
@include bidi(((right, 0, left, auto),));
9291
background: $url-image-caret-down-link center bottom no-repeat;
9392
bottom: 1px;
@@ -96,12 +95,11 @@
9695
position: absolute;
9796
top: 0;
9897
width: 16px;
99-
100-
@include transition(transform 200ms ease-in-out);
98+
transition: transform 200ms ease-in-out;
10199
}
102100

103101
&[aria-expanded='true']::after {
104-
@include transform(scaleY(-1));
102+
transform: scaleY(-1);
105103
}
106104

107105
&:hover,

0 commit comments

Comments
 (0)