From 070b2696badad56f7714f32634a8ba7810452f23 Mon Sep 17 00:00:00 2001 From: Benjy Cui Date: Fri, 8 Sep 2017 13:08:46 +0800 Subject: [PATCH] chore: remove hacks for IE8-, close: #7447 (#7512) --- components/cascader/style/index.less | 1 - components/checkbox/style/mixin.less | 19 +-------------- components/menu/style/index.less | 2 -- components/radio/style/index.less | 2 +- components/select/style/index.less | 1 - components/spin/index.tsx | 2 +- components/style/core/iconfont.less | 2 -- components/style/mixins/compatibility.less | 27 ---------------------- components/style/mixins/iconfont.less | 5 ++-- components/style/mixins/index.less | 1 - components/style/mixins/opacity.less | 8 ------- components/tree-select/style/index.less | 1 - components/tree/style/index.less | 1 - 13 files changed, 5 insertions(+), 67 deletions(-) delete mode 100644 components/style/mixins/opacity.less diff --git a/components/cascader/style/index.less b/components/cascader/style/index.less index f6202ff9e1..d30004fad9 100644 --- a/components/cascader/style/index.less +++ b/components/cascader/style/index.less @@ -96,7 +96,6 @@ transition: transform 0.2s ease; } &&-expand { - .ie-rotate(2); &:before { transform: rotate(180deg); } diff --git a/components/checkbox/style/mixin.less b/components/checkbox/style/mixin.less index b8759b4dd9..59945c9b26 100644 --- a/components/checkbox/style/mixin.less +++ b/components/checkbox/style/mixin.less @@ -70,7 +70,7 @@ left: 0; z-index: 1; cursor: pointer; - .opacity(0); + opacity: 0; top: 0; bottom: 0; right: 0; @@ -168,23 +168,6 @@ display: inline-block; } } - - @ie8: \0screen; - - // IE8 hack for https://github.com/ant-design/ant-design/issues/2148 - @media @ie8 { - .@{checkbox-prefix-cls}-checked .@{checkbox-prefix-cls}-inner:before, - .@{checkbox-prefix-cls}-checked .@{checkbox-prefix-cls}-inner:after { - .iconfont-font("\e632"); - font-weight: bold; - font-size: 8px; - border: 0; - color: #fff; - left: 2px; - top: 3px; - position: absolute; - } - } } @keyframes antCheckboxEffect { diff --git a/components/menu/style/index.less b/components/menu/style/index.less index c547bdd3dc..3d2047d335 100644 --- a/components/menu/style/index.less +++ b/components/menu/style/index.less @@ -250,7 +250,6 @@ position: absolute; content: "\e61d"; right: 16px; - .ie-rotate(3); transform: rotate(270deg) scale(0.75); } @@ -270,7 +269,6 @@ &-open { &.@{menu-prefix-cls}-submenu-inline > .@{menu-prefix-cls}-submenu-title:after { - .ie-rotate(1); transform: rotate(180deg) scale(0.75); } } diff --git a/components/radio/style/index.less b/components/radio/style/index.less index 7d9c4b06ea..b71c8d0295 100644 --- a/components/radio/style/index.less +++ b/components/radio/style/index.less @@ -209,7 +209,7 @@ span.@{radio-prefix-cls} + * { .@{radio-prefix-cls}-inner, input[type="checkbox"], input[type="radio"] { - .opacity(0); + opacity: 0; width: 0; height: 0; } diff --git a/components/select/style/index.less b/components/select/style/index.less index 45aba5a454..8e9b4e0f22 100644 --- a/components/select/style/index.less +++ b/components/select/style/index.less @@ -359,7 +359,6 @@ &-open { .@{select-prefix-cls}-arrow { - .ie-rotate(2); -ms-transform: rotate(180deg); &:before { transform: rotate(180deg); diff --git a/components/spin/index.tsx b/components/spin/index.tsx index eb8ec5c16e..a96dad21b3 100644 --- a/components/spin/index.tsx +++ b/components/spin/index.tsx @@ -48,7 +48,7 @@ export default class Spin extends React.Component { componentDidMount() { if (!isCssAnimationSupported()) { - // Show text in IE8/9 + // Show text in IE9 this.setState({ notCssAnimationSupported: true, }); diff --git a/components/style/core/iconfont.less b/components/style/core/iconfont.less index 8e55c75fe7..c2ca85a296 100644 --- a/components/style/core/iconfont.less +++ b/components/style/core/iconfont.less @@ -4,8 +4,6 @@ font-family: 'anticon'; src: url('@{icon-url}.eot'); /* IE9*/ src: - /* IE6-IE8 */ - url('@{icon-url}.eot?#iefix') format('embedded-opentype'), /* chrome、firefox */ url('@{icon-url}.woff') format('woff'), /* chrome、firefox、opera、Safari, Android, iOS 4.2+*/ diff --git a/components/style/mixins/compatibility.less b/components/style/mixins/compatibility.less index 7e1202af41..89269ebfb0 100644 --- a/components/style/mixins/compatibility.less +++ b/components/style/mixins/compatibility.less @@ -1,32 +1,5 @@ // Compatibility for browsers. -// rotate for ie8 and blow -.ie-rotate(@rotation) { - -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=@{rotation})"; -} - -// rotate for ie8 and blow -// degrees unit -.ie-rotate-via-degrees(@degrees) { - /* IE6-IE8 */ - @radians: ~`parseInt("@{degrees}") * Math.PI * 2 / 360`; - @costheta: ~`Math.cos("@{radians}")`; - @sintheta: ~`Math.sin("@{radians}")`; - @negsintheta: ~`"@{sintheta}" * -1`; - -ms-filter: "progid:DXImageTransform.Microsoft.Matrix(sizingMethod='auto expand', M11=@{costheta}, M12=@{negsintheta}, M21=@{sintheta}, M22=@{costheta})"; - zoom: 1; - - :root & { - filter: none; - } -} - -// support rotate for all browsers -.cross-rotate(@degrees) { - .rotate(@degrees); - .ie-rotate-via-degrees(@degrees); -} - // Placeholder text .placeholder(@color: @input-placeholder-color) { // Firefox diff --git a/components/style/mixins/iconfont.less b/components/style/mixins/iconfont.less index cb85ddb51b..5ede78a0f8 100644 --- a/components/style/mixins/iconfont.less +++ b/components/style/mixins/iconfont.less @@ -28,11 +28,10 @@ display: inline-block; @font-scale: unit(@size / 12px); font-size: @font-size-base; - // ie8-9 + // IE9 font-size: ~"@{size} \9"; // lesshint duplicateProperty: false transform: scale(@font-scale) rotate(@rotate); - .ie-rotate-via-degrees(@rotate); :root & { - font-size: @font-size-base; // reset ie9 and above + font-size: @font-size-base; // reset IE9 and above } } diff --git a/components/style/mixins/index.less b/components/style/mixins/index.less index c331b159fb..3f17b789e8 100644 --- a/components/style/mixins/index.less +++ b/components/style/mixins/index.less @@ -1,6 +1,5 @@ // Mixins // -------------------------------------------------- -@import "opacity"; @import "size"; @import "compatibility"; @import "clearfix"; diff --git a/components/style/mixins/opacity.less b/components/style/mixins/opacity.less deleted file mode 100644 index 33ed25ce67..0000000000 --- a/components/style/mixins/opacity.less +++ /dev/null @@ -1,8 +0,0 @@ -// Opacity - -.opacity(@opacity) { - opacity: @opacity; - // IE8 filter - @opacity-ie: (@opacity * 100); - filter: ~"alpha(opacity=@{opacity-ie})"; -} diff --git a/components/tree-select/style/index.less b/components/tree-select/style/index.less index e1c1bd2bc1..39373476e3 100644 --- a/components/tree-select/style/index.less +++ b/components/tree-select/style/index.less @@ -82,7 +82,6 @@ } &.@{select-tree-prefix-cls}-switcher_close { .antTreeSwitcherIcon(); - .ie-rotate(3); &:after { transform: rotate(270deg) scale(0.59); } diff --git a/components/tree/style/index.less b/components/tree/style/index.less index e75d3928fb..62c6c9be37 100644 --- a/components/tree/style/index.less +++ b/components/tree/style/index.less @@ -107,7 +107,6 @@ } &.@{tree-prefix-cls}-switcher_close { .antTreeSwitcherIcon(); - .ie-rotate(3); &:after { transform: rotate(270deg) scale(0.59); }