|
41 | 41 | } |
42 | 42 | } |
43 | 43 |
|
44 | | -// Colors |
45 | | -@function to-rgb($value) { |
46 | | - @return color.channel($value, "red"), color.channel($value, "green"), color.channel($value, "blue"); |
47 | | -} |
48 | | - |
49 | | -// stylelint-disable scss/dollar-variable-pattern |
50 | | -@function rgba-css-var($identifier, $target) { |
51 | | - @if $identifier == "body" and $target == "bg" { |
52 | | - @return rgba(var(--#{$identifier}-bg-rgb), var(--#{$target}-opacity)); |
53 | | - } @if $identifier == "body" and $target == "text" { |
54 | | - @return rgba(var(--#{$identifier}-color-rgb), var(--#{$target}-opacity)); |
55 | | - } @else { |
56 | | - @return rgba(var(--#{$identifier}-rgb), var(--#{$target}-opacity)); |
57 | | - } |
58 | | -} |
59 | | - |
60 | | -@function map-loop($map, $func, $args...) { |
61 | | - $_map: (); |
62 | | - |
63 | | - @each $key, $value in $map { |
64 | | - // allow to pass the $key and $value of the map as an function argument |
65 | | - $_args: (); |
66 | | - @each $arg in $args { |
67 | | - $resolved-arg: $arg; |
68 | | - @if $arg == "$key" { |
69 | | - $resolved-arg: $key; |
70 | | - } @else if $arg == "$value" { |
71 | | - $resolved-arg: $value; |
72 | | - } |
73 | | - $_args: list.append($_args, $resolved-arg); |
74 | | - } |
75 | | - |
76 | | - $_map: map.merge($_map, ($key: meta.call(meta.get-function($func), $_args...))); |
77 | | - } |
78 | | - |
79 | | - @return $_map; |
80 | | -} |
81 | | -// stylelint-enable scss/dollar-variable-pattern |
82 | | - |
83 | | -@function varify($list) { |
84 | | - $result: null; |
85 | | - @each $entry in $list { |
86 | | - $result: list.append($result, var(--#{$entry}), space); |
87 | | - } |
88 | | - @return $result; |
89 | | -} |
90 | | - |
91 | 44 | // Internal Bootstrap function to turn maps into its negative variant. |
92 | 45 | // It prefixes the keys with `n` and makes the value negative. |
93 | 46 | @function negativify-map($map) { |
@@ -253,20 +206,3 @@ $_luminance-list: .0008 .001 .0011 .0013 .0015 .0017 .002 .0022 .0025 .0027 .003 |
253 | 206 | @function opaque($background, $foreground) { |
254 | 207 | @return color-mix(in srgb, rgba($foreground, 1), $background, color.opacity($foreground) * 100%); |
255 | 208 | } |
256 | | - |
257 | | -// scss-docs-start color-functions |
258 | | -// // Tint a color: mix a color with white |
259 | | -@function tint-color($color, $weight) { |
260 | | - @return color.mix(white, $color, $weight); |
261 | | -} |
262 | | - |
263 | | -// // Shade a color: mix a color with black |
264 | | -@function shade-color($color, $weight) { |
265 | | - @return color.mix(black, $color, $weight); |
266 | | -} |
267 | | - |
268 | | -// // Shade the color if the weight is positive, else tint it |
269 | | -@function shift-color($color, $weight) { |
270 | | - @return if(sass($weight > 0): shade-color($color, $weight); else: tint-color($color, -$weight)); |
271 | | -} |
272 | | -// scss-docs-end color-functions |
0 commit comments