Skip to content

Commit

Permalink
feat: remove ie support css styles (#592)
Browse files Browse the repository at this point in the history
* feat: remove ie support css styles

* feat: remove ms clear style

* feat: remove ms-high-contrast media css

* feat: remove placeholder mixin

---------

Co-authored-by: Sarin Udompanish <[email protected]>
Co-authored-by: Wasuwat Limsuparhat <[email protected]>
  • Loading branch information
3 people authored Feb 22, 2023
1 parent f479953 commit 851da09
Show file tree
Hide file tree
Showing 36 changed files with 23 additions and 122 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
[part=content] {
overflow: auto;
.touch-action();
.ie-scrollbars();
.mozilla-scrollbars();
}

Expand Down
1 change: 0 additions & 1 deletion packages/elemental-theme/src/custom-elements/ef-card.less
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
border-top: @separator-width solid @separator-color;
}

.ie-scrollbars();
.mozilla-scrollbars();
}
.webkit-scrollbars();
5 changes: 2 additions & 3 deletions packages/elemental-theme/src/custom-elements/ef-checkbox.less
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,9 @@
opacity: 0.65;
}

@media (-ms-high-contrast:none), (pointer:fine){
.desktop-specific({
&:focus [part="container"] {
.container-focus-styles;
}
}

});
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,6 @@
flex-flow: column nowrap;
}

.ie-specific({
[part~=list] ::slotted(ef-list) {
max-height: inherit;
}
});

[part=selection-badge] {
flex-shrink: 0;
}
Expand All @@ -56,9 +50,7 @@
opacity: 0.4;
}

.ie-scrollbars();
.mozilla-scrollbars();

}

.webkit-scrollbars();
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
border-top: @separator-width solid @separator-color;
background: @scrollbar-track-background-color;
}
.ie-scrollbars();
.mozilla-scrollbars();
}

Expand Down
5 changes: 0 additions & 5 deletions packages/elemental-theme/src/custom-elements/ef-icon.less
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@

--cdn-prefix: 'https://cdn.refinitiv.net/public/libs/elf/assets/elf-theme-halo/resources/icons/';

// to make :active work on IE11
svg {
pointer-events: none;
}

g,
path,
rect,
Expand Down
8 changes: 0 additions & 8 deletions packages/elemental-theme/src/custom-elements/ef-item.less
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,6 @@
box-sizing: border-box;
.touch-action();

.ie-specific({
&:after { /* IE11 fix for flex */
content: '';
min-height: inherit;
font-size: 0;
}
});

&[selected] {
color: @list-item-selected-text-color;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
:host([debug]) {
outline: 1px solid fade(@dataviz-color-primary, 33%);
outline-offset: -1px; // Doesn't work for IE but improves experience for other browsers.
outline-offset: -1px;
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
[part=search-holder] {
align-items: center;
}
.ie-scrollbars();
.mozilla-scrollbars();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
}
}

.ie-scrollbars();
.mozilla-scrollbars();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
box-shadow: @panel-box-shadow;
}

.ie-scrollbars();
.mozilla-scrollbars();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@
opacity: 0.65;
}

@media (-ms-high-contrast:none), (pointer:fine){
.desktop-specific({
&:focus [part="container"] {
.container-focus-styles;
}
}
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@

&[focused=visible] {
outline: @input-border-width @input-border-style @input-focused-border-color;
outline-offset: 2px; //not support IE11
outline-offset: 2px;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
max-height: var(--list-max-height);
}

.ie-scrollbars();
.mozilla-scrollbars();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

:host {
--sidebar-width: 250px;
.ie-scrollbars();
.mozilla-scrollbars();

&:not([sidebar-position]) [part=sidebar],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,6 @@
align-items: center;
user-select: none;

&:after { /* IE11 fix for flex */
content: '';
min-height: inherit;
font-size: 0;
}

[part=indent] {
height: 0;
width: 0;
Expand Down
1 change: 0 additions & 1 deletion packages/elemental-theme/src/native-elements/html.less
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ html {
height: 100%;
touch-action: manipulation; // Improve tap speed on mobile browsers
-webkit-tap-highlight-color: rgba(0,0,0,0);
.ie-scrollbars();
.mozilla-scrollbars();
@css-properties();
}
Expand Down
8 changes: 1 addition & 7 deletions packages/elemental-theme/src/responsive.less
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,7 @@
}

.desktop-specific(@styles) {
@media (-ms-high-contrast:none), (pointer:fine) {
@styles();
}
}

.ie-specific(@styles) {
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
@media (pointer:fine) {
@styles();
}
}
Expand Down
1 change: 0 additions & 1 deletion packages/elemental-theme/src/shared-styles/aria.less
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
.aria-invisible() {
clip: rect(1px, 1px, 1px, 1px); // IE11
clip-path: inset(50%);
height: 1px;
width: 1px;
Expand Down
3 changes: 0 additions & 3 deletions packages/elemental-theme/src/shared-styles/input.less
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@
.border(@input-disabled-border-color, @input-disabled-border-color);
}
}
::-ms-clear {
display: none;
}
}
// TODO: This function, with when (default()), causes build error in Halo. Need to recheck!
// .border(@input-border-color: @input-border-color, @input-border-color: @input-border-color) when (default()) {
Expand Down
1 change: 0 additions & 1 deletion packages/elemental-theme/src/shared-styles/list.less
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
background-color: @list-background-color;

.touch-action();
.ie-scrollbars();
.mozilla-scrollbars();

&:focus {
Expand Down
16 changes: 1 addition & 15 deletions packages/elemental-theme/src/shared-styles/scrollbar.less
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Helper Mixins. Shared between IE & Webkit.
// Helper Mixins for Webkit.
.scrollbar-corner-background(@property: background) {
@{property}: @scrollbar-corner-background-color;
}
Expand Down Expand Up @@ -186,19 +186,6 @@
}
}

// Basic colouring for IE
.ie-scrollbars() {
& {
.scrollbar-thumb-background(scrollbar-face-color);
.scrollbar-thumb-background(scrollbar-shadow-color);
.scrollbar-thumb-background(scrollbar-highlight-color);
.scrollbar-thumb-background(scrollbar-arrow-color);
.scrollbar-track-background(scrollbar-track-color);
.scrollbar-corner-background(scrollbar-3dlight-color);
.scrollbar-corner-background(scrollbar-darkshadow-color);
}
}

.mozilla-scrollbars () {
& {
scrollbar-color: @scrollbar-thumb-background-color @scrollbar-track-background-color;
Expand All @@ -207,5 +194,4 @@

.scrollbars() {
.webkit-scrollbars();
.ie-scrollbars();
}
1 change: 0 additions & 1 deletion packages/halo-theme/src/custom-elements/ef-accordion.less
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// @import '@refinitiv-ui/elemental-theme/src/custom-elements/ef-accordion';
@import '@refinitiv-ui/elemental-theme/src/custom-elements/ef-accordion';

:host {
Expand Down
6 changes: 0 additions & 6 deletions packages/halo-theme/src/custom-elements/ef-combo-box.less
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,4 @@
border-left-color: @input-focused-border-color;
}
}

// Fix for IE only
// Overrides select slotted styles
[part=list] ::slotted(ef-list) {
display: block;
}
}
14 changes: 0 additions & 14 deletions packages/halo-theme/src/custom-elements/ef-icon.less
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,5 @@
polygon {
vector-effect: non-scaling-stroke;
}

.ie-specific({
g,
path,
rect,
line,
circle,
ellipse,
polyline,
polygon {
vector-effect: none;
stroke-width: calc(@icon-size/0.01em); // Absolute hack for IE to enable stroke scaling!
}
});
}
}
1 change: 0 additions & 1 deletion packages/halo-theme/src/custom-elements/ef-select.less
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
display: none;
}
}
.ie-scrollbars();
.mozilla-scrollbars();
}

Expand Down
2 changes: 1 addition & 1 deletion packages/halo-theme/src/custom-elements/ef-tab-bar.less
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
[part=content] {
::slotted(ef-tab) {
border-bottom-color: transparent;
border-right: none !important; // won't work on IE11 without important
border-right: none;
background: linear-gradient(@tab-bar-background-color, @tab-bar-background-color) left @border-position / @border-side-size no-repeat,
linear-gradient(@tab-bar-background-color, @tab-bar-background-color) right @border-position / @border-side-size no-repeat,
linear-gradient(@tab-vertical-border-color, @tab-vertical-border-color) center @border-position / @border-center-size no-repeat;
Expand Down
6 changes: 0 additions & 6 deletions packages/halo-theme/src/custom-elements/ef-tree-select.less
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,4 @@
background: none;
}
}

// Fix for IE only
// Overrides select slotted styles
[part=list] ::slotted([part=section]) {
display: flex;
}
}
2 changes: 1 addition & 1 deletion packages/halo-theme/src/shared-styles/checkbox.less
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@

&[focused=visible] {
outline: @input-border-width @input-border-style @input-focused-border-color;
outline-offset: 2px; //not support IE11
outline-offset: 2px;
}
}
5 changes: 3 additions & 2 deletions packages/solar-theme/src/custom-elements/ef-checkbox.less
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@import '@refinitiv-ui/elemental-theme/src/custom-elements/ef-checkbox';
@import '../responsive';

:host {
[part=container] {
Expand Down Expand Up @@ -42,9 +43,9 @@
background-color: @input-disabled-background-color;
}

@media (-ms-high-contrast:none), (pointer:fine){
.desktop-specific({
&:focus [part=container] {
border: @input-border-width @input-focused-border-style @input-focused-border-color;
}
}
});
}
6 changes: 4 additions & 2 deletions packages/solar-theme/src/custom-elements/ef-radio-button.less
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@import '@refinitiv-ui/elemental-theme/src/custom-elements/ef-radio-button';
@import '../responsive';

:host {
[part=container] {
Expand Down Expand Up @@ -33,9 +34,10 @@
border-color: @input-disabled-border-color;
background-color: @input-disabled-background-color;
}
@media (-ms-high-contrast:none), (pointer:fine){

.desktop-specific({
&:focus [part=container] {
border: @input-border-width @input-focused-border-style @input-focused-border-color;
}
}
});
}
1 change: 0 additions & 1 deletion packages/solar-theme/src/custom-elements/ef-select.less
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
border: 1px solid @popup-border-color;
background-color: @button-background-color;
}
.ie-scrollbars();
.mozilla-scrollbars();
}

Expand Down
4 changes: 2 additions & 2 deletions packages/solar-theme/src/custom-elements/ef-text-field.less
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@

&[disabled] {
[part=input] {
.placeholder({
&::placeholder {
color: @input-disabled-placeholder-color;
});
}
}
}
}
2 changes: 1 addition & 1 deletion packages/solar-theme/src/custom-elements/ef-tree-item.less
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
}
&[focused=visible] {
outline: @tree-item-selected-outline;
outline-offset: -1px; // No IE support but it removes a sentient element
outline-offset: -1px;
border-color: transparent;
}
&:last-of-type {
Expand Down
4 changes: 3 additions & 1 deletion packages/solar-theme/src/native-elements/input.less
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ input[type=file] {
.input-solar;
color: inherit;
&[disabled] {
.placeholder({ color: @input-disabled-placeholder-color });
&::placeholder {
color: @input-disabled-placeholder-color;
}
}
&:focus {
.input-focus;
Expand Down
Loading

0 comments on commit 851da09

Please sign in to comment.