From 780627c1269a3ca7a923ac38e633a14bbe7ef9b4 Mon Sep 17 00:00:00 2001 From: Ed Sanders Date: Thu, 9 Jun 2022 17:22:19 +0100 Subject: [PATCH] Remove unnecessary vendor prefixes and mixins for animations Deprecated in I8d62aedb. Change-Id: Id951fd394a2336920eddbba08dcb1a153b67b9f3 --- .storybook/mocks/README.md | 1 - .storybook/mocks/custom.less | 2 - .storybook/storybook-resources.sh | 1 - src/ui/mixins.less | 47 +++++-------------- src/ui/templates/popup/popup.less | 18 +++---- .../referencePreview/referencePreview.less | 1 - 6 files changed, 18 insertions(+), 52 deletions(-) diff --git a/.storybook/mocks/README.md b/.storybook/mocks/README.md index cc4396933..e9f4defd9 100644 --- a/.storybook/mocks/README.md +++ b/.storybook/mocks/README.md @@ -3,7 +3,6 @@ The following files: - mediawiki.mixins -- mediawiki.mixins.animation - mediawiki.mixins.less are LESS files containing one-line imports that correspond to files in diff --git a/.storybook/mocks/custom.less b/.storybook/mocks/custom.less index cfe706f56..261909ddc 100644 --- a/.storybook/mocks/custom.less +++ b/.storybook/mocks/custom.less @@ -26,12 +26,10 @@ body { * NOTE: To test the animation, remove these rules. */ .mwe-popups-fade-in-up { - -webkit-animation: none; animation: none; } .mwe-popups-fade-in-down { - -webkit-animation: none; animation: none; } diff --git a/.storybook/storybook-resources.sh b/.storybook/storybook-resources.sh index 0b5826ade..0e00cbed0 100755 --- a/.storybook/storybook-resources.sh +++ b/.storybook/storybook-resources.sh @@ -7,7 +7,6 @@ curl -sSL "https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/skins/Vector # MediaWiki LESS mixins curl https://raw.githubusercontent.com/wikimedia/mediawiki/master/resources/src/mediawiki.less/mediawiki.mixins.less -o .storybook/mocks/mediawiki.mixins.less -curl https://raw.githubusercontent.com/wikimedia/mediawiki/master/resources/src/mediawiki.less/mediawiki.mixins.animation.less -o .storybook/mocks/mediawiki.mixins.animation.less # mediawiki.ui variables curl https://raw.githubusercontent.com/wikimedia/mediawiki/master/resources/src/mediawiki.less/mediawiki.ui/variables.less -o .storybook/mocks/mediawiki.ui/variables.less diff --git a/src/ui/mixins.less b/src/ui/mixins.less index 12beaa561..012ef34bf 100644 --- a/src/ui/mixins.less +++ b/src/ui/mixins.less @@ -1,4 +1,3 @@ -@import 'mediawiki.mixins.animation.less'; @import 'mediawiki.mixins.less'; /* @@ -35,42 +34,20 @@ left: @left; } -.mwe-popups-translate( @x, @y ) { - -webkit-transform: translate( @x, @y ); - -ms-transform: translate( @x, @y ); - transform: translate( @x, @y ); -} - /* FIXME: Use Phuedx's approach to make this cleaner https://gist.github.com/phuedx/0639a279b6efb1a71474 */ -@-webkit-keyframes mwe-popups-fade-in-up { - .mwe-popups-fade-in-up-frames; -} - @keyframes mwe-popups-fade-in-up { .mwe-popups-fade-in-up-frames; } -@-webkit-keyframes mwe-popups-fade-in-down { - .mwe-popups-fade-in-down-frames; -} - @keyframes mwe-popups-fade-in-down { .mwe-popups-fade-in-down-frames; } -@-webkit-keyframes mwe-popups-fade-out-down { - .mwe-popups-fade-out-down-frames; -} - @keyframes mwe-popups-fade-out-down { .mwe-popups-fade-out-down-frames; } -@-webkit-keyframes mwe-popups-fade-out-up { - .mwe-popups-fade-out-up-frames; -} - @keyframes mwe-popups-fade-out-up { .mwe-popups-fade-out-up-frames; } @@ -78,63 +55,63 @@ .mwe-popups-fade-in-up-frames() { 0% { opacity: 0; - .mwe-popups-translate( 0, 20px ); + transform: translate( 0, 20px ); } 100% { opacity: 1; - .mwe-popups-translate( 0, 0 ); + transform: translate( 0, 0 ); } } .mwe-popups-fade-in-down-frames() { 0% { opacity: 0; - .mwe-popups-translate( 0, -20px ); + transform: translate( 0, -20px ); } 100% { opacity: 1; - .mwe-popups-translate( 0, 0 ); + transform: translate( 0, 0 ); } } .mwe-popups-fade-out-down-frames() { 0% { opacity: 1; - .mwe-popups-translate( 0, 0 ); + transform: translate( 0, 0 ); } 100% { opacity: 0; - .mwe-popups-translate( 0, 20px ); + transform: translate( 0, 20px ); } } .mwe-popups-fade-out-up-frames() { 0% { opacity: 1; - .mwe-popups-translate( 0, 0 ); + transform: translate( 0, 0 ); } 100% { opacity: 0; - .mwe-popups-translate( 0, -20px ); + transform: translate( 0, -20px ); } } .mwe-popups-fade-in-up { - .animation( mwe-popups-fade-in-up, 0.2s, ease, forwards ); + animation: mwe-popups-fade-in-up 0.2s ease forwards; } .mwe-popups-fade-in-down { - .animation( mwe-popups-fade-in-down, 0.2s, ease, forwards ); + animation: mwe-popups-fade-in-down 0.2s ease forwards; } .mwe-popups-fade-out-down { - .animation( mwe-popups-fade-out-down, 0.2s, ease, forwards ); + animation: mwe-popups-fade-out-down 0.2s ease forwards; } .mwe-popups-fade-out-up { - .animation( mwe-popups-fade-out-up, 0.2s, ease, forwards ); + animation: mwe-popups-fade-out-up 0.2s ease forwards; } diff --git a/src/ui/templates/popup/popup.less b/src/ui/templates/popup/popup.less index 3de59f041..aaf92bfd5 100644 --- a/src/ui/templates/popup/popup.less +++ b/src/ui/templates/popup/popup.less @@ -109,8 +109,6 @@ /* @noflip */ right: 0; /* @noflip */ - background-image: -webkit-linear-gradient( to right, rgba( 255, 255, 255, 0 ), rgba( 255, 255, 255, 1 ) 50% ); - /* @noflip */ background-image: linear-gradient( to right, rgba( 255, 255, 255, 0 ), rgba( 255, 255, 255, 1 ) 50% ); } @@ -118,8 +116,6 @@ /* @noflip */ left: 0; /* @noflip */ - background-image: -webkit-linear-gradient( to left, rgba( 255, 255, 255, 0 ), rgba( 255, 255, 255, 1 ) 50% ); - /* @noflip */ background-image: linear-gradient( to left, rgba( 255, 255, 255, 0 ), rgba( 255, 255, 255, 1 ) 50% ); } @@ -129,8 +125,6 @@ /* @noflip */ bottom: 0; /* @noflip */ - background-image: -webkit-linear-gradient( to bottom, rgba( 255, 255, 255, 0 ), rgba( 255, 255, 255, 1 ) 75% ); - /* @noflip */ background-image: linear-gradient( to bottom, rgba( 255, 255, 255, 0 ), rgba( 255, 255, 255, 1 ) 75% ); } /* stylelint-enable function-linear-gradient-no-nonstandard-direction */ @@ -364,36 +358,36 @@ // Position the SVG border .mwe-popups-is-tall { polyline { - .mwe-popups-translate( 0, 0 ); + transform: translate( 0, 0 ); } &.flipped-x-y { polyline { - .mwe-popups-translate( 0, -8px ); + transform: translate( 0, -8px ); } } &.flipped-x { polyline { - .mwe-popups-translate( 0, 8px ); + transform: translate( 0, 8px ); } } } .rtl .mwe-popups-is-tall { polyline { - .mwe-popups-translate( -100%, 0 ); + transform: translate( -100%, 0 ); } &.flipped-x-y { polyline { - .mwe-popups-translate( -100%, -8px ); + transform: translate( -100%, -8px ); } } &.flipped-x { polyline { - .mwe-popups-translate( -100%, 8px ); + transform: translate( -100%, 8px ); } } } diff --git a/src/ui/templates/referencePreview/referencePreview.less b/src/ui/templates/referencePreview/referencePreview.less index ea5e4c0b6..ce05cbb68 100644 --- a/src/ui/templates/referencePreview/referencePreview.less +++ b/src/ui/templates/referencePreview/referencePreview.less @@ -51,7 +51,6 @@ width: 100%; height: @lineHeight; background-color: transparent; - background-image: -webkit-linear-gradient( top, rgba( 255, 255, 255, 0 ), rgba( 255, 255, 255, 1 ) ); background-image: linear-gradient( rgba( 255, 255, 255, 0 ), rgba( 255, 255, 255, 1 ) ); opacity: 0; pointer-events: none; // Allows clicking "through" the element