-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(class.variant-create()): add mixin to replace
variant()
mixin …
…and add spec.
- Loading branch information
1 parent
4adc86d
commit 47e5a29
Showing
3 changed files
with
67 additions
and
0 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,5 +1,6 @@ | ||
@forward 'variant.attribute.mixin'; | ||
@forward 'variant.class-value.mixin'; | ||
@forward 'variant.combine.mixin'; | ||
@forward 'variant.create.mixin'; | ||
@forward 'variant.property.mixin'; | ||
@forward 'variant.set.mixin'; |
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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// Modules. | ||
@use '../../map'; | ||
@use '../../meta'; | ||
|
||
// Mixins. | ||
@use '../../class/class.content.mixin'; | ||
@use '../../property/property.set.mixin' as property; | ||
@use '../../variant/variant.transform.mixin'; | ||
|
||
// Functions. | ||
@use '../../selector/selector.class.function'; | ||
|
||
// Status: | ||
// The `class.variant-create()` mixin . | ||
// @param `$variant` | ||
// @param `$combine` | ||
// @param `$pseudo-class` | ||
// @param `$dictionary` | ||
// @param `$function` | ||
// @param `$modifier` | ||
@mixin create( | ||
$variant, | ||
$combine: false false false, | ||
$pseudo-class: (), | ||
$dictionary: (), | ||
$function: meta.get-function(class, false, selector), | ||
$modifier: null, | ||
) { | ||
@include variant.transform($variant, $combine, $modifier) using($resolved) { | ||
@each $resolved in $resolved { | ||
@include class.content( | ||
map.get($resolved, (class, name)), | ||
$pseudo-class, | ||
$dictionary, | ||
$function, | ||
) { | ||
@content($resolved); | ||
} | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Modules. | ||
@use '../../class'; | ||
@use '../../map'; | ||
|
||
@include class.variant-create(( | ||
// FEATURE: Variant 1. | ||
// outline: 2px solid blue, | ||
// (border, outline): 1px solid yellow, | ||
|
||
// FEATURE: Variant 2. | ||
// (border: (top: 10px)) | ||
// (padding, margin): ((top: top): 10px, (right: right): 20px, (bottom: bottom): 10px), | ||
|
||
// FEATURE: Variant 3. | ||
// (border: (start: (start: 10px))) | ||
|
||
// FEATURE: Variant 4. | ||
border: (start: (start: ((radius: radius): 10px))), | ||
), | ||
false, | ||
(), | ||
(), // (border: b), | ||
) using($resolved) { | ||
#{map.get($resolved, (property, name))}: map.get($resolved, (property, value)); | ||
}; |