-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
742 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,2 @@ | ||
Some of the same behavior tested for `lab()` applies to this function as well, | ||
but for terseness' sake isn't tested explicitly. |
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,27 @@ | ||
@use 'sass:color'; | ||
@use 'sass:list'; | ||
@use 'sass:meta'; | ||
|
||
@function -real-channel($color, $channel) { | ||
@if color.is-missing($color, $channel) { | ||
@return none; | ||
} @else { | ||
@return color.channel($color, $channel); | ||
} | ||
} | ||
|
||
@mixin inspect($color) { | ||
a { | ||
value: $color; | ||
@if meta.type-of($color) == string { | ||
type: string; | ||
} @else { | ||
channels: list.slash( | ||
-real-channel($color, 'lightness') | ||
-real-channel($color, 'a') | ||
-real-channel($color, 'b'), | ||
-real-channel($color, 'alpha') | ||
); | ||
} | ||
} | ||
} |
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,120 @@ | ||
<===> transparent/input.scss | ||
@use 'core_functions/color/oklab/utils'; | ||
@include utils.inspect(oklab(0 255 127 / 0)); | ||
|
||
<===> transparent/output.css | ||
a { | ||
value: oklab(0% 255 127 / 0); | ||
channels: 0% 255 127 / 0; | ||
} | ||
|
||
<===> | ||
================================================================================ | ||
<===> opaque/input.scss | ||
@use 'core_functions/color/oklab/utils'; | ||
@include utils.inspect(oklab(1% 2 3 / 1)); | ||
|
||
<===> opaque/output.css | ||
a { | ||
value: oklab(1% 2 3); | ||
channels: 1% 2 3 / 1; | ||
} | ||
|
||
<===> | ||
================================================================================ | ||
<===> partial/input.scss | ||
@use 'core_functions/color/oklab/utils'; | ||
@include utils.inspect(oklab(1% 2 3 / 0.4)); | ||
|
||
<===> partial/output.css | ||
a { | ||
value: oklab(1% 2 3 / 0.4); | ||
channels: 1% 2 3 / 0.4; | ||
} | ||
|
||
<===> | ||
================================================================================ | ||
<===> percent/input.scss | ||
@use 'core_functions/color/oklab/utils'; | ||
@include utils.inspect(oklab(1% 2 3 / 40%)); | ||
|
||
<===> percent/output.css | ||
a { | ||
value: oklab(1% 2 3 / 0.4); | ||
channels: 1% 2 3 / 0.4; | ||
} | ||
|
||
<===> | ||
================================================================================ | ||
<===> named/input.scss | ||
@use 'core_functions/color/oklab/utils'; | ||
@include utils.inspect(oklab($channels: 1% 2 3 / 0.4)); | ||
|
||
<===> named/output.css | ||
a { | ||
value: oklab(1% 2 3 / 0.4); | ||
channels: 1% 2 3 / 0.4; | ||
} | ||
|
||
<===> | ||
================================================================================ | ||
<===> slash_list/input.scss | ||
@use "sass:list"; | ||
@use 'core_functions/color/oklab/utils'; | ||
@include utils.inspect(oklab(list.slash(1% 2 3, 0.4))); | ||
|
||
<===> slash_list/output.css | ||
a { | ||
value: oklab(1% 2 3 / 0.4); | ||
channels: 1% 2 3 / 0.4; | ||
} | ||
|
||
<===> | ||
================================================================================ | ||
<===> none/slash/b/input.scss | ||
@use 'core_functions/color/oklab/utils'; | ||
@include utils.inspect(oklab(1% 2 none / 0.4)); | ||
|
||
<===> none/slash/b/output.css | ||
a { | ||
value: oklab(1% 2 none / 0.4); | ||
channels: 1% 2 none / 0.4; | ||
} | ||
|
||
<===> | ||
================================================================================ | ||
<===> none/slash/alpha/input.scss | ||
@use 'core_functions/color/oklab/utils'; | ||
@include utils.inspect(oklab(1% 2 3 / none)); | ||
|
||
<===> none/slash/alpha/output.css | ||
a { | ||
value: oklab(1% 2 3 / none); | ||
channels: 1% 2 3 / none; | ||
} | ||
|
||
<===> | ||
================================================================================ | ||
<===> none/slash_list/b/input.scss | ||
@use 'sass:list'; | ||
@use 'core_functions/color/oklab/utils'; | ||
@include utils.inspect(oklab(list.slash(1% 2 none, 0.4))); | ||
|
||
<===> none/slash_list/b/output.css | ||
a { | ||
value: oklab(1% 2 none / 0.4); | ||
channels: 1% 2 none / 0.4; | ||
} | ||
|
||
<===> | ||
================================================================================ | ||
<===> none/slash_list/alpha/input.scss | ||
@use 'sass:list'; | ||
@use 'core_functions/color/oklab/utils'; | ||
@include utils.inspect(oklab(list.slash(1% 2 3, none))); | ||
|
||
<===> none/slash_list/alpha/output.css | ||
a { | ||
value: oklab(1% 2 3 / none); | ||
channels: 1% 2 3 / none; | ||
} |
Oops, something went wrong.