Skip to content

Commit 27f344f

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 865863d commit 27f344f

24 files changed

+89
-225
lines changed

CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ The good news is we don't expect any visible changes in modern browsers and you
66

77
Introducing theme variables! CSS variables beginning with `--theme-` will adjust based on media queries.
88

9+
## Browser Support
10+
11+
* **css:** (breaking) Remove support for vendor prefixing (#957)
912

1013
## Typography
1114

@@ -65,6 +68,24 @@ See the [Migration Guide](https://protocol.mozilla.org/docs/usage/migration) for
6568
* `type-scale()` function and associated lookup tables
6669
* `text-body-cta` mixin (use `text-body-md` instead)
6770
* You can remove `@supports (--css: variables)` blocks that only contain font declarations, as CSS custom properties are now required.
71+
* This version removes mixins which added vendor-prefixes. Browser support for these is now excellent.
72+
- One migration path is to edit your code to use the unprefixed versions.
73+
- Another option is to move these utility mixins into your own code base (though, be aware they are
74+
no longer used in Protocol and this will not give you backwards compatible Protocol components).
75+
- If you need that level of vendor prefix support consider adding a tool such as
76+
[autoprefixer](https://github.com/postcss/autoprefixer) to your code base.
77+
- Affected mixins are:
78+
- `animation`
79+
- `appearance`
80+
- `background-size`
81+
- `box-decoration-break`
82+
- `box-sizing`
83+
- `flexbox`, `flex`, `flex-direction`, `flex-wrap`, `align-items`, `justify-content`
84+
- `grid*-gap`
85+
- `inline-block`
86+
- `multi-column*`
87+
- `transform`, `transform-origin`, `transform-style`
88+
- `transition`, `transition-property`, `transition-duration`, `transition-delay`
6889

6990
# 22.0.0
7091

@@ -152,6 +173,7 @@ See the [Migration Guide](https://protocol.mozilla.org/docs/usage/migration) for
152173

153174
* **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`)
154175
* 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.
176+
155177
* See notes for [Protocol Assets 5.4.0](https://github.com/mozilla/protocol-assets/blob/main/CHANGELOG.md#540)
156178

157179
# 19.3.0

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

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

300300
select {
301-
@include appearance(none);
302-
@include border-box;
301+
appearance: none;
302+
box-sizing: border-box;
303303
@include bidi((
304304
(background-position, right 8px top 50%, left 8px top 50%),
305305
(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/base/elements/_reset.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ img,
7575
video,
7676
object,
7777
embed {
78-
-ms-interpolation-mode: bicubic;
7978
height: auto;
8079
max-width: 100%;
8180
}

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, border-color 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
@@ -37,8 +37,8 @@
3737
// Footer primary section, contains logo and sections with links
3838

3939
.mzp-c-footer-primary {
40+
box-sizing: border-box;
4041
margin: 0 auto $layout-sm;
41-
@include border-box;
4242
@include clearfix;
4343
@include text-body-md;
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;
@@ -176,10 +176,9 @@
176176

177177
button::before {
178178
background: $url-image-expand-white top left no-repeat;
179-
180-
@include background-size(24px, 24px);
179+
background-size: 24px, 24px;
181180
@include bidi(((right, 8px, left, auto),));
182-
@include transition(transform 100ms ease-in-out);
181+
transition: transform 100ms ease-in-out;
183182
content: '';
184183
height: 24px;
185184
margin-top: -12px;
@@ -189,7 +188,7 @@
189188
}
190189

191190
button[aria-expanded='true']::before {
192-
@include transform(rotate(45deg));
191+
transform: rotate(45deg);
193192
}
194193
}
195194

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

0 commit comments

Comments
 (0)