@cfx-dev/ui-components 2.1.24 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +20 -20
- package/README.md +38 -38
- package/dist/{Rail-nVRissv6.js → Rail-XT5PwAlx.js} +1 -1
- package/dist/assets/all_css.css +55 -0
- package/dist/components/Accordion/Accordion.js +1 -1
- package/dist/components/Avatar/Avatar.js +1 -1
- package/dist/components/Badge/Badge.js +1 -1
- package/dist/components/Button/Button.js +1 -1
- package/dist/components/Button/ButtonBar.js +1 -1
- package/dist/components/Checkbox/Checkbox.js +1 -1
- package/dist/components/ClipboardButton/ClipboardButton.js +1 -1
- package/dist/components/ControlBox/ControlBox.js +1 -1
- package/dist/components/CountryFlag/CountryFlag.js +1 -1
- package/dist/components/Decorate/Decorate.js +1 -1
- package/dist/components/Dot/Dot.js +1 -1
- package/dist/components/Flyout/Flyout.js +1 -1
- package/dist/components/Icon/Icon.js +1 -1
- package/dist/components/IconBig/IconBig.js +1 -1
- package/dist/components/IconButton/IconButton.js +1 -1
- package/dist/components/Indicator/Indicator.js +1 -1
- package/dist/components/InfoPanel/InfoPanel.js +1 -1
- package/dist/components/Input/Input.js +1 -1
- package/dist/components/Input/RichInput.js +1 -1
- package/dist/components/InputDropzone/InputDropzone.js +1 -1
- package/dist/components/InputDropzone/ItemPreview.js +1 -1
- package/dist/components/Interactive/Interactive.js +1 -1
- package/dist/components/Island/Island.js +1 -1
- package/dist/components/Layout/Box/Box.js +1 -1
- package/dist/components/Layout/Center/Center.js +1 -1
- package/dist/components/Layout/Flex/Flex.js +1 -1
- package/dist/components/Layout/Flex/FlexRestricter.js +1 -1
- package/dist/components/Layout/Flex/FlexShowcase.js +1 -1
- package/dist/components/Layout/Pad/Pad.js +1 -1
- package/dist/components/Layout/Page/Page.js +1 -1
- package/dist/components/Layout/Scrollable/Rail.js +1 -1
- package/dist/components/Layout/Scrollable/Scrollable.js +1 -1
- package/dist/components/Layout/Scrollable/VirtualScrollable.js +1 -1
- package/dist/components/Layout/Scrollable/index.js +1 -1
- package/dist/components/Link/Link.js +1 -1
- package/dist/components/Loaf/Loaf.js +1 -1
- package/dist/components/Logos/LogosShowcase.js +2 -2
- package/dist/components/Logos/cfx/CompositeLogo.js +74 -14
- package/dist/components/Modal/Modal.js +1 -1
- package/dist/components/NavList/NavList.js +1 -1
- package/dist/components/Overlay/Overlay.js +1 -1
- package/dist/components/Popover/Popover.js +1 -1
- package/dist/components/Popover/PopoverShowcase.js +1 -1
- package/dist/components/PremiumBadge/PremiumBadge.js +1 -1
- package/dist/components/Prose/Prose.js +1 -1
- package/dist/components/Radio/Radio.js +1 -1
- package/dist/components/Select/Select.js +1 -1
- package/dist/components/Separator/Separator.js +1 -1
- package/dist/components/Shroud/Shroud.js +1 -1
- package/dist/components/Skeleton/Skeleton.js +1 -1
- package/dist/components/Spacer/Spacer.js +1 -1
- package/dist/components/Switch/Switch.js +1 -1
- package/dist/components/Table/Table.js +1 -1
- package/dist/components/Tabular/Tabular.js +1 -1
- package/dist/components/Text/Text.js +1 -1
- package/dist/components/Text/TextShowcase.js +1 -1
- package/dist/components/Textarea/Textarea.js +1 -1
- package/dist/components/Title/Title.js +1 -1
- package/dist/components/ToggleGroup/ToggleGroup.js +1 -1
- package/dist/main.js +1 -1
- package/dist/styles-scss/_colors.scss +211 -211
- package/dist/styles-scss/_typography.scss +51 -51
- package/dist/styles-scss/_ui.scss +359 -359
- package/dist/styles-scss/global.scss +142 -142
- package/dist/styles-scss/themes/theme_cfx.scss +32 -32
- package/dist/styles-scss/themes/theme_fivem.scss +32 -32
- package/dist/styles-scss/themes/theme_redm.scss +32 -32
- package/dist/styles-scss/themes/theme_wireframe.scss +32 -32
- package/dist/styles-scss/themes.scss +3 -3
- package/dist/styles-scss/tokens.scss +409 -409
- package/package.json +70 -71
- package/dist/assets/ColorShowcase.css +0 -1
- package/dist/assets/ColorVariationsShowcase.css +0 -1
- package/dist/assets/ColorsShowcase.css +0 -1
- package/dist/assets/ControlHeightShowcase.css +0 -1
- package/dist/assets/OffsetShowcase.css +0 -1
- package/dist/assets/QuantShowcase.css +0 -1
- package/dist/style-guide/Colors/ColorShowcase.d.ts +0 -21
- package/dist/style-guide/Colors/ColorShowcase.js +0 -1881
- package/dist/style-guide/Colors/ColorVariationsShowcase.d.ts +0 -5
- package/dist/style-guide/Colors/ColorVariationsShowcase.js +0 -43
- package/dist/style-guide/Colors/ColorsShowcase.d.ts +0 -5
- package/dist/style-guide/Colors/ColorsShowcase.js +0 -43
- package/dist/style-guide/Layout/ControlHeightShowcase.d.ts +0 -5
- package/dist/style-guide/Layout/ControlHeightShowcase.js +0 -27
- package/dist/style-guide/Layout/OffsetShowcase.d.ts +0 -5
- package/dist/style-guide/Layout/OffsetShowcase.js +0 -32
- package/dist/style-guide/Layout/QuantShowcase.d.ts +0 -5
- package/dist/style-guide/Layout/QuantShowcase.js +0 -36
- /package/dist/assets/{Accordion.css → css/Accordion.css} +0 -0
- /package/dist/assets/{Avatar.css → css/Avatar.css} +0 -0
- /package/dist/assets/{Badge.css → css/Badge.css} +0 -0
- /package/dist/assets/{Box.css → css/Box.css} +0 -0
- /package/dist/assets/{Button.css → css/Button.css} +0 -0
- /package/dist/assets/{ButtonBar.css → css/ButtonBar.css} +0 -0
- /package/dist/assets/{Center.css → css/Center.css} +0 -0
- /package/dist/assets/{Checkbox.css → css/Checkbox.css} +0 -0
- /package/dist/assets/{ClipboardButton.css → css/ClipboardButton.css} +0 -0
- /package/dist/assets/{ControlBox.css → css/ControlBox.css} +0 -0
- /package/dist/assets/{CountryFlag.css → css/CountryFlag.css} +0 -0
- /package/dist/assets/{Decorate.css → css/Decorate.css} +0 -0
- /package/dist/assets/{Dot.css → css/Dot.css} +0 -0
- /package/dist/assets/{Flex.css → css/Flex.css} +0 -0
- /package/dist/assets/{FlexRestricter.css → css/FlexRestricter.css} +0 -0
- /package/dist/assets/{FlexShowcase.css → css/FlexShowcase.css} +0 -0
- /package/dist/assets/{Flyout.css → css/Flyout.css} +0 -0
- /package/dist/assets/{Icon.css → css/Icon.css} +0 -0
- /package/dist/assets/{IconBig.css → css/IconBig.css} +0 -0
- /package/dist/assets/{IconButton.css → css/IconButton.css} +0 -0
- /package/dist/assets/{Indicator.css → css/Indicator.css} +0 -0
- /package/dist/assets/{InfoPanel.css → css/InfoPanel.css} +0 -0
- /package/dist/assets/{Input.css → css/Input.css} +0 -0
- /package/dist/assets/{InputDropzone.css → css/InputDropzone.css} +0 -0
- /package/dist/assets/{Interactive.css → css/Interactive.css} +0 -0
- /package/dist/assets/{Island.css → css/Island.css} +0 -0
- /package/dist/assets/{ItemPreview.css → css/ItemPreview.css} +0 -0
- /package/dist/assets/{Link.css → css/Link.css} +0 -0
- /package/dist/assets/{Loaf.css → css/Loaf.css} +0 -0
- /package/dist/assets/{Modal.css → css/Modal.css} +0 -0
- /package/dist/assets/{NavList.css → css/NavList.css} +0 -0
- /package/dist/assets/{Overlay.css → css/Overlay.css} +0 -0
- /package/dist/assets/{Pad.css → css/Pad.css} +0 -0
- /package/dist/assets/{Page.css → css/Page.css} +0 -0
- /package/dist/assets/{Popover.css → css/Popover.css} +0 -0
- /package/dist/assets/{PopoverShowcase.css → css/PopoverShowcase.css} +0 -0
- /package/dist/assets/{PremiumBadge.css → css/PremiumBadge.css} +0 -0
- /package/dist/assets/{Prose.css → css/Prose.css} +0 -0
- /package/dist/assets/{Radio.css → css/Radio.css} +0 -0
- /package/dist/assets/{Rail.css → css/Rail.css} +0 -0
- /package/dist/assets/{RichInput.css → css/RichInput.css} +0 -0
- /package/dist/assets/{Select.css → css/Select.css} +0 -0
- /package/dist/assets/{Separator.css → css/Separator.css} +0 -0
- /package/dist/assets/{Shroud.css → css/Shroud.css} +0 -0
- /package/dist/assets/{Skeleton.css → css/Skeleton.css} +0 -0
- /package/dist/assets/{Spacer.css → css/Spacer.css} +0 -0
- /package/dist/assets/{Switch.css → css/Switch.css} +0 -0
- /package/dist/assets/{Table.css → css/Table.css} +0 -0
- /package/dist/assets/{Tabular.css → css/Tabular.css} +0 -0
- /package/dist/assets/{Text.css → css/Text.css} +0 -0
- /package/dist/assets/{TextShowcase.css → css/TextShowcase.css} +0 -0
- /package/dist/assets/{Textarea.css → css/Textarea.css} +0 -0
- /package/dist/assets/{Title.css → css/Title.css} +0 -0
- /package/dist/assets/{ToggleGroup.css → css/ToggleGroup.css} +0 -0
- /package/dist/assets/{global.css → general/global.css} +0 -0
- /package/dist/assets/{themes.css → general/themes.css} +0 -0
|
@@ -1,211 +1,211 @@
|
|
|
1
|
-
@use "sass:math";
|
|
2
|
-
@use "sass:list";
|
|
3
|
-
|
|
4
|
-
@function get-luminance($color) {
|
|
5
|
-
$colors: (
|
|
6
|
-
'red': red($color),
|
|
7
|
-
'green': green($color),
|
|
8
|
-
'blue': blue($color)
|
|
9
|
-
);
|
|
10
|
-
|
|
11
|
-
@each $name, $value in $colors {
|
|
12
|
-
$adjusted: 0;
|
|
13
|
-
$value: math.div($value, 255);
|
|
14
|
-
|
|
15
|
-
@if $value < 0.03928 {
|
|
16
|
-
$value: math.div($value, 12.92);
|
|
17
|
-
} @else {
|
|
18
|
-
$value: math.div($value + .055, 1.055);
|
|
19
|
-
$value: math.pow($value, 2.4);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
$colors: map-merge($colors, ($name: $value));
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
@return (map-get($colors, 'red') * .2126) + (map-get($colors, 'green') * .7152) + (map-get($colors, 'blue') * .0722);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
@function interpolate($c1, $c2, $f) {
|
|
29
|
-
$c1r: red($c1);
|
|
30
|
-
$c1g: green($c1);
|
|
31
|
-
$c1b: blue($c1);
|
|
32
|
-
|
|
33
|
-
$c2r: red($c2);
|
|
34
|
-
$c2g: green($c2);
|
|
35
|
-
$c2b: blue($c2);
|
|
36
|
-
|
|
37
|
-
@return rgb(
|
|
38
|
-
$c1r + $f * ($c2r - $c1r),
|
|
39
|
-
$c1g + $f * ($c2g - $c1g),
|
|
40
|
-
$c1b + $f * ($c2b - $c1b),
|
|
41
|
-
);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
@function set-luminance($color, $lum) {
|
|
45
|
-
$itersLeft: 20;
|
|
46
|
-
$low: rgb(0, 0, 0);
|
|
47
|
-
$high: rgb(255, 255, 255);
|
|
48
|
-
|
|
49
|
-
@if get-luminance($color) > $lum {
|
|
50
|
-
$high: $color;
|
|
51
|
-
} @else {
|
|
52
|
-
$low: $color;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
$mid: interpolate($low, $high, .5);
|
|
56
|
-
$lm: get-luminance($mid);
|
|
57
|
-
|
|
58
|
-
@while math.abs($lum - $lm) >= 1e-7 and $itersLeft > 0 {
|
|
59
|
-
$itersLeft: $itersLeft - 1;
|
|
60
|
-
|
|
61
|
-
$mid: interpolate($low, $high, .5);
|
|
62
|
-
$lm: get-luminance($mid);
|
|
63
|
-
|
|
64
|
-
@if $lm > $lum {
|
|
65
|
-
$high: $mid;
|
|
66
|
-
} @else {
|
|
67
|
-
$low: $mid;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
@return $mid;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
@function color-triplet($color) {
|
|
75
|
-
@return #{red($color)}, #{green($color)}, #{blue($color)};
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
// LAB <-> RGB
|
|
80
|
-
$oneThird: math.div(1, 3);
|
|
81
|
-
$_16OVER116: math.div(16, 116);
|
|
82
|
-
$_1OVER2P4: math.div(1, 2.4);
|
|
83
|
-
|
|
84
|
-
@function rgb2lab($color) {
|
|
85
|
-
$r: math.div(red($color), 255);
|
|
86
|
-
$g: math.div(green($color), 255);
|
|
87
|
-
$b: math.div(blue($color), 255);
|
|
88
|
-
|
|
89
|
-
@if $r > 0.04045 {
|
|
90
|
-
$r: math.pow(math.div($r + 0.055, 1.055), 2.4);
|
|
91
|
-
} @else {
|
|
92
|
-
$r: math.div($r, 12.92);
|
|
93
|
-
}
|
|
94
|
-
@if $g > 0.04045 {
|
|
95
|
-
$g: math.pow(math.div($g + 0.055, 1.055), 2.4);
|
|
96
|
-
} @else {
|
|
97
|
-
$g: math.div($g, 12.92);
|
|
98
|
-
}
|
|
99
|
-
@if $b > 0.04045 {
|
|
100
|
-
$b: math.pow(math.div($b + 0.055, 1.055), 2.4);
|
|
101
|
-
} @else {
|
|
102
|
-
$b: math.div($b, 12.92);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
$x: math.div($r * 0.4124 + $g * 0.3576 + $b * 0.1805, 0.95047);
|
|
106
|
-
$y: math.div($r * 0.2126 + $g * 0.7152 + $b * 0.0722, 1.00000);
|
|
107
|
-
$z: math.div($r * 0.0193 + $g * 0.1192 + $b * 0.9505, 1.08883);
|
|
108
|
-
|
|
109
|
-
@if $x > 0.008856 {
|
|
110
|
-
$x: math.pow($x, $oneThird);
|
|
111
|
-
} @else {
|
|
112
|
-
$x: (7.787 * $x) + $_16OVER116;
|
|
113
|
-
}
|
|
114
|
-
@if $y > 0.008856 {
|
|
115
|
-
$y: math.pow($y, $oneThird);
|
|
116
|
-
} @else {
|
|
117
|
-
$y: (7.787 * $y) + $_16OVER116;
|
|
118
|
-
}
|
|
119
|
-
@if $z > 0.008856 {
|
|
120
|
-
$z: math.pow($z, $oneThird);
|
|
121
|
-
} @else {
|
|
122
|
-
$z: (7.787 * $z) + $_16OVER116;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
@return (
|
|
126
|
-
'L': (116 * $y) - 16,
|
|
127
|
-
'a': 500 * ($x - $y),
|
|
128
|
-
'b': 200 * ($y - $z),
|
|
129
|
-
);
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
@function lab2rgb($lab) {
|
|
133
|
-
$y: math.div(map-get($lab, 'L') + 16, 116);
|
|
134
|
-
$x: math.div(map-get($lab, 'a'), 500) + $y;
|
|
135
|
-
$z: $y - math.div(map-get($lab, 'b'), 200);
|
|
136
|
-
|
|
137
|
-
$x3: math.pow($x, 3);
|
|
138
|
-
$y3: math.pow($y, 3);
|
|
139
|
-
$z3: math.pow($z, 3);
|
|
140
|
-
|
|
141
|
-
@if $x3 > 0.008856 {
|
|
142
|
-
$x: $x3;
|
|
143
|
-
} @else {
|
|
144
|
-
$x: math.div($x - $_16OVER116 , 7.787);
|
|
145
|
-
}
|
|
146
|
-
@if $y3 > 0.008856 {
|
|
147
|
-
$y: $y3;
|
|
148
|
-
} @else {
|
|
149
|
-
$y: math.div($y - $_16OVER116 , 7.787);
|
|
150
|
-
}
|
|
151
|
-
@if $z3 > 0.008856 {
|
|
152
|
-
$z: $z3;
|
|
153
|
-
} @else {
|
|
154
|
-
$z: math.div($z - $_16OVER116 , 7.787);
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
$x: $x * 0.95047;
|
|
158
|
-
$y: $y * 1.00000;
|
|
159
|
-
$z: $z * 1.08883;
|
|
160
|
-
|
|
161
|
-
$r: $x * 3.2406 + $y * -1.5372 + $z * -0.4986;
|
|
162
|
-
$g: $x * -0.9689 + $y * 1.8758 + $z * 0.0415;
|
|
163
|
-
$b: $x * 0.0557 + $y * -0.2040 + $z * 1.0570;
|
|
164
|
-
|
|
165
|
-
@if $r > 0.0031308 {
|
|
166
|
-
$r: 1.055 * math.pow($r, $_1OVER2P4) - 0.055;
|
|
167
|
-
} @else {
|
|
168
|
-
$r: 12.92 * $r;
|
|
169
|
-
}
|
|
170
|
-
@if $g > 0.0031308 {
|
|
171
|
-
$g: 1.055 * math.pow($g, $_1OVER2P4) - 0.055;
|
|
172
|
-
} @else {
|
|
173
|
-
$g: 12.92 * $g;
|
|
174
|
-
}
|
|
175
|
-
@if $b > 0.0031308 {
|
|
176
|
-
$b: 1.055 * math.pow($b, $_1OVER2P4) - 0.055;
|
|
177
|
-
} @else {
|
|
178
|
-
$b: 12.92 * $b;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
@return rgb(
|
|
182
|
-
math.clamp(0, $r, 1) * 255,
|
|
183
|
-
math.clamp(0, $g, 1) * 255,
|
|
184
|
-
math.clamp(0, $b, 1) * 255,
|
|
185
|
-
);
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
@function lab-gradient($s, $e, $start, $stop) {
|
|
189
|
-
$lst: ();
|
|
190
|
-
|
|
191
|
-
@for $i from $start to $stop {
|
|
192
|
-
$lst: list.append($lst, lab-gradient-step($s, $e, $i, $stop));
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
@return $lst;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
@function lab-gradient-step($s, $e, $i, $stop) {
|
|
199
|
-
$s: rgb2lab($s);
|
|
200
|
-
$e: rgb2lab($e);
|
|
201
|
-
|
|
202
|
-
$a: math.div($i, $stop - 1);
|
|
203
|
-
$ia: 1 - $a;
|
|
204
|
-
|
|
205
|
-
@return lab2rgb((
|
|
206
|
-
'L': $ia * map-get($s, 'L') + $a * map-get($e, 'L'),
|
|
207
|
-
'a': $ia * map-get($s, 'a') + $a * map-get($e, 'a'),
|
|
208
|
-
'b': $ia * map-get($s, 'b') + $a * map-get($e, 'b'),
|
|
209
|
-
));
|
|
210
|
-
}
|
|
211
|
-
|
|
1
|
+
@use "sass:math";
|
|
2
|
+
@use "sass:list";
|
|
3
|
+
|
|
4
|
+
@function get-luminance($color) {
|
|
5
|
+
$colors: (
|
|
6
|
+
'red': red($color),
|
|
7
|
+
'green': green($color),
|
|
8
|
+
'blue': blue($color)
|
|
9
|
+
);
|
|
10
|
+
|
|
11
|
+
@each $name, $value in $colors {
|
|
12
|
+
$adjusted: 0;
|
|
13
|
+
$value: math.div($value, 255);
|
|
14
|
+
|
|
15
|
+
@if $value < 0.03928 {
|
|
16
|
+
$value: math.div($value, 12.92);
|
|
17
|
+
} @else {
|
|
18
|
+
$value: math.div($value + .055, 1.055);
|
|
19
|
+
$value: math.pow($value, 2.4);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
$colors: map-merge($colors, ($name: $value));
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@return (map-get($colors, 'red') * .2126) + (map-get($colors, 'green') * .7152) + (map-get($colors, 'blue') * .0722);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
@function interpolate($c1, $c2, $f) {
|
|
29
|
+
$c1r: red($c1);
|
|
30
|
+
$c1g: green($c1);
|
|
31
|
+
$c1b: blue($c1);
|
|
32
|
+
|
|
33
|
+
$c2r: red($c2);
|
|
34
|
+
$c2g: green($c2);
|
|
35
|
+
$c2b: blue($c2);
|
|
36
|
+
|
|
37
|
+
@return rgb(
|
|
38
|
+
$c1r + $f * ($c2r - $c1r),
|
|
39
|
+
$c1g + $f * ($c2g - $c1g),
|
|
40
|
+
$c1b + $f * ($c2b - $c1b),
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
@function set-luminance($color, $lum) {
|
|
45
|
+
$itersLeft: 20;
|
|
46
|
+
$low: rgb(0, 0, 0);
|
|
47
|
+
$high: rgb(255, 255, 255);
|
|
48
|
+
|
|
49
|
+
@if get-luminance($color) > $lum {
|
|
50
|
+
$high: $color;
|
|
51
|
+
} @else {
|
|
52
|
+
$low: $color;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
$mid: interpolate($low, $high, .5);
|
|
56
|
+
$lm: get-luminance($mid);
|
|
57
|
+
|
|
58
|
+
@while math.abs($lum - $lm) >= 1e-7 and $itersLeft > 0 {
|
|
59
|
+
$itersLeft: $itersLeft - 1;
|
|
60
|
+
|
|
61
|
+
$mid: interpolate($low, $high, .5);
|
|
62
|
+
$lm: get-luminance($mid);
|
|
63
|
+
|
|
64
|
+
@if $lm > $lum {
|
|
65
|
+
$high: $mid;
|
|
66
|
+
} @else {
|
|
67
|
+
$low: $mid;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
@return $mid;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
@function color-triplet($color) {
|
|
75
|
+
@return #{red($color)}, #{green($color)}, #{blue($color)};
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
// LAB <-> RGB
|
|
80
|
+
$oneThird: math.div(1, 3);
|
|
81
|
+
$_16OVER116: math.div(16, 116);
|
|
82
|
+
$_1OVER2P4: math.div(1, 2.4);
|
|
83
|
+
|
|
84
|
+
@function rgb2lab($color) {
|
|
85
|
+
$r: math.div(red($color), 255);
|
|
86
|
+
$g: math.div(green($color), 255);
|
|
87
|
+
$b: math.div(blue($color), 255);
|
|
88
|
+
|
|
89
|
+
@if $r > 0.04045 {
|
|
90
|
+
$r: math.pow(math.div($r + 0.055, 1.055), 2.4);
|
|
91
|
+
} @else {
|
|
92
|
+
$r: math.div($r, 12.92);
|
|
93
|
+
}
|
|
94
|
+
@if $g > 0.04045 {
|
|
95
|
+
$g: math.pow(math.div($g + 0.055, 1.055), 2.4);
|
|
96
|
+
} @else {
|
|
97
|
+
$g: math.div($g, 12.92);
|
|
98
|
+
}
|
|
99
|
+
@if $b > 0.04045 {
|
|
100
|
+
$b: math.pow(math.div($b + 0.055, 1.055), 2.4);
|
|
101
|
+
} @else {
|
|
102
|
+
$b: math.div($b, 12.92);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
$x: math.div($r * 0.4124 + $g * 0.3576 + $b * 0.1805, 0.95047);
|
|
106
|
+
$y: math.div($r * 0.2126 + $g * 0.7152 + $b * 0.0722, 1.00000);
|
|
107
|
+
$z: math.div($r * 0.0193 + $g * 0.1192 + $b * 0.9505, 1.08883);
|
|
108
|
+
|
|
109
|
+
@if $x > 0.008856 {
|
|
110
|
+
$x: math.pow($x, $oneThird);
|
|
111
|
+
} @else {
|
|
112
|
+
$x: (7.787 * $x) + $_16OVER116;
|
|
113
|
+
}
|
|
114
|
+
@if $y > 0.008856 {
|
|
115
|
+
$y: math.pow($y, $oneThird);
|
|
116
|
+
} @else {
|
|
117
|
+
$y: (7.787 * $y) + $_16OVER116;
|
|
118
|
+
}
|
|
119
|
+
@if $z > 0.008856 {
|
|
120
|
+
$z: math.pow($z, $oneThird);
|
|
121
|
+
} @else {
|
|
122
|
+
$z: (7.787 * $z) + $_16OVER116;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
@return (
|
|
126
|
+
'L': (116 * $y) - 16,
|
|
127
|
+
'a': 500 * ($x - $y),
|
|
128
|
+
'b': 200 * ($y - $z),
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
@function lab2rgb($lab) {
|
|
133
|
+
$y: math.div(map-get($lab, 'L') + 16, 116);
|
|
134
|
+
$x: math.div(map-get($lab, 'a'), 500) + $y;
|
|
135
|
+
$z: $y - math.div(map-get($lab, 'b'), 200);
|
|
136
|
+
|
|
137
|
+
$x3: math.pow($x, 3);
|
|
138
|
+
$y3: math.pow($y, 3);
|
|
139
|
+
$z3: math.pow($z, 3);
|
|
140
|
+
|
|
141
|
+
@if $x3 > 0.008856 {
|
|
142
|
+
$x: $x3;
|
|
143
|
+
} @else {
|
|
144
|
+
$x: math.div($x - $_16OVER116 , 7.787);
|
|
145
|
+
}
|
|
146
|
+
@if $y3 > 0.008856 {
|
|
147
|
+
$y: $y3;
|
|
148
|
+
} @else {
|
|
149
|
+
$y: math.div($y - $_16OVER116 , 7.787);
|
|
150
|
+
}
|
|
151
|
+
@if $z3 > 0.008856 {
|
|
152
|
+
$z: $z3;
|
|
153
|
+
} @else {
|
|
154
|
+
$z: math.div($z - $_16OVER116 , 7.787);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
$x: $x * 0.95047;
|
|
158
|
+
$y: $y * 1.00000;
|
|
159
|
+
$z: $z * 1.08883;
|
|
160
|
+
|
|
161
|
+
$r: $x * 3.2406 + $y * -1.5372 + $z * -0.4986;
|
|
162
|
+
$g: $x * -0.9689 + $y * 1.8758 + $z * 0.0415;
|
|
163
|
+
$b: $x * 0.0557 + $y * -0.2040 + $z * 1.0570;
|
|
164
|
+
|
|
165
|
+
@if $r > 0.0031308 {
|
|
166
|
+
$r: 1.055 * math.pow($r, $_1OVER2P4) - 0.055;
|
|
167
|
+
} @else {
|
|
168
|
+
$r: 12.92 * $r;
|
|
169
|
+
}
|
|
170
|
+
@if $g > 0.0031308 {
|
|
171
|
+
$g: 1.055 * math.pow($g, $_1OVER2P4) - 0.055;
|
|
172
|
+
} @else {
|
|
173
|
+
$g: 12.92 * $g;
|
|
174
|
+
}
|
|
175
|
+
@if $b > 0.0031308 {
|
|
176
|
+
$b: 1.055 * math.pow($b, $_1OVER2P4) - 0.055;
|
|
177
|
+
} @else {
|
|
178
|
+
$b: 12.92 * $b;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
@return rgb(
|
|
182
|
+
math.clamp(0, $r, 1) * 255,
|
|
183
|
+
math.clamp(0, $g, 1) * 255,
|
|
184
|
+
math.clamp(0, $b, 1) * 255,
|
|
185
|
+
);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
@function lab-gradient($s, $e, $start, $stop) {
|
|
189
|
+
$lst: ();
|
|
190
|
+
|
|
191
|
+
@for $i from $start to $stop {
|
|
192
|
+
$lst: list.append($lst, lab-gradient-step($s, $e, $i, $stop));
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
@return $lst;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
@function lab-gradient-step($s, $e, $i, $stop) {
|
|
199
|
+
$s: rgb2lab($s);
|
|
200
|
+
$e: rgb2lab($e);
|
|
201
|
+
|
|
202
|
+
$a: math.div($i, $stop - 1);
|
|
203
|
+
$ia: 1 - $a;
|
|
204
|
+
|
|
205
|
+
@return lab2rgb((
|
|
206
|
+
'L': $ia * map-get($s, 'L') + $a * map-get($e, 'L'),
|
|
207
|
+
'a': $ia * map-get($s, 'a') + $a * map-get($e, 'a'),
|
|
208
|
+
'b': $ia * map-get($s, 'b') + $a * map-get($e, 'b'),
|
|
209
|
+
));
|
|
210
|
+
}
|
|
211
|
+
|
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* woff2 - Super Modern Browsers
|
|
3
|
-
* woff - Pretty Modern Browsers
|
|
4
|
-
* ttf - Safari, Android, iOS
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
@mixin font-HelveticaNow() {
|
|
8
|
-
@font-face {
|
|
9
|
-
font-style: normal;
|
|
10
|
-
font-weight: 400;
|
|
11
|
-
font-family: "HelveticaNowDisplay";
|
|
12
|
-
src: url("assets/fonts/HelveticaNow/HelveticaNowDisplay.woff2") format("woff2"),
|
|
13
|
-
url("assets/fonts/HelveticaNow/HelveticaNowDisplay.woff") format("woff"),
|
|
14
|
-
url("assets/fonts/HelveticaNow/HelveticaNowDisplay.ttf") format("truetype");
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
@font-face {
|
|
18
|
-
font-style: normal;
|
|
19
|
-
font-weight: 700;
|
|
20
|
-
font-family: "HelveticaNowDisplay";
|
|
21
|
-
src: url("assets/fonts/HelveticaNow/HelveticaNowDisplayBold.woff2") format("woff2"),
|
|
22
|
-
url("assets/fonts/HelveticaNow/HelveticaNowDisplayBold.woff") format("woff"),
|
|
23
|
-
url("assets/fonts/HelveticaNow/HelveticaNowDisplayBold.ttf") format("truetype");
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
@font-face {
|
|
27
|
-
font-style: normal;
|
|
28
|
-
font-weight: 400;
|
|
29
|
-
font-family: "HelveticaNowText";
|
|
30
|
-
src: url("assets/fonts/HelveticaNow/HelveticaNowText.woff2") format("woff2"),
|
|
31
|
-
url("assets/fonts/HelveticaNow/HelveticaNowText.woff") format("woff"),
|
|
32
|
-
url("assets/fonts/HelveticaNow/HelveticaNowText.ttf") format("truetype");
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
@font-face {
|
|
36
|
-
font-style: normal;
|
|
37
|
-
font-weight: 700;
|
|
38
|
-
font-family: "HelveticaNowText";
|
|
39
|
-
src: url("assets/fonts/HelveticaNow/HelveticaNowTextBold.woff2") format("woff2"),
|
|
40
|
-
url("assets/fonts/HelveticaNow/HelveticaNowTextBold.woff") format("woff"),
|
|
41
|
-
url("assets/fonts/HelveticaNow/HelveticaNowTextBold.ttf") format("truetype");
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
@font-face {
|
|
45
|
-
font-style: italic;
|
|
46
|
-
font-weight: 400;
|
|
47
|
-
font-family: "HelveticaNowText";
|
|
48
|
-
src: url("assets/fonts/HelveticaNow/HelveticaNowTextIt.woff2") format("woff2"),
|
|
49
|
-
url("assets/fonts/HelveticaNow/HelveticaNowTextIt.woff") format("woff"),
|
|
50
|
-
url("assets/fonts/HelveticaNow/HelveticaNowTextIt.ttf") format("truetype");
|
|
51
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* woff2 - Super Modern Browsers
|
|
3
|
+
* woff - Pretty Modern Browsers
|
|
4
|
+
* ttf - Safari, Android, iOS
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
@mixin font-HelveticaNow() {
|
|
8
|
+
@font-face {
|
|
9
|
+
font-style: normal;
|
|
10
|
+
font-weight: 400;
|
|
11
|
+
font-family: "HelveticaNowDisplay";
|
|
12
|
+
src: url("assets/fonts/HelveticaNow/HelveticaNowDisplay.woff2") format("woff2"),
|
|
13
|
+
url("assets/fonts/HelveticaNow/HelveticaNowDisplay.woff") format("woff"),
|
|
14
|
+
url("assets/fonts/HelveticaNow/HelveticaNowDisplay.ttf") format("truetype");
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
@font-face {
|
|
18
|
+
font-style: normal;
|
|
19
|
+
font-weight: 700;
|
|
20
|
+
font-family: "HelveticaNowDisplay";
|
|
21
|
+
src: url("assets/fonts/HelveticaNow/HelveticaNowDisplayBold.woff2") format("woff2"),
|
|
22
|
+
url("assets/fonts/HelveticaNow/HelveticaNowDisplayBold.woff") format("woff"),
|
|
23
|
+
url("assets/fonts/HelveticaNow/HelveticaNowDisplayBold.ttf") format("truetype");
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@font-face {
|
|
27
|
+
font-style: normal;
|
|
28
|
+
font-weight: 400;
|
|
29
|
+
font-family: "HelveticaNowText";
|
|
30
|
+
src: url("assets/fonts/HelveticaNow/HelveticaNowText.woff2") format("woff2"),
|
|
31
|
+
url("assets/fonts/HelveticaNow/HelveticaNowText.woff") format("woff"),
|
|
32
|
+
url("assets/fonts/HelveticaNow/HelveticaNowText.ttf") format("truetype");
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
@font-face {
|
|
36
|
+
font-style: normal;
|
|
37
|
+
font-weight: 700;
|
|
38
|
+
font-family: "HelveticaNowText";
|
|
39
|
+
src: url("assets/fonts/HelveticaNow/HelveticaNowTextBold.woff2") format("woff2"),
|
|
40
|
+
url("assets/fonts/HelveticaNow/HelveticaNowTextBold.woff") format("woff"),
|
|
41
|
+
url("assets/fonts/HelveticaNow/HelveticaNowTextBold.ttf") format("truetype");
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
@font-face {
|
|
45
|
+
font-style: italic;
|
|
46
|
+
font-weight: 400;
|
|
47
|
+
font-family: "HelveticaNowText";
|
|
48
|
+
src: url("assets/fonts/HelveticaNow/HelveticaNowTextIt.woff2") format("woff2"),
|
|
49
|
+
url("assets/fonts/HelveticaNow/HelveticaNowTextIt.woff") format("woff"),
|
|
50
|
+
url("assets/fonts/HelveticaNow/HelveticaNowTextIt.ttf") format("truetype");
|
|
51
|
+
}
|
|
52
52
|
}
|