gtk-4.0/widgets/_notebooks.scss 7.0 K raw
1
/*************
2
 * Notebooks *
3
 *************/
4
 notebook {
5
  > header {
6
    padding: 1px;
7
    border-color: $borders_color;
8
    border-width: 1px;
9
    background-color: darken($base_color, 5%);
10
11
    &:backdrop {
12
      border-color: $backdrop_borders_color;
13
      background-color: $backdrop_bg_color;
14
    }
15
16
    tabs { margin: 0px; }
17
18
    &.top {
19
      border-bottom-style: solid;
20
      > tabs {
21
        margin-bottom: -2px;
22
        > tab {
23
24
          &:backdrop { box-shadow: none; }
25
26
          &:checked {
27
              background-color: $base_color;
28
              &:hover{background-color: $base_color;}
29
          }
30
        }
31
      }
32
    }
33
34
    &.bottom {
35
      border-top-style: solid;
36
      > tabs {
37
        margin-top: -2px;
38
        > tab {
39
40
41
          &:backdrop { box-shadow: none; }
42
43
          &:checked { 
44
            background-color: $base_color; 
45
            box-shadow: -1px 0 0 $borders_color,
46
            0px 1px 0 $borders_color,
47
            1px 0 0 $borders_color;
48
          }
49
        }
50
      }
51
    }
52
53
    &.left {
54
      border-right-style: solid;
55
      > tabs {
56
        margin-right: -2px;
57
        > tab {
58
59
60
          &:backdrop { box-shadow: none; }
61
62
         &:checked { 
63
            background-color: $base_color; 
64
            box-shadow: 0px 1px 0 $borders_color,
65
            0px -1px 0 $borders_color,
66
            0px 1px 0 $borders_color;
67
          }
68
        }
69
      }
70
    }
71
72
    &.right {
73
      border-left-style: solid;
74
      > tabs {
75
        margin-left: -2px;
76
        > tab {
77
78
79
          &:backdrop { box-shadow: none; }
80
81
          &:checked { 
82
            background-color: $base_color; 
83
            box-shadow: 0px 1px 0 $borders_color,
84
            0px -1px 0 $borders_color,
85
            1px 0 0 $borders_color;
86
          }
87
        }
88
      }
89
    }
90
91
    &.top > tabs > arrow {
92
      @extend %notebook_vert_arrows;
93
94
      border-top-style: none;
95
    }
96
97
    &.bottom > tabs > arrow {
98
      @extend %notebook_vert_arrows;
99
100
      border-bottom-style: none;
101
    }
102
103
    @at-root %notebook_vert_arrows {
104
      margin-left: -5px;
105
      margin-right: -5px;
106
      padding-left: 4px;
107
      padding-right: 4px;
108
109
      &.down { -gtk-icon-source: -gtk-icontheme('pan-start-symbolic'); }
110
111
      &.up { -gtk-icon-source: -gtk-icontheme('pan-end-symbolic'); }
112
    }
113
114
    &.left > tabs > arrow {
115
      @extend %notebook_horz_arrows;
116
117
      border-left-style: none;
118
    }
119
120
    &.right > tabs > arrow {
121
      @extend %notebook_horz_arrows;
122
123
      border-right-style: none;
124
    }
125
126
    @at-root %notebook_horz_arrows {
127
      margin-top: -5px;
128
      margin-bottom: -5px;
129
      padding-top: 4px;
130
      padding-bottom: 4px;
131
132
      &.down { -gtk-icon-source: -gtk-icontheme('pan-up-symbolic'); }
133
134
      &.up { -gtk-icon-source: -gtk-icontheme('pan-down-symbolic'); }
135
    }
136
137
    > tabs > arrow {
138
      @extend %button_basic;
139
140
      @extend %button_basic.flat;
141
142
      min-height: 14px;
143
      min-width: 14px;
144
      border-radius: 0;
145
146
      &:hover:not(:active):not(:backdrop) {
147
        background-clip: padding-box;
148
        background-image: none;
149
        background-color: transparentize(white, 0.7);
150
        border-color: transparent;
151
        box-shadow: none;
152
      }
153
154
      &:disabled { @include button(undecorated); }
155
    }
156
157
    tab {
158
      min-height: 24px;
159
      min-width: 24px;
160
      padding: 1px 12px;
161
162
      outline-offset: -5px;
163
164
      color: $insensitive_fg_color;
165
      font-weight: normal;
166
167
      border-width: 1px;         // for reorderable tabs
168
      border-color: transparent; //
169
170
      &:hover {
171
        color: mix($insensitive_fg_color, $fg_color, 50%);
172
173
        &.reorderable-page {
174
          border-color: transparentize($borders_color, 0.7);
175
          background-color: transparentize($bg_color, 0.8);
176
        }
177
      }
178
179
      &:backdrop {
180
        color: mix($backdrop_fg_color, $backdrop_bg_color, 60%);
181
182
        &.reorderable-page {
183
          border-color: transparent;
184
          background-color: transparent;
185
        }
186
      }
187
188
      &:checked {
189
        color: $fg_color;
190
        box-shadow: -1px 0 0 $borders_color,
191
        0px -1px 0 $borders_color,
192
        1px 0 0 $borders_color;
193
        &.reorderable-page {
194
          border-color: transparentize($borders_color, 0.5);
195
          background-color: transparentize($bg_color, 0.5);
196
197
          &:hover { background-color: transparentize($bg_color, 0.3); }
198
        }
199
      }
200
201
      &:backdrop:checked {
202
        color: $backdrop_fg_color;
203
        &.reorderable-page {
204
          border-color: $backdrop_borders_color;
205
          background-color: $backdrop_base_color;
206
        }
207
      }
208
209
      // colors the button like the label, overridden otherwise
210
      button.flat {
211
        &:hover {  
212
          background: transparent;
213
          box-shadow: none;
214
          color: $red; 
215
        }
216
217
        &, &:backdrop { 
218
          background: transparent;
219
          border: none;
220
          color: gtkalpha(currentColor, 0.3); 
221
        }
222
223
        padding: 0;
224
        margin-top: 4px;
225
        margin-bottom: 4px;
226
        // FIXME: generalize .small-button?
227
        min-width: 20px;
228
        min-height: 20px;
229
230
        &:last-child {
231
          margin-left: 4px;
232
          margin-right: -4px;
233
        }
234
235
        &:first-child {
236
          margin-left: -4px;
237
          margin-right: 4px;
238
        }
239
      }
240
    }
241
242
    &.top,
243
    &.bottom {
244
      tabs {
245
        padding-left: 0px;
246
        padding-right: 0px;
247
248
        &:not(:only-child) {
249
          margin-left: 0.5px;
250
          margin-right: 0.5px;
251
252
          &:first-child { margin-left: -1px; }
253
          &:last-child { margin-right: -1px; }
254
        }
255
256
        tab {
257
          margin-left: 0.5px;
258
          margin-right: 0.5px;
259
260
          &.reorderable-page { border-style: none solid; }
261
        }
262
      }
263
    }
264
265
    &.left,
266
    &.right {
267
      tabs {
268
        padding-top: 4px;
269
        padding-bottom: 4px;
270
271
        &:not(:only-child) {
272
          margin-top: 3px;
273
          margin-bottom: 3px;
274
275
          &:first-child { margin-top: -1px; }
276
          &:last-child { margin-bottom: -1px; }
277
        }
278
279
        tab {
280
          margin-top: 4px;
281
          margin-bottom: 4px;
282
283
          &.reorderable-page { border-style: solid none; }
284
        }
285
      }
286
    }
287
288
    &.top tab { padding-bottom: 1px; }
289
    &.bottom tab { padding-top: 1px; }
290
  }
291
292
  > stack:not(:only-child) { // the :not(:only-child) is for "hidden" notebooks
293
    background-color: $base_color;
294
295
    &:backdrop { background-color: $backdrop_base_color; }
296
  }
297
}
298
299
tabbar {
300
  &:backdrop .box {
301
    > scrolledwindow,
302
    > .start-action,
303
    > .end-action {
304
      filter: opacity(1);
305
    }
306
  }
307
  tabbox {
308
    background-color: darken($base_color, 5%);
309
    padding: 0px;
310
    color: darken($fg_color, 15%);
311
    > tabboxchild {
312
      margin: 0 -3px;
313
      border-radius: 0;
314
    }
315
    > tab,
316
    > tabboxchild > tab {
317
      border-radius: 0;
318
      button.flat {
319
        padding: 0;
320
        margin: 4px;
321
        min-width: 20px;
322
        min-height: 20px;
323
        border-radius: 10px;
324
        &:hover {
325
          background-color: lighten($base_color, 15%);
326
          color: $fg_color;
327
        }
328
      }
329
      &:checked, &:selected { 
330
        background-color: $base_color; 
331
        color: lighten($fg_color, 15%);
332
      }
333
    }
334
  }
335
}