summaryrefslogtreecommitdiffstats
path: root/src/objects/_action-button.vars.scss
blob: 8c3d51061aed71b6fc0800358fbbf98d8def978f (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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
@use 'sass:map';
@use 'sass:string';
@use 'iro-sass/src/props';
@use '../core.vars' as core;

$line-height:  props.def(--o-action-button--line-height, 1.4) !default;
$pad-i:        props.def(--o-action-button--pad-i, props.get(core.$size--150)) !default;
$pad-i-label:  props.def(--o-action-button--pad-i-label, props.get(core.$size--50)) !default;
$pad-i-pill:   props.def(--o-action-button--pad-i-pill, props.get(core.$size--200)) !default;
$pad-b:        props.def(--o-action-button--pad-b, props.get(core.$size--85)) !default;
$border-width: props.def(--o-action-button--border-width, props.get(core.$border-width--thin)) !default;
$rounding:     props.def(--o-action-button--rounding, props.get(core.$rounding)) !default;
$font-size:    props.def(--o-action-button--font-size, props.get(core.$font-size--100)) !default;

$pad-i--sm:       props.def(--o-action-button--sm--pad-i, props.get(core.$size--100)) !default;
$pad-i-label--sm: props.def(--o-action-button--sm--pad-i-label, props.get(core.$size--25)) !default;
$pad-i-pill--sm:  props.def(--o-action-button--sm--pad-i-pill, props.get(core.$size--150)) !default;
$pad-b--sm:       props.def(--o-action-button--sm--pad-b, props.get(core.$size--40)) !default;
$font-size--sm:   props.def(--o-action-button--sm--font-size, props.get(core.$font-size--75)) !default;

$pad-i--lg:       props.def(--o-action-button--lg--pad-i, props.get(core.$size--175)) !default;
$pad-i-label--lg: props.def(--o-action-button--lg--pad-i-label, props.get(core.$size--100)) !default;
$pad-i-pill--lg:  props.def(--o-action-button--lg--pad-i-pill, props.get(core.$size--250)) !default;
$pad-b--lg:       props.def(--o-action-button--lg--pad-b, props.get(core.$size--115)) !default;
$font-size--lg:   props.def(--o-action-button--lg--font-size, props.get(core.$font-size--150)) !default;

$pad-i--xl:       props.def(--o-action-button--xl--pad-i, props.get(core.$size--225)) !default;
$pad-i-label--xl: props.def(--o-action-button--xl--pad-i-label, props.get(core.$size--150)) !default;
$pad-i-pill--xl:  props.def(--o-action-button--xl--pad-i-pill, props.get(core.$size--300)) !default;
$pad-b--xl:       props.def(--o-action-button--xl--pad-b, props.get(core.$size--150)) !default;
$font-size--xl:   props.def(--o-action-button--xl--font-size, props.get(core.$font-size--200)) !default;

$key-focus--border-width:  props.def(--o-action-button--key-focus--border-width, props.get(core.$key-focus--border-width)) !default;
$key-focus--border-offset: props.def(--o-action-button--key-focus--border-offset, props.get(core.$key-focus--border-offset)) !default;
$key-focus--outline-width: props.def(--o-action-button--key-focus--outline-width, props.get(core.$key-focus--outline-width)) !default;

$fixed-sizes: (
    'sm' $pad-i--sm $pad-i-label--sm $pad-i-pill--sm $pad-b--sm $font-size--sm,
    'lg' $pad-i--lg $pad-i-label--lg $pad-i-pill--lg $pad-b--lg $font-size--lg,
    'xl' $pad-i--xl $pad-i-label--xl $pad-i-pill--xl $pad-b--xl $font-size--xl,
) !default;

$themes: props.def(--o-action-button, (), 'color');

$default-theme-override: () !default;
$default-theme: map.deep-merge((
    --bg-color:     props.get(core.$theme, --base, --75),
    --label-color:  props.get(core.$theme, --text),
    --border-color: props.get(core.$theme, --border-strong),

    --hover: (
        --bg-color:     props.get(core.$theme, --border-mute),
        --label-color:  props.get(core.$theme, --heading),
        --border-color: props.get(core.$theme, --text-mute-more),
    ),

    --active: (
        --bg-color:     props.get(core.$theme, --border),
        --label-color:  props.get(core.$theme, --heading),
        --border-color: props.get(core.$theme, --text-mute),
    ),

    --disabled: (
        --bg-color:     props.get(core.$theme, --bg-l1),
        --label-color:  props.get(core.$theme, --border-strong),
        --border-color: props.get(core.$theme, --border),
    ),

    --key-focus: (
        --border-color:  props.get(core.$theme, --focus, --border),
        --outline-color: props.get(core.$theme, --focus, --outline),
    ),

    --selected: (
        --bg-color:     props.get(core.$theme, --heading),
        --label-color:  props.get(core.$theme, --base, --50),
        --border-color: props.get(core.$theme, --heading),

        --hover: (
            --bg-color:     props.get(core.$theme, --text),
            --label-color:  props.get(core.$theme, --base, --50),
            --border-color: props.get(core.$theme, --text),
        ),

        --active: (
            --bg-color:     props.get(core.$theme, --text-mute),
            --label-color:  props.get(core.$theme, --base, --50),
            --border-color: props.get(core.$theme, --text-mute),
        ),

        --disabled: (
            --bg-color:     props.get(core.$theme, --border-mute),
            --label-color:  props.get(core.$theme, --border-strong),
            --border-color: props.get(core.$theme, --border-mute),
        ),
    ),

    --quiet: (
        --label-color:  props.get(core.$theme, --text),

        --hover: (
            --bg-color:    props.get(core.$theme, --border-mute),
            --label-color: props.get(core.$theme, --heading),
        ),

        --active: (
            --bg-color:    props.get(core.$theme, --border),
            --label-color: props.get(core.$theme, --heading),
        ),

        --disabled: (
            --label-color: props.get(core.$theme, --border-strong),
        ),
    ),
), $default-theme-override) !default;
$default-theme: props.def(--o-action-button, $default-theme, 'color');

@each $theme in map.keys(props.get(core.$transparent-colors)) {
    $button-theme: --static-#{string.slice($theme, 3)};

    $themes: props.merge($themes, (
        $button-theme: (
            --bg-color:     props.get(core.$transparent-colors, $theme, --100),
            --label-color:  props.get(core.$transparent-colors, $theme, --900),
            --border-color: props.get(core.$transparent-colors, $theme, --400),

            --hover: (
                --bg-color:     props.get(core.$transparent-colors, $theme, --300),
                --label-color:  props.get(core.$transparent-colors, $theme, --900),
                --border-color: props.get(core.$transparent-colors, $theme, --500),
            ),

            --active: (
                --bg-color:     props.get(core.$transparent-colors, $theme, --400),
                --label-color:  props.get(core.$transparent-colors, $theme, --900),
                --border-color: props.get(core.$transparent-colors, $theme, --600),
            ),

            --disabled: (
                --bg-color:     props.get(core.$transparent-colors, $theme, --100),
                --label-color:  props.get(core.$transparent-colors, $theme, --500),
                --border-color: props.get(core.$transparent-colors, $theme, --300),
            ),

            --key-focus: (
                --border-color:  props.get(core.$transparent-colors, $theme, --900),
                --outline-color: props.get(core.$transparent-colors, $theme, --300),
            ),

            --selected: (
                --bg-color:     props.get(core.$transparent-colors, $theme, --800),
                --label-color:  props.get(core.$transparent-colors, $theme, --text),
                --border-color: props.get(core.$transparent-colors, $theme, --100),

                --hover: (
                    --bg-color:     props.get(core.$transparent-colors, $theme, --900),
                    --label-color:  props.get(core.$transparent-colors, $theme, --text),
                    --border-color: props.get(core.$transparent-colors, $theme, --100),
                ),

                --active: (
                    --bg-color:     props.get(core.$transparent-colors, $theme, --900),
                    --label-color:  props.get(core.$transparent-colors, $theme, --text),
                    --border-color: props.get(core.$transparent-colors, $theme, --100),
                ),

                --disabled: (
                    --bg-color:     props.get(core.$transparent-colors, $theme, --200),
                    --label-color:  props.get(core.$transparent-colors, $theme, --500),
                    --border-color: props.get(core.$transparent-colors, $theme, --100),
                ),
            ),

            --quiet: (
                --label-color:  props.get(core.$transparent-colors, $theme, --900),
        
                --hover: (
                    --bg-color:    props.get(core.$transparent-colors, $theme, --300),
                    --label-color: props.get(core.$transparent-colors, $theme, --900),
                ),
        
                --active: (
                    --bg-color:    props.get(core.$transparent-colors, $theme, --400),
                    --label-color: props.get(core.$transparent-colors, $theme, --900),
                ),
        
                --disabled: (
                    --label-color: props.get(core.$transparent-colors, $theme, --500),
                ),
            ),
        )
    ));
}