Skip to content
This repository has been archived by the owner on Sep 9, 2022. It is now read-only.

Commit

Permalink
fix(Mixins.Loading): added the ability to provide a custom path
Browse files Browse the repository at this point in the history
  • Loading branch information
cecilia-sanare committed Aug 21, 2021
1 parent 2b752d5 commit da0b3ed
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
11 changes: 1 addition & 10 deletions stories/Button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ a.button {

.button {
@include transition(color, background-color);
@include loading(false, '> .content');

display: inline-block;
white-space: nowrap;
Expand Down Expand Up @@ -62,14 +63,4 @@ a.button {
&.disabled {
@include disabled();
}

> .content {
@include transition(opacity);

opacity: 1;
}

&.loading > .content {
opacity: 0;
}
}
10 changes: 5 additions & 5 deletions stories/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,23 @@
transition-property: $properties;
}

@mixin loading($visibleWhenLoading: false) {
@mixin loading($visibleWhenLoading: false, $path: '') {
@include transition(opacity);

@if $visibleWhenLoading {
&:not(.loading) {
&:not(.loading) #{$path} {
opacity: 0;
}

&.loading {
&.loading #{$path} {
opacity: 1;
}
} @else {
&:not(.loading) {
&:not(.loading) #{$path} {
opacity: 1;
}

&.loading {
&.loading #{$path} {
opacity: 0;
}
}
Expand Down

0 comments on commit da0b3ed

Please sign in to comment.