-
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
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?
- Loading branch information
Joen Asmussen
committed
Nov 13, 2018
1 parent
4cc3ac0
commit b87c5e9
Showing
15 changed files
with
81 additions
and
75 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,42 @@ | ||
@keyframes fade-in { | ||
from { | ||
opacity: 0; | ||
} | ||
to { | ||
opacity: 1; | ||
} | ||
} | ||
|
||
@mixin animate_fade { | ||
animation: animate_fade 0.1s ease-out; | ||
@mixin editor-animation__animate-fade { | ||
animation: editor-animation__animate-fade 0.1s ease-out; | ||
animation-fill-mode: forwards; | ||
} | ||
|
||
@mixin move_background { | ||
@mixin editor-animation__move-background { | ||
background-size: 28px 28px; | ||
animation: move_background 0.5s linear infinite; | ||
animation: editor-animation__move-background 0.5s linear infinite; | ||
} | ||
|
||
@mixin loading_fade { | ||
animation: loading_fade 1.6s ease-in-out infinite; | ||
@mixin editor-animation__loading-fade { | ||
animation: editor-animation__loading-fade 1.6s ease-in-out infinite; | ||
} | ||
|
||
@mixin slide_in_right { | ||
@mixin editor-animation__slide-in-right { | ||
transform: translateX(+100%); | ||
animation: slide_in_right 0.1s forwards; | ||
animation: editor-animation__slide-in-right 0.1s forwards; | ||
} | ||
|
||
@mixin slide_in_top { | ||
@mixin editor-animation__slide-in-top { | ||
transform: translateY(-100%); | ||
animation: slide_in_top 0.1s forwards; | ||
animation: editor-animation__slide-in-top 0.1s forwards; | ||
} | ||
|
||
@mixin fade_in($speed: 0.2s, $delay: 0s) { | ||
animation: fade-in $speed ease-out $delay; | ||
@mixin editor-animation__fade-in($speed: 0.2s, $delay: 0s) { | ||
animation: editor-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; | ||
@mixin editor-animation__region-focus($speed: 0.2s) { | ||
animation: editor-animation__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 editor-animation__rotation($speed: 1s) { | ||
animation: editor-animation__rotation $speed infinite linear; | ||
} | ||
|
||
@mixin modal_appear() { | ||
animation: modal-appear 0.1s ease-out; | ||
@mixin editor-animation__modal-appear() { | ||
animation: editor-animation__modal-appear 0.1s ease-out; | ||
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