Skip to content

Commit

Permalink
Check empty apply
Browse files Browse the repository at this point in the history
  • Loading branch information
jinsupark committed Jun 27, 2022
1 parent 5c8c879 commit d053d46
Showing 1 changed file with 90 additions and 86 deletions.
176 changes: 90 additions & 86 deletions uniform/_index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -838,94 +838,24 @@ $merged-class-set: map.merge($standard-class-set, $responsive-class-set);
// Apply mixin
@mixin apply($utilities) {
$utility-array: core.string-split($utilities, ' ');

@each $utility in $utility-array {

$escaped-utility: core.escape($utility);
@if map.get($merged-class-set, $escaped-utility) == null {
@error '[#{$utility}] could not be found, please check your spelling.';
} @else {
$target-utility: map.get($merged-class-set, $escaped-utility);
$properties: map.get($target-utility, properties);
$selector: map.get($target-utility, selector);
$category: map.get($target-utility, category);
$extra-selector: map.get($target-utility, extra-selector);
$all-pseudos: map.get($config, pseudos);
$pseudo: map.get($target-utility, pseudo);
$screen: map.get($target-utility, screen);

@if $screen == null {
@if $category == pseudo {
@if $pseudo == group-hover {
@at-root .group:hover & {
@if $extra-selector == null {
@each $property, $value in $properties {
#{$property}: #{$value};
}
} @else {
& #{$extra-selector} {
@each $property, $value in $properties {
#{$property}: #{$value};
}
}
}
}
} @else if $pseudo == group-focus {
@at-root .group:focus & {
@if $extra-selector == null {
@each $property, $value in $properties {
#{$property}: #{$value};
}
} @else {
& #{$extra-selector} {
@each $property, $value in $properties {
#{$property}: #{$value};
}
}
}
}
} @else if $pseudo == checked-sibling {
@at-root input:checked ~ & {
@if $extra-selector == null {
@each $property, $value in $properties {
#{$property}: #{$value};
}
} @else {
& #{$extra-selector} {
@each $property, $value in $properties {
#{$property}: #{$value};
}
}
}
}
} @else if $pseudo != none {
@at-root &#{map.get($all-pseudos, $pseudo)} {
@if $extra-selector == null {
@each $property, $value in $properties {
#{$property}: #{$value};
}
} @else {
& #{$extra-selector} {
@each $property, $value in $properties {
#{$property}: #{$value};
}
}
}
}
}
} @else {
@if $extra-selector == null {
@each $property, $value in $properties {
#{$property}: #{$value};
}
} @else {
& #{$extra-selector} {
@each $property, $value in $properties {
#{$property}: #{$value};
}
}
}
}
@if $escaped-utility != "" {
@if map.get($merged-class-set, $escaped-utility) == null {
@error '[#{$utility}] could not be found, please check your spelling.';
} @else {
@media (min-width: map.get($config, screens, $screen)) {
$target-utility: map.get($merged-class-set, $escaped-utility);
$properties: map.get($target-utility, properties);
$selector: map.get($target-utility, selector);
$category: map.get($target-utility, category);
$extra-selector: map.get($target-utility, extra-selector);
$all-pseudos: map.get($config, pseudos);
$pseudo: map.get($target-utility, pseudo);
$screen: map.get($target-utility, screen);

@if $screen == null {
@if $category == pseudo {
@if $pseudo == group-hover {
@at-root .group:hover & {
Expand Down Expand Up @@ -970,7 +900,7 @@ $merged-class-set: map.merge($standard-class-set, $responsive-class-set);
}
}
} @else if $pseudo != none {
@at-root &:#{$pseudo} {
@at-root &#{map.get($all-pseudos, $pseudo)} {
@if $extra-selector == null {
@each $property, $value in $properties {
#{$property}: #{$value};
Expand All @@ -997,6 +927,80 @@ $merged-class-set: map.merge($standard-class-set, $responsive-class-set);
}
}
}
} @else {
@media (min-width: map.get($config, screens, $screen)) {
@if $category == pseudo {
@if $pseudo == group-hover {
@at-root .group:hover & {
@if $extra-selector == null {
@each $property, $value in $properties {
#{$property}: #{$value};
}
} @else {
& #{$extra-selector} {
@each $property, $value in $properties {
#{$property}: #{$value};
}
}
}
}
} @else if $pseudo == group-focus {
@at-root .group:focus & {
@if $extra-selector == null {
@each $property, $value in $properties {
#{$property}: #{$value};
}
} @else {
& #{$extra-selector} {
@each $property, $value in $properties {
#{$property}: #{$value};
}
}
}
}
} @else if $pseudo == checked-sibling {
@at-root input:checked ~ & {
@if $extra-selector == null {
@each $property, $value in $properties {
#{$property}: #{$value};
}
} @else {
& #{$extra-selector} {
@each $property, $value in $properties {
#{$property}: #{$value};
}
}
}
}
} @else if $pseudo != none {
@at-root &:#{$pseudo} {
@if $extra-selector == null {
@each $property, $value in $properties {
#{$property}: #{$value};
}
} @else {
& #{$extra-selector} {
@each $property, $value in $properties {
#{$property}: #{$value};
}
}
}
}
}
} @else {
@if $extra-selector == null {
@each $property, $value in $properties {
#{$property}: #{$value};
}
} @else {
& #{$extra-selector} {
@each $property, $value in $properties {
#{$property}: #{$value};
}
}
}
}
}
}
}
}
Expand Down

0 comments on commit d053d46

Please sign in to comment.