aboutsummaryrefslogtreecommitdiff
path: root/.config/ags/style/mixins/slider.scss
blob: b90e5669fddddfb86fb2cca39a83049b5afcab9a (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
@import './unset';

@mixin slider($width: 0.7em, $slider-width: .5em, $gradient: $active-gradient, $slider: true, $focusable: true, $radius: $radius) {
    @include unset($rec: true);

    trough {
        transition: $transition;
        border-radius: $radius;
        border: $border;
        background-color: $widget-bg;
        min-height: $width;
        min-width: $width;

        highlight,
        progress {
            border-radius: max($radius - $border-width, 0);
            background-image: $gradient;
            min-height: $width;
            min-width: $width;
        }
    }

    slider {
        box-shadow: none;
        background-color: transparent;
        border: $border-width solid transparent;
        transition: $transition;
        border-radius: $radius;
        min-height: $width;
        min-width: $width;
        margin: -$slider-width;
    }

    &:hover {
        trough {
            background-color: $hover-bg;
        }

        slider {
            @if $slider {
                background-color: $fg;
                border-color: $border-color;

                @if $shadows {
                    box-shadow: 0 0 3px 0 $shadow-color;
                }
            }
        }
    }

    &:disabled {

        highlight,
        progress {
            background-color: transparentize($fg, 0.4);
            background-image: none;
        }
    }

    @if $focusable {
        trough:focus {
            background-color: $hover-bg;
            box-shadow: inset 0 0 0 $border-width $primary-bg;

            slider {
                @if $slider {
                    background-color: $fg;
                    box-shadow: inset 0 0 0 $border-width $primary-bg;
                }
            }
        }

    }
}