-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Code Quality: Improve prefix, better scope, for animations (#11752)
* Code Quality: Improve prefix, better scope, for animations This PR maybe fixes #11673, maybe fixes #11668. At least, this is the intention. It does two things: - It changes the naming scheme for all animations. Instead of having a mix of underscores and dashes for word separation, it uses BEM (to the best of my ability) to add consistency and a new naming convention for all animations. - It adds a prefix to all animations, indicating they are for the editor. Though perhaps we should have a more _admin_ specific prefix given these might one day be used outside the admin? - It moves all keyframe animations out of the mixins file, and into the edit-post style. This is because keyframe definitions don't work well with mixins and are just duplicated. This PR has been tested for all the animations I could find that were using the ones defined. But please give me a sanity check. By the way I noticed the following two animations do not appear to be used: - editor-animation__animate-fade - editor-animation__move-background Should we remove those? Or can anyone recall where they were intended to be used? * Address feedback. This retires a few animations, and moves others that are only used once to their respective scopes. * Address comment. Gallery related, in #11668 (comment). * Address feedback. * Address final point.
- Loading branch information
Showing
16 changed files
with
88 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,78 +1,8 @@ | ||
@keyframes fade-in { | ||
from { | ||
opacity: 0; | ||
} | ||
to { | ||
opacity: 1; | ||
} | ||
@mixin edit-post__loading-fade-animation { | ||
animation: edit-post__loading-fade-animation 1.6s ease-in-out infinite; | ||
} | ||
|
||
@mixin animate_fade { | ||
animation: animate_fade 0.1s ease-out; | ||
animation-fill-mode: forwards; | ||
} | ||
|
||
@mixin move_background { | ||
background-size: 28px 28px; | ||
animation: move_background 0.5s linear infinite; | ||
} | ||
|
||
@mixin loading_fade { | ||
animation: loading_fade 1.6s ease-in-out infinite; | ||
} | ||
|
||
@mixin slide_in_right { | ||
transform: translateX(+100%); | ||
animation: slide_in_right 0.1s forwards; | ||
} | ||
|
||
@mixin slide_in_top { | ||
transform: translateY(-100%); | ||
animation: slide_in_top 0.1s forwards; | ||
} | ||
|
||
@mixin fade_in($speed: 0.2s, $delay: 0s) { | ||
animation: fade-in $speed ease-out $delay; | ||
animation-fill-mode: forwards; | ||
} | ||
|
||
@keyframes editor_region_focus { | ||
from { | ||
box-shadow: inset 0 0 0 0 $blue-medium-400; | ||
} | ||
to { | ||
box-shadow: inset 0 0 0 4px $blue-medium-400; | ||
} | ||
} | ||
|
||
@mixin region_focus($speed: 0.2s) { | ||
animation: editor_region_focus $speed ease-out; | ||
animation-fill-mode: forwards; | ||
} | ||
|
||
@keyframes rotation { | ||
from { | ||
transform: rotate(0deg); | ||
} | ||
to { | ||
transform: rotate(360deg); | ||
} | ||
} | ||
|
||
@mixin animate_rotation($speed: 1s) { | ||
animation: rotation $speed infinite linear; | ||
} | ||
|
||
@keyframes modal-appear { | ||
from { | ||
margin-top: $grid-size * 4; | ||
} | ||
to { | ||
margin-top: 0; | ||
} | ||
} | ||
|
||
@mixin modal_appear() { | ||
animation: modal-appear 0.1s ease-out; | ||
@mixin edit-post__fade-in-animation($speed: 0.2s, $delay: 0s) { | ||
animation: edit-post__fade-in-animation $speed ease-out $delay; | ||
animation-fill-mode: forwards; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters