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