Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add animation link hover scss mixin #46

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

## 2.0.0

- FEATURE: Add animation link hover scss mixin. #46
- FEATURE: Add window scroll js component. #45
- FEATURE: Add animated menu button mixin. #44
- FEATURE: Add animated link scss mixin. #43
- FEATURE: Add default options to register component. #42
- BUGFIX: Fix path to index.js of library. #39
- ENHANCEMENT: Mark lazy.js implementation as experimental. #38
- ENHANCEMENT: Remove jQuery as dependency of web core js. #38
Expand Down
25 changes: 20 additions & 5 deletions scss/tools/_animation-link.scss
Original file line number Diff line number Diff line change
@@ -1,20 +1,35 @@
$animatedLinkColor: currentColor !default;
$animatedLinkSize: 2px !default;
$animatedLinkSize: 0.1em !default;
$animatedLinkSpeed: 0.25s !default;

@mixin animatedLink($color: $animatedLinkColor, $size: $animatedLinkSize) {
@mixin animatedLink($color: $animatedLinkColor) {
background-image: linear-gradient($color, $color);
background-position: left bottom;
background-repeat: no-repeat;
background-size: 100% $animatedLinkSize;

&:hover,
&:focus {
animation-duration: $animatedLinkSpeed;
animation-name: linkHoverAnimation;
animation-name: linkHover;
}
}

@mixin animatedLinkHover($color: $animatedLinkColor) {
background: none;

&:hover,
&:focus {
animation-duration: $animatedLinkSpeed;
animation-name: linkHover;
background-image: linear-gradient($color, $color);
background-position: left bottom;
background-repeat: no-repeat;
background-size: 100% $size;
background-size: 100% $animatedLinkSize;
}
}

@keyframes linkHoverAnimation {
@keyframes linkHover {
0% {
background-size: 0 $animatedLinkSize;
}
Expand Down