summaryrefslogtreecommitdiff
path: root/Redcore-daylight/gtk-3.20/scss/widgets/_choosers.scss
blob: 6741bd81c07e072fd0055d00cdd80ff7551ff7bf (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
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
/***************
 ! Color chooser
****************/

@include exports("colorchooser") {
    colorswatch {
        // This widget is made of two boxes one on top of the other, the lower box is colorswatch {} the other one
        // is colorswatch overlay {}, colorswatch has the programmatically set background, so most of the style is
        // applied to the overlay box.

        &:drop(active), & { border-style: none; } // FIXME: implement a proper drop(active) state

        $_colorswatch_radius: $roundness;

        // base color corners rounding
        // to avoid the artifacts caused by rounded corner anti-aliasing the base color
        // sports a bigger radius.
        // nth-child is needed by the custom color strip.

        &.top {
            border-top-left-radius: $_colorswatch_radius + .5px;
            border-top-right-radius: $_colorswatch_radius + .5px;

            overlay {
                border-top-left-radius: $_colorswatch_radius;
                border-top-right-radius: $_colorswatch_radius;
            }
        }

        &.bottom {
            border-bottom-left-radius: $_colorswatch_radius + .5px;
            border-bottom-right-radius: $_colorswatch_radius + .5px;

            overlay {
                border-bottom-left-radius: $_colorswatch_radius;
                border-bottom-right-radius: $_colorswatch_radius;
            }
        }

        &.left,
        &:first-child:not(.top) {
            border-top-left-radius: $_colorswatch_radius + .5px;
            border-bottom-left-radius: $_colorswatch_radius + .5px;

            overlay {
                border-top-left-radius: $_colorswatch_radius;
                border-bottom-left-radius: $_colorswatch_radius;
            }
        }

        &.right,
        &:last-child:not(.bottom) {
            border-top-right-radius: $_colorswatch_radius + .5px;
            border-bottom-right-radius: $_colorswatch_radius + .5px;

            overlay {
                border-top-right-radius: $_colorswatch_radius;
                border-bottom-right-radius: $_colorswatch_radius;
            }
        }

        &.dark overlay {
            color: $selected_fg_color;

            &:hover { border-color: if($variant == 'light', transparentize($black, .2), $borders_color); }

            &:backdrop { color: $backdrop_selected_fg_color; }
        }

        &.light overlay {
            color: $text_color;

            &:hover { border-color: if($variant == 'light', transparentize($black, .5), $borders_color); }

            &:backdrop { color: $backdrop_text_color; }
        }

        &:drop(active) {
            box-shadow: none;

            &.light overlay {
                border-color: $drop_target_color;
                box-shadow: inset 0 0 0 2px if($variant == 'light', darken($drop_target_color, 7%), $borders_color),
                            inset 0 0 0 1px $drop_target_color;
            }

            &.dark overlay {
                border-color: $drop_target_color;
                box-shadow: inset 0 0 0 2px if($variant == 'light', transparentize($black, .7), $borders_color),
                            inset 0 0 0 1px $drop_target_color;
            }
        }

        overlay {
            border: 1px solid if($variant == 'light', transparentize($black, .7), $borders_color);

            &:hover {
                box-shadow: inset 0 1px transparentize($white, .6),
                            inset 0 -1px transparentize($black, .8);
            }

            &:backdrop,
            &:backdrop:hover {
                border-color: if($variant == 'light', transparentize($black, .7), $borders_color);
                box-shadow: none;
            }
        }

        &:disabled {
            opacity: .5;

            overlay {
                border-color: transparentize($black, .4);
                box-shadow: none;
            }
        }

        row:selected & { box-shadow: 0 0 0 2px $selected_fg_color; }

        &#add-color-button {
            border-radius: $_colorswatch_radius $_colorswatch_radius 0 0;

            &:only-child { border-radius: $_colorswatch_radius; }

            overlay {
                background-color: shade($bg_color, .95);
                color: $fg_color;

                &:hover { background-color: shade($bg_color, .9); }

                &:backdrop { background-color: shade($backdrop_bg_color, .95); }
            }
        }

        &#editor-color-sample {
            border-radius: $_colorswatch_radius;

            overlay { border-radius: $_colorswatch_radius + .5px; }
       }
    }

    button.color {
        padding: $spacing;

        colorswatch:only-child {
            &, overlay { border-radius: 0; }

            @if $variant == 'light' { box-shadow: 0 1px _text_shadow_color(); }
        }

        @if $variant == 'light' {
            &:disabled,
            &:backdrop,
            &:active,
            &:checked { colorswatch:only-child { box-shadow: none; } }
        }
    }
}


/***********************
! Font and file choosers
************************/

@include exports("miscchoosers") {
    filechooser {
        /* for fallback when header bar not used */
        .dialog-action-box {
            border-top: 1px solid $borders_color;

            &:backdrop { border-top-color: $backdrop_borders_color; }
        }

        #pathbarbox { border-bottom: 1px solid $bg_color; }
    }

    filechooserbutton:drop(active) {
        box-shadow: none;
        border-color: transparent;
    }
}