Skip to content

Commit c717ea4

Browse files
authored
refactor(multiple): clean up IE vendor prefixes (#23416)
Cleans up the styles specifically for IE and Edge.
1 parent 9a4a4cf commit c717ea4

File tree

10 files changed

+3
-79
lines changed

10 files changed

+3
-79
lines changed

.stylelintrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
],
1818
"rules": {
1919
"material/no-prefixes": [true, {
20-
"browsers": ["last 2 versions", "not dead", "not and_qq > 0", "not OperaMini all"],
20+
"browsers": ["last 2 versions", "not dead", "not and_qq > 0", "not OperaMini all", "not ie > 0", "not edge < 78"],
2121
"filePattern": "**/!(*-example.css)"
2222
}],
2323
"material/theme-mixin-api": true,

src/components-examples/material/core/ripple-overview/ripple-overview-example.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
user-select: none;
1010
-webkit-user-select: none;
1111
-moz-user-select: none;
12-
-ms-user-select: none;
1312

1413
-webkit-user-drag: none;
1514
-webkit-tap-highlight-color: transparent;

src/dev-app/menubar/mat-menubar-demo.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,4 @@
2424
padding: 16px;
2525
-webkit-user-select: none;
2626
-moz-user-select: none;
27-
-ms-user-select: none;
2827
}

src/dev-app/virtual-scroll/virtual-scroll-demo.scss

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@
1515
}
1616

1717
.demo-item {
18-
-ms-writing-mode: tb-lr;
1918
-webkit-writing-mode: vertical-lr;
20-
// stylelint-disable-next-line material/no-prefixes
2119
writing-mode: vertical-lr;
2220
}
2321
}

src/material-experimental/mdc-form-field/_form-field-native-select.scss

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
@use 'sass:map';
22
@use 'sass:math';
33
@use '../mdc-helpers/mdc-helpers';
4-
@use '../../cdk/a11y';
54
@use '../../material/core/theming/palette';
65
@use '@material/theme/theme-color' as mdc-theme-color;
76

@@ -25,36 +24,12 @@ $mat-form-field-select-horizontal-end-padding: $mat-form-field-select-arrow-widt
2524
display: inline-flex;
2625
box-sizing: border-box;
2726

28-
// Hides the default arrow native selects.
29-
&::-ms-expand {
30-
display: none;
31-
}
32-
3327
// By default the cursor does not change when hovering over a select. We want to
3428
// change this for non-disabled select elements so that it's more obvious that the
3529
// control can be clicked.
3630
&:not(:disabled) {
3731
cursor: pointer;
3832
}
39-
40-
// As a part of its user agent styling, IE11 has a blue box inside each focused `select`
41-
// element which we have to reset. Note that this needs to be in its own selector, because
42-
// having it together with another one will cause other browsers to ignore it.
43-
&::-ms-value {
44-
// We need to reset the `color` as well, because IE sets it to white.
45-
color: inherit;
46-
background: none;
47-
48-
// IE and Edge in high contrast mode reset the color for a focused select to the same color
49-
// as the background, however this causes it blend in because we've reset the `background`
50-
// above. We have to add a more specific selector in order to ensure that it gets the
51-
// `color` from our theme instead.
52-
@include a11y.high-contrast(active, off) {
53-
.mat-focused & {
54-
color: inherit;
55-
}
56-
}
57-
}
5833
}
5934

6035
// Native select elements with the `matInput` directive should have Material Design

src/material/core/style/_vendor-prefixes.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
@mixin user-select($value) {
33
-webkit-user-select: $value;
44
-moz-user-select: $value;
5-
-ms-user-select: $value;
65
user-select: $value;
76
}
87

@@ -19,6 +18,8 @@
1918
@content;
2019
}
2120

21+
// Note: this isn't necessary anymore since we don't support
22+
// IE, but it caused some presubmit failures in #23416.
2223
&:-ms-input-placeholder {
2324
@content;
2425
}

src/material/datepicker/date-range-input.scss

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,6 @@ $date-range-input-part-max-width: calc(50% - #{$date-range-input-separator-spaci
5555
-webkit-appearance: none;
5656
width: 100%;
5757

58-
// Remove IE's default clear and reveal icons.
59-
&::-ms-clear,
60-
&::-ms-reveal {
61-
display: none;
62-
}
63-
6458
// Undo the red box-shadow glow added by Firefox on invalid inputs.
6559
// See https://developer.mozilla.org/en-US/docs/Web/CSS/:-moz-ui-invalid
6660
&:-moz-ui-invalid {

src/material/form-field/_form-field-legacy-theme.scss

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,6 @@ $legacy-dedupe: 0;
5050
// translateZ fixes.
5151
transform: translateY(-$infix-margin-top - $infix-padding) scale($font-scale) perspective(100px)
5252
translateZ(0.001px + $legacy-dedupe);
53-
// The tricks above used to smooth out the animation on chrome and firefox actually make things
54-
// worse on IE, so we don't include them in the IE version.
55-
-ms-transform: translateY(-$infix-margin-top - $infix-padding + $legacy-dedupe)
56-
scale($font-scale);
57-
5853
width: math.div(100%, $font-scale) + $legacy-dedupe;
5954

6055
$legacy-dedupe: $legacy-dedupe + 0.00001 !global;

src/material/form-field/form-field-input.scss

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,6 @@
4444
box-shadow: none;
4545
}
4646

47-
// Remove IE's default clear and reveal icons.
48-
&::-ms-clear,
49-
&::-ms-reveal {
50-
display: none;
51-
}
52-
5347
// Clear Safari's decorations for search fields.
5448
&,
5549
&::-webkit-search-cancel-button,
@@ -100,12 +94,6 @@
10094
// happen, however it's possible to do it when clicking on a disabled input (see #13479).
10195
@include vendor-prefixes.user-select(none);
10296

103-
&:-ms-input-placeholder {
104-
// fix IE11 not able to focus programmatically with css style -ms-user-select: none
105-
// see https://github.com/angular/components/issues/15093
106-
-ms-user-select: text;
107-
}
108-
10997
// Delay the transition until the label has animated about a third of the way through, in
11098
// order to prevent the placeholder from overlapping for a split second.
11199
transition: color variables.$swift-ease-out-duration
@@ -169,10 +157,6 @@ select.mat-input-element {
169157
top: -1em;
170158
margin-bottom: -1em;
171159

172-
&::-ms-expand {
173-
display: none;
174-
}
175-
176160
// The `outline: none` from `.mat-input-element` works on all browsers, however Firefox also
177161
// adds a special `focus-inner` which we have to disable explicitly. See:
178162
// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#Firefox
@@ -183,26 +167,6 @@ select.mat-input-element {
183167
&:not(:disabled) {
184168
cursor: pointer;
185169
}
186-
187-
// As a part of its user agent styling, IE11 has a blue box inside each focused
188-
// `select` element which we have to reset. Note that this needs to be in its own
189-
// selector, because having it together with another one will cause other browsers
190-
// to ignore it.
191-
&::-ms-value {
192-
// We need to reset the `color` as well, because IE sets it to white.
193-
color: inherit;
194-
background: none;
195-
196-
// IE and Edge in high contrast mode reset the color for a focused select to the same color
197-
// as the background, however this causes it blend in because we've reset the `background`
198-
// above. We have to add a more specific selector in order to ensure that it gets the
199-
// `color` from our theme instead.
200-
@include a11y.high-contrast(active, off) {
201-
.mat-focused & {
202-
color: inherit;
203-
}
204-
}
205-
}
206170
}
207171

208172
.mat-form-field-type-mat-native-select {

src/material/form-field/form-field-legacy.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ $legacy-underline-height: 1px !default;
1010
.mat-form-field-appearance-legacy {
1111
.mat-form-field-label {
1212
transform: perspective(100px);
13-
-ms-transform: none;
1413
}
1514

1615
.mat-form-field-prefix,

0 commit comments

Comments
 (0)