diff options
Diffstat (limited to 'src/_functions.scss')
| -rw-r--r-- | src/_functions.scss | 32 |
1 files changed, 2 insertions, 30 deletions
diff --git a/src/_functions.scss b/src/_functions.scss index 523aa84..4807cc1 100644 --- a/src/_functions.scss +++ b/src/_functions.scss | |||
| @@ -7,31 +7,7 @@ | |||
| 7 | @use 'iro-sass/src/index' as iro; | 7 | @use 'iro-sass/src/index' as iro; |
| 8 | @use 'iro-sass/src/easing' as easing; | 8 | @use 'iro-sass/src/easing' as easing; |
| 9 | @use 'functions/colors' as iro-colors; | 9 | @use 'functions/colors' as iro-colors; |
| 10 | @use 'config'; | 10 | @use 'palettes'; |
| 11 | |||
| 12 | @function color($key, $tree: iro.$props-default-tree, $default: null, $global: false) { | ||
| 13 | @return iro.props-get(list.join(--colors, $key), $tree, $default, $global); | ||
| 14 | } | ||
| 15 | |||
| 16 | @function global-color($key, $tree: iro.$props-default-tree, $default: null, $global: true) { | ||
| 17 | @return color($key, $tree, $default, $global); | ||
| 18 | } | ||
| 19 | |||
| 20 | @function foreign-color($foreign-key, $key, $tree: iro.$props-default-tree, $default: null, $global: true) { | ||
| 21 | @return iro.props-get(list.join($foreign-key --colors, $key), $tree, $default, $global); | ||
| 22 | } | ||
| 23 | |||
| 24 | @function dim($key, $tree: iro.$props-default-tree, $default: null, $global: false) { | ||
| 25 | @return iro.props-get(list.join(--dims, $key), $tree, $default, $global); | ||
| 26 | } | ||
| 27 | |||
| 28 | @function global-dim($key, $tree: iro.$props-default-tree, $default: null, $global: true) { | ||
| 29 | @return dim($key, $tree, $default, $global); | ||
| 30 | } | ||
| 31 | |||
| 32 | @function foreign-dim($foreign-key, $key, $tree: iro.$props-default-tree, $default: null, $global: true) { | ||
| 33 | @return iro.props-get(list.join($foreign-key --dims, $key), $tree, $default, $global); | ||
| 34 | } | ||
| 35 | 11 | ||
| 36 | @function font-prop($data, $overrides, $key, $prop) { | 12 | @function font-prop($data, $overrides, $key, $prop) { |
| 37 | @if (map.has-key($overrides, $prop)) { | 13 | @if (map.has-key($overrides, $prop)) { |
| @@ -60,10 +36,6 @@ | |||
| 60 | @return $map; | 36 | @return $map; |
| 61 | } | 37 | } |
| 62 | 38 | ||
| 63 | @function lum($color) { | ||
| 64 | @return list.nth(blend-convert.lin_sRGB_to_XYZ(blend-convert.lin_sRGB(blend-convert.sassToRgb($color))), 2) + .05; | ||
| 65 | } | ||
| 66 | |||
| 67 | @function palette($base-color, $contrasts, $chroma-range: 1, $ref-color: $base-color) { | 39 | @function palette($base-color, $contrasts, $chroma-range: 1, $ref-color: $base-color) { |
| 68 | $base-lch: color.to-space($base-color, oklch); | 40 | $base-lch: color.to-space($base-color, oklch); |
| 69 | $ref-lch: color.to-space($ref-color, oklch); | 41 | $ref-lch: color.to-space($ref-color, oklch); |
| @@ -82,7 +54,7 @@ | |||
| 82 | $chroma-inv: true; | 54 | $chroma-inv: true; |
| 83 | $chroma-range: -1 * $chroma-range; | 55 | $chroma-range: -1 * $chroma-range; |
| 84 | } | 56 | } |
| 85 | $chroma-easing: meta.get-function(config.$palette-chroma-easing, $module: easing); | 57 | $chroma-easing: meta.get-function(palettes.$palette-chroma-easing, $module: easing); |
| 86 | 58 | ||
| 87 | $palette: (); | 59 | $palette: (); |
| 88 | 60 | ||
