summaryrefslogtreecommitdiff
path: root/scss/widgets.scss
blob: 0e11f46b2e5908975ef5501908995af118546b5d (plain)
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
@use "sass:color";
@use "scheme";
@use "lib";
@use "font";

@keyframes appear {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@mixin -appear($duration: 100ms) {
    animation-name: appear;
    animation-duration: $duration;
    animation-timing-function: ease-out;
    animation-iteration-count: 1;
}

menu {
    @include -appear;
    @include lib.rounded(5);
    @include lib.border(color.change(scheme.$blue, $alpha: 0.7), 2);
    @include font.main;

    padding: lib.s(10);
    background-color: scheme.$surface0;
    color: scheme.$text;

    & > menuitem {
        @include lib.rounded(8);

        padding: lib.s(8) lib.s(16);
        background: transparent;
        transition: 0.2s ease background-color;

        &:hover,
        &:focus {
            background-color: scheme.$surface1;
        }

        &:active {
            background-color: scheme.$surface2;
        }

        &:disabled {
            color: scheme.$subtext0;
        }

        & > arrow {
            @include lib.rounded(1000);

            min-width: lib.s(5);
            min-height: lib.s(5);
            background-color: scheme.$blue;

            &.right {
                margin-left: lib.s(12);
            }

            &.left {
                margin-right: lib.s(12);
            }
        }
    }

    & > separator {
        @include lib.rounded(1);

        background-color: scheme.$blue;
        min-width: lib.s(0.5);
        min-height: lib.s(0.5);
        margin: lib.s(8) 0;
    }
}

tooltip,
.tooltip {
    @include lib.rounded(5);
    @include lib.border(color.change(scheme.$teal, $alpha: 0.7));
    @include font.reading;

    background-color: scheme.$surface0;
    color: scheme.$text;
    padding: lib.s(4) lib.s(8);
}

tooltip {
    @include -appear(200ms);
}

scrollbar {
    trough {
        @include lib.rounded(1000);

        min-width: lib.s(12);
        background-color: transparent;
    }

    slider {
        @include lib.rounded(1000);
        @include lib.element-decel;

        min-width: lib.s(6);
        min-height: lib.s(30);
        background-color: color.change(scheme.$overlay0, $alpha: 0.3);

        &:hover,
        &:focus {
            background-color: color.change(scheme.$overlay0, $alpha: 0.4);
        }

        &:active {
            background-color: color.change(scheme.$overlay1, $alpha: 0.5);
        }
    }
}