summaryrefslogtreecommitdiffstats
path: root/src/objects/_overflow-button.scss
blob: 9922ffec338f76e87d1cb25b49745512dc1a800f (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
@use 'iro-sass/src/index' as iro;
@use '../functions' as fn;

@include iro.props-namespace('overflow-button') {
    @include iro.props-store((
        --dims: (
            --pad-x:   fn.global-dim(--size --125),
            --pad-y:   fn.global-dim(--size --125),
            --spacing: fn.global-dim(--size --50),
        ),
    ), 'dims');

    @include iro.props-store((
        --colors: (
            --label:  fn.global-color(--fg),
    
            --hover: (
                --bg:    fn.global-color(--obj-hi),
                --label: fn.global-color(--fg-lo),
            ),
            --active: (
                --bg:    fn.global-color(--obj),
                --label: fn.global-color(--fg-lo),
            ),
            --selected: (
                --bg:    fn.global-color(--obj-hi),
                --label: fn.global-color(--fg),

                --hover: (
                    --label: fn.global-color(--fg-lo),
                ),
            ),
            --disabled: (
                --label: fn.global-color(--fg-hi3),
            ),
            --key-focus: (
                --border: fn.global-color(--focus --fill),
                --shadow: fn.global-color(--focus --shadow),
            ),
        ),
    ), 'colors');

    @include iro.bem-object(iro.props-namespace()) {
        display: inline-block;
        color:   fn.color(--disabled --label);

        @include iro.bem-elem('inside') {
            display:         inline-block;
            padding:         fn.dim(--pad-y) fn.dim(--pad-x);
            border:          1px solid transparent;
            border-radius:   100em;
            line-height:     1;
            text-align:      center;
            text-decoration: none;
            text-overflow:   ellipsis;
            white-space:     nowrap;
        }

        @include iro.bem-elem('outside') {
            display:     inline-block;
            margin-left: fn.dim(--spacing);
        }

        &:link,
        &:visited,
        &:enabled {
            color: fn.color(--label);

            &:hover {
                @include iro.bem-elem('inside') {
                    background-color: fn.color(--hover --bg);
                    color:            fn.color(--hover --label);
                }
            }
    
            &:active {
                @include iro.bem-elem('inside') {
                    background-color: fn.color(--active --bg);
                    color:            fn.color(--active --label);
                }
            }
    
            @include iro.bem-at-theme('keyboard') {
                &:focus {
                    @include iro.bem-elem('inside') {
                        background-color: fn.color(--hover --bg);
                        color:            fn.color(--hover --label);
                    }
                }
            }
        }
    
        @include iro.bem-is('selected') {
            &:link,
            &:visited,
            &:enabled {
                @include iro.bem-elem('inside') {
                    background-color: fn.color(--selected --bg);
                    color:            fn.color(--selected --label);
                }
        
                &:hover,
                &:active {
                    @include iro.bem-elem('inside') {
                        background-color: fn.color(--selected --bg);
                        color:            fn.color(--selected --hover --label);
                    }
                }
    
                @include iro.bem-at-theme('keyboard') {
                    &:focus {
                        @include iro.bem-elem('inside') {
                            background-color: fn.color(--selected --bg);
                            color:            fn.color(--selected --hover --label);
                        }
                    }
                }
            }
        }
    
        @include iro.bem-at-theme('keyboard') {
            &:focus {
                @include iro.bem-elem('inside') {
                    border-color: fn.color(--key-focus --border);
                    box-shadow:   inset 0 0 0 1px fn.color(--key-focus --border), fn.color(--key-focus --shadow);
                }
            }
        }
    }
}