-
-
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(variant.create()): add
color.variant-create()
with spec to rep…
…lace `color.variant()` mixin.
- Loading branch information
1 parent
09ea888
commit 3083e75
Showing
4 changed files
with
1,236 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 |
---|---|---|
@@ -0,0 +1,74 @@ | ||
// Sass. | ||
@use 'sass:list'; | ||
|
||
// Modules. | ||
@use '../../class'; | ||
@use '../../list/has'; | ||
@use '../../list/remove'; | ||
@use '../../map'; | ||
@use '../../meta'; | ||
@use '../../property'; | ||
@use '../../selector'; | ||
@use '../../string'; | ||
@use '../../variant'; | ||
|
||
// Functions. | ||
@use '../../list/list.each.mixin' as *; | ||
@use '../../list/list.nth.function' as *; | ||
|
||
// Mixins. | ||
@use 'color.color.mixin' as *; | ||
|
||
// Status: TODO: | ||
// The `color.variant-create()` mixin. | ||
// @param `$variant` | ||
// @param `$combine` | ||
// @param `$hue` | ||
// @param `$saturation` | ||
// @param `$lightness` | ||
// @param `$alpha` | ||
// @param `$important` | ||
// @param `$pseudo-class` | ||
// @param `$dictionary` | ||
// @param `$property` | ||
// @param `$function` | ||
// @param `$modifier` | ||
@mixin variant-create( | ||
$variant, | ||
$combine: false false false, | ||
$hue: null, | ||
$saturation: null, | ||
$lightness: null, | ||
$alpha: null, | ||
$important: false, | ||
$pseudo-class: (), | ||
$dictionary: (), | ||
$function: meta.get-function(class, false, selector), | ||
$modifier: null, | ||
) { | ||
$modifier: map.deep-merge(( | ||
2: (class: (pre-middle: color)), | ||
class: (pre-attribute: color), | ||
property: (prop-attribute: color), | ||
), $modifier or ()); | ||
@include class.variant-create( | ||
$variant, | ||
$combine, | ||
$pseudo-class, | ||
$dictionary, | ||
$function, | ||
$modifier, | ||
) using($resolved) { | ||
@include color( | ||
(map.get($resolved, (property, name)): map.get($resolved, (property, value))), | ||
$hue, | ||
$saturation, | ||
$lightness, | ||
$alpha, | ||
null, | ||
$important, | ||
$dictionary: $dictionary, | ||
); | ||
@content($resolved); | ||
} | ||
} |
Oops, something went wrong.