summaryrefslogtreecommitdiffstats
path: root/src/_core.vars.scss
blob: 83d3a6a83b895c2d08301631de3557cc4ef7c96e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
// stylelint-disable scss/dollar-variable-pattern

@use 'sass:map';
@use 'sass:meta';
@use 'sass:list';
@use 'iro-sass/src/iro-sass' as iro;
@use 'functions' as fn;
@use 'config';
@use 'props';

$size--0:    props.def(--size--0, 0) !default;
$size--10:   props.def(--size--10, iro.fn-px-to-rem(1px)) !default;
$size--25:   props.def(--size--25, iro.fn-px-to-rem(2px)) !default;
$size--40:   props.def(--size--40, iro.fn-px-to-rem(3px)) !default;
$size--50:   props.def(--size--50, iro.fn-px-to-rem(4px)) !default;
$size--65:   props.def(--size--65, iro.fn-px-to-rem(5px)) !default;
$size--75:   props.def(--size--75, iro.fn-px-to-rem(6px)) !default;
$size--85:   props.def(--size--85, iro.fn-px-to-rem(7px)) !default;
$size--100:  props.def(--size--100, iro.fn-px-to-rem(8px)) !default;
$size--115:  props.def(--size--115, iro.fn-px-to-rem(9px)) !default;
$size--125:  props.def(--size--125, iro.fn-px-to-rem(10px)) !default;
$size--130:  props.def(--size--130, iro.fn-px-to-rem(11px)) !default;
$size--150:  props.def(--size--150, iro.fn-px-to-rem(12px)) !default;
$size--160:  props.def(--size--160, iro.fn-px-to-rem(13px)) !default;
$size--175:  props.def(--size--175, iro.fn-px-to-rem(14px)) !default;
$size--200:  props.def(--size--200, iro.fn-px-to-rem(16px)) !default;
$size--225:  props.def(--size--225, iro.fn-px-to-rem(18px)) !default;
$size--250:  props.def(--size--250, iro.fn-px-to-rem(20px)) !default;
$size--275:  props.def(--size--275, iro.fn-px-to-rem(22px)) !default;
$size--300:  props.def(--size--300, iro.fn-px-to-rem(24px)) !default;
$size--325:  props.def(--size--325, iro.fn-px-to-rem(26px)) !default;
$size--350:  props.def(--size--350, iro.fn-px-to-rem(28px)) !default;
$size--375:  props.def(--size--375, iro.fn-px-to-rem(30px)) !default;
$size--400:  props.def(--size--400, iro.fn-px-to-rem(32px)) !default;
$size--450:  props.def(--size--450, iro.fn-px-to-rem(36px)) !default;
$size--500:  props.def(--size--500, iro.fn-px-to-rem(40px)) !default;
$size--550:  props.def(--size--550, iro.fn-px-to-rem(44px)) !default;
$size--600:  props.def(--size--600, iro.fn-px-to-rem(48px)) !default;
$size--650:  props.def(--size--650, iro.fn-px-to-rem(52px)) !default;
$size--700:  props.def(--size--700, iro.fn-px-to-rem(56px)) !default;
$size--800:  props.def(--size--800, iro.fn-px-to-rem(64px)) !default;
$size--900:  props.def(--size--900, iro.fn-px-to-rem(72px)) !default;
$size--1000: props.def(--size--1000, iro.fn-px-to-rem(80px)) !default;
$size--1200: props.def(--size--1200, iro.fn-px-to-rem(96px)) !default;
$size--1600: props.def(--size--1600, iro.fn-px-to-rem(128px)) !default;
$size--2000: props.def(--size--2000, iro.fn-px-to-rem(160px)) !default;
$size--2400: props.def(--size--2400, iro.fn-px-to-rem(192px)) !default;
$size--2500: props.def(--size--2500, iro.fn-px-to-rem(200px)) !default;
$size--2600: props.def(--size--2600, iro.fn-px-to-rem(208px)) !default;
$size--2800: props.def(--size--2800, iro.fn-px-to-rem(224px)) !default;
$size--3200: props.def(--size--3200, iro.fn-px-to-rem(256px)) !default;
$size--3400: props.def(--size--3400, iro.fn-px-to-rem(272px)) !default;
$size--3500: props.def(--size--3500, iro.fn-px-to-rem(280px)) !default;
$size--3600: props.def(--size--3600, iro.fn-px-to-rem(288px)) !default;
$size--3800: props.def(--size--3800, iro.fn-px-to-rem(304px)) !default;
$size--4600: props.def(--size--4600, iro.fn-px-to-rem(368px)) !default;
$size--5000: props.def(--size--5000, iro.fn-px-to-rem(400px)) !default;
$size--6000: props.def(--size--6000, iro.fn-px-to-rem(480px)) !default;

$font--standard--family:           props.def(--font--standard--family, ('Inter', 'Open Sans', 'Segoe UI', 'Droid Sans', Roboto, Oxygen, 'Helvetica Neue', Helvetica, Tahoma, Arial, sans-serif)) !default;
$font--standard--line-height:      props.def(--font--standard--line-height, 1.5) !default;
$font--standard--feature-settings: props.def(--font--standard--feature-settings, ('\'ss01\'')) !default;

$font--headline--family:           props.def(--font--headline--family, ('Inter', props.get($font--standard--family))) !default;
$font--headline--line-height:      props.def(--font--headline--line-height, 1.3) !default;
$font--headline--weight:           props.def(--font--headline--weight, 800) !default;
$font--headline--feature-settings: props.def(--font--headline--feature-settings, ('\'opsz\'' 32, '\'ss01\'', '\'cv06\'')) !default;

$font--mono--family:               props.def(--font--mono--family, ('Iosevka Term SS09', 'IBM Plex Mono', 'Menlo', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', Courier, monospace)) !default;
$font--mono--line-height:          props.def(--font--mono--line-height, 1.4) !default;
$font--mono--feature-settings:     props.def(--font--mono--feature-settings, ('\'calt\'' 0, '\'dlig\' 1', '\'ss09\' 1')) !default;

$font-size--50:   props.def(--font-size--50, iro.fn-px-to-rem(12px)) !default;
$font-size--75:   props.def(--font-size--75 , iro.fn-px-to-rem(13px)) !default;
$font-size--100:  props.def(--font-size--100, iro.fn-px-to-rem(14px)) !default;
$font-size--150:  props.def(--font-size--150, iro.fn-px-to-rem(16px)) !default;
$font-size--200:  props.def(--font-size--200, iro.fn-px-to-rem(18px)) !default;
$font-size--300:  props.def(--font-size--300, iro.fn-px-to-rem(20px)) !default;
$font-size--400:  props.def(--font-size--400, iro.fn-px-to-rem(24px)) !default;
$font-size--500:  props.def(--font-size--500, iro.fn-px-to-rem(28px)) !default;
$font-size--600:  props.def(--font-size--600, iro.fn-px-to-rem(32px)) !default;
$font-size--700:  props.def(--font-size--700, iro.fn-px-to-rem(36px)) !default;
$font-size--800:  props.def(--font-size--800, iro.fn-px-to-rem(40px)) !default;
$font-size--900:  props.def(--font-size--900, iro.fn-px-to-rem(45px)) !default;
$font-size--1000: props.def(--font-size--1000, iro.fn-px-to-rem(50px)) !default;
$font-size--1100: props.def(--font-size--1100, iro.fn-px-to-rem(60px)) !default;

$border-width--thick:  props.def(--border-width--thick, 4px) !default;
$border-width--medium: props.def(--border-width--medium, 2px) !default;
$border-width--thin:   props.def(--border-width--thin, 1px) !default;

$shadow--x:    props.def(--shadow--x, 0) !default;
$shadow--y:    props.def(--shadow--y, 1px) !default;
$shadow--blur: props.def(--shadow--blur, 4px) !default;

$rounding: props.def(--rounding, 4px) !default;

$key-focus--outline-width: props.def(--key-focus--outline-width, props.get($border-width--thick)) !default;
$key-focus--border-width:  props.def(--key-focus--border-width, props.get($border-width--medium)) !default;
$key-focus--border-offset: props.def(--key-focus--border-offset, props.get($border-width--medium)) !default;

$list--indent:         props.def(--list--indent, props.get($size--400)) !default;
$list--compact-indent: props.def(--list--compact-indent, props.get($size--250)) !default;

//

$-static-colors: ();

@each $palette-name, $palette in map.get(config.$static-colors, --palettes) {
    $palette: fn.palette($palette, map.get(config.$static-colors, --contrasts), 1, map.get(config.$static-colors, --base));
    $-static-colors: map.merge($-static-colors, ( $palette-name: $palette ));
}

//

$transparent-colors: props.def(--transparent-colors);

@each $palette-name, $palette in (--black: #000 #fff, --white: #fff #000) {
    $color: list.nth($palette, 1);
    $text:  list.nth($palette, 2);

    $palette: fn.transparent-palette($color, $text, map.get(config.$static-colors, --transparents));
    $transparent-colors: props.merge($transparent-colors, ( $palette-name: $palette ));
}

//

$themes: ();

@each $theme-name, $theme in config.$themes {
    @each $variant-name, $variant in $theme {
        $compiled: props.def(--colors);

        @each $palette-name, $palette in $-static-colors {
            $compiled: props.merge($compiled, ( #{$palette-name}-static: $palette ));
        }

        @each $palette-name, $palette in map.get($variant, --palettes) {
            $base-color: list.nth($palette, 1);
            $contrasts:  list.nth($palette, 2);
            $ranges:     list.nth($palette, 3);

            $palette: fn.palette($base-color, map.get($variant, --contrasts, $contrasts), map.get($variant, --ranges, $ranges), list.nth(map.get($variant, --palettes, --base), 1));
            $compiled: props.merge($compiled, ( $palette-name: $palette ));
        }

        @each $color, $value in map.get($variant, --constants) {
            $compiled: props.merge($compiled, ( $color: $value ));
        }

        @each $color, $ref in map.get($variant, --semantic) {
            $res: ();

            @if meta.type-of($ref) == 'map' {
                @each $key, $r in $ref {
                    $re1: list.nth($r, 1);
                    $re2: iro.fn-list-slice($r, 2);
                    $res: map.merge($res, ($key: props.get($compiled, $re1, $re2...)));
                }
            } @else {
                $ref1: list.nth($ref, 1);
                $ref2: iro.fn-list-slice($ref, 2);
                $res:  props.get($compiled, $ref1, $ref2...);
            }

            $compiled: props.merge($compiled, ( $color: $res ));
        }

        $themes: map.set($themes, $theme-name, $variant-name, $compiled);
    }
}

$theme: map.get($themes, config.$theme-default, light) !default;