Debian Codegraph @

src/gtk3/widgets/_spinbutton.scss

raw
1 @charset "UTF-8";
2
3 /*****************
4 * GtkSpinButton *
5 *****************/
6 spinbutton {
7 &:not(.vertical) {
8 // in this horizontal configuration, the whole spinbutton
9 // behaves as the entry, so we extend the entry styling
10 // and nuke the style on the internal entry
11 @extend %entry;
12
13 padding: 0;
14
15 entry {
16 min-width: 28px;
17 // reset all the other props since the spinbutton node is styled here
18 margin: 0;
19 background: none;
20 background-color: transparent;
21 border: none;
22 border-radius: 0;
23 box-shadow: none;
24
25 &:backdrop:disabled {
26 background-color: transparent;
27 }
28 }
29
30 button {
31 min-height: 16px;
32 margin: 0;
33 padding-bottom: 0;
34 padding-top: 0;
35 color: gtk("@theme_text_color");
36 background-image: none;
37 background-color: transparent;
38 border-style: none;
39 box-shadow: none;
40
41 &:hover {
42 color: gtk("@theme_view_hover_decoration_color");
43
44 // disable button's hover background override
45 &:not(:checked):not(:active) {
46 background: none;
47 }
48 }
49
50 &:disabled {
51 color: gtk("@insensitive_base_fg_color");
52 }
53
54 &:active {
55 color: gtk("@theme_view_active_decoration_color");
56 box-shadow: none;
57 }
58
59 &:backdrop {
60 color: gtk("@theme_unfocused_text_color");
61 background-color: transparent;
62 }
63
64 &:backdrop:disabled {
65 color: gtk("@theme_unfocused_view_text_color");
66 background-color: transparent;
67 border-style: none; // It is needed or it gets overridden
68 }
69
70 &:dir(ltr):last-child {
71 border-radius: 0 3px 3px 0;
72 }
73
74 &:dir(rtl):first-child {
75 border-radius: 3px 0 0 3px;
76 }
77 }
78 }
79
80 // Vertical
81 &.vertical {
82 // in the vertical configuration, we treat the spinbutton
83 // as a box, and tweak the style of the entry in the middle
84 // so that it's linked
85
86 // FIXME: this should not be set at all, but otherwise it gets the wrong
87 // color
88 &:disabled {
89 color: gtk("@insensitive_base_fg_color");
90 }
91
92 &:backdrop:disabled {
93 color: gtk("@theme_unfocused_view_text_color");
94 }
95
96 &:drop(active) {
97 border-color: transparent;
98 box-shadow: none;
99 }
100
101 entry {
102 margin: 0px;
103 min-height: 26px;
104 min-width: 26px;
105 border-style: none solid none solid;
106 border-color: gtk("@borders");
107 padding: 0;
108 border-radius: 0;
109 &:disabled {
110 color: gtk("@insensitive_base_fg_color");
111 background-color: gtk("@insensitive_base_color");
112 border-color: gtk("@insensitive_borders");
113 }
114 &:backdrop:disabled {
115 color: gtk("@theme_unfocused_view_text_color");
116 background-color: gtk(
117 "@theme_unfocused_view_bg_color"
118 );
119 border-color: gtk("@unfocused_insensitive_borders");
120 }
121 }
122
123 button {
124 min-height: 26px;
125 min-width: 26px;
126 padding: 0;
127 box-shadow: none;
128 background-image: none;
129 background-color: gtk("@theme_base_color");
130 color: gtk("@theme_text_color");
131 border-color: gtk("@borders");
132 &:hover {
133 color: gtk("@theme_view_hover_decoration_color");
134
135 // disable button's hover background override
136 &:not(:checked):not(:active) {
137 background-color: gtk("@theme_base_color");
138 }
139 }
140 &:active {
141 color: gtk("@theme_view_active_decoration_color");
142 }
143 &:disabled {
144 color: gtk("@insensitive_base_fg_color");
145 background-color: gtk("@insensitive_base_color");
146 border-color: gtk("@insensitive_borders");
147 }
148 &:backdrop:disabled {
149 color: gtk("@theme_unfocused_view_text_color");
150 background-color: gtk(
151 "@theme_unfocused_view_bg_color"
152 );
153 border-color: gtk("@unfocused_insensitive_borders");
154 }
155
156 &.up {
157 @extend %top_button;
158 }
159
160 &.down {
161 @extend %bottom_button;
162 }
163 }
164
165 %top_button {
166 border-radius: 3px 3px 0 0;
167 border-style: solid solid none solid;
168 }
169
170 %bottom_button {
171 border-radius: 0 0 3px 3px;
172 border-style: none solid solid solid;
173 }
174 }
175
176 // Misc
177 treeview &:not(.vertical) {
178 min-height: 0;
179 border-style: none;
180 border-radius: 0;
181
182 entry {
183 min-height: 0;
184 padding: 1px 2px;
185 }
186 }
187 }