summaryrefslogtreecommitdiffstats
path: root/src/objects/_action-button.vars.scss
blob: 16d9e7fa08e97bef78627b016f0dbcad5e81ddb5 (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
@use 'sass:map';
@use '../props';
@use '../vars';

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

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

$pad-i--lg:      props.def(--o-action-button--pad-i, props.get(vars.$size--175), 'lg') !default;
$pad-i-pill--lg: props.def(--o-action-button--pad-i-pill, props.get(vars.$size--225), 'lg') !default;
$pad-b--lg:      props.def(--o-action-button--pad-b, props.get(vars.$size--115), 'lg') !default;
$font-size--lg:  props.def(--o-action-button--font-size, props.get(vars.$font-size--150), 'lg') !default;

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

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

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

$default-theme: props.def(--o-action-button, (
    --bg-color:     props.get(vars.$theme, --base, --75),
    --label-color:  props.get(vars.$theme, --text),
    --border-color: props.get(vars.$theme, --border-strong),

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

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

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

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

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

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

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

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

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

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

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

        --disabled: (
            --label-color: props.get(vars.$theme, --border-strong),
        ),
    ),
)) !default;

$static-themes: props.def(--o-action-button);
@each $theme in map.keys(props.get(vars.$transparent-colors)) {
    $button-theme: #{$theme}-static;

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

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

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

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

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

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

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

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

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

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