]> BookStack Code Mirror - bookstack/blob - resources/sass/_header.scss
Merge branch 'master' into master
[bookstack] / resources / sass / _header.scss
1 /**
2  * Includes the main navigation header and the faded toolbar.
3  */
4
5 header .grid {
6   grid-template-columns: minmax(max-content, 2fr) 1fr minmax(max-content, 2fr);
7 }
8
9 @include smaller-than($l) {
10   header .grid {
11     grid-template-columns: 1fr;
12     grid-row-gap: 0;
13   }
14 }
15
16 header {
17   position: relative;
18   display: block;
19   z-index: 11;
20   top: 0;
21   color: rgb(250, 250, 250);
22   border-bottom: 1px solid #DDD;
23   box-shadow: $bs-card;
24   padding: $-xxs 0;
25   @include lightDark(border-bottom-color, #DDD, #000);
26   @include whenDark {
27     filter: saturate(0.8) brightness(0.8);
28   }
29   .links {
30     display: inline-block;
31     vertical-align: top;
32   }
33   .links a {
34     display: inline-block;
35     padding: $-m;
36     color: #FFF;
37   }
38   .dropdown-container {
39     padding-inline-start: $-m;
40     padding-inline-end: 0;
41   }
42   .avatar, .user-name {
43     display: inline-block;
44   }
45   .avatar {
46     width: 30px;
47     height: 30px;
48   }
49   .user-name {
50     vertical-align: top;
51     position: relative;
52     display: inline-block;
53     cursor: pointer;
54     > * {
55       vertical-align: top;
56     }
57     > span {
58       padding-inline-start: $-xs;
59       display: inline-block;
60       padding-top: $-xxs;
61     }
62     > svg {
63       padding-top: 4px;
64       font-size: 18px;
65     }
66     @include between($l, $xl) {
67       padding-inline-start: $-xs;
68       .name {
69         display: none;
70       }
71     }
72   }
73 }
74
75 .header *, .primary-background * {
76   outline-color: #FFF;
77 }
78
79
80 header .search-box {
81   display: inline-block;
82   margin-top: 10px;
83   input {
84     background-color: rgba(0, 0, 0, 0.2);
85     border: 1px solid rgba(255, 255, 255, 0.2);
86     border-radius: 40px;
87     color: #EEE;
88     z-index: 2;
89     padding-inline-start: 40px;
90     &:focus {
91       outline: none;
92       border: 1px solid rgba(255, 255, 255, 0.6);
93     }
94   }
95   button {
96     z-index: 1;
97     left: 16px;
98     @include lightDark(color, rgba(255, 255, 255, 0.8), #AAA);
99     @include rtl {
100       left: auto;
101       right: 16px;
102     }
103     svg {
104       margin-block-end: 0;
105     }
106   }
107   ::-webkit-input-placeholder { /* Chrome/Opera/Safari */
108     color: #DDD;
109   }
110   ::-moz-placeholder { /* Firefox 19+ */
111     color: #DDD;
112   }
113   @include between($l, $xl) {
114     max-width: 200px;
115   }
116 }
117
118 .logo {
119   display: inline-block;
120   &:hover {
121     color: #FFF;
122     text-decoration: none;
123   }
124 }
125 .logo-text {
126   display: inline-block;
127   font-size: 1.8em;
128   color: #fff;
129   font-weight: 400;
130   @include padding(14px, $-l, 14px, 0);
131   vertical-align: top;
132   line-height: 1;
133 }
134 .logo-image {
135   @include margin($-xs, $-s, $-xs, 0);
136   vertical-align: top;
137   height: 43px;
138 }
139
140 .mobile-menu-toggle {
141   color: #FFF;
142   fill: #FFF;
143   font-size: 2em;
144   border: 2px solid rgba(255, 255, 255, 0.8);
145   border-radius: 4px;
146   padding: 0 $-xs;
147   position: absolute;
148   right: $-m;
149   top: 13px;
150   line-height: 1;
151   cursor: pointer;
152   user-select: none;
153   svg {
154     margin: 0;
155     bottom: -2px;
156   }
157   @include rtl() {
158     left: $-m;
159     right: auto;
160   }
161 }
162
163
164
165 @include smaller-than($l) {
166   header .header-links {
167     @include lightDark(background-color, #fff, #333);
168     display: none;
169     z-index: 10;
170     right: $-m;
171     border-radius: 4px;
172     overflow: hidden;
173     position: absolute;
174     box-shadow: $bs-hover;
175     margin-top: -$-xs;
176     &.show {
177       display: block;
178     }
179   }
180   header .links a, header .dropdown-container ul li a, header .dropdown-container ul li button {
181     text-align: start;
182     display: block;
183     padding: $-s $-m;
184     color: $text-dark;
185     @include lightDark(color, $text-dark, #eee);
186     svg {
187       margin-inline-end: $-s;
188     }
189     &:hover {
190       @include lightDark(background-color, #eee, #333);
191       @include lightDark(color, #000, #fff);
192       text-decoration: none;
193     }
194   }
195   header .dropdown-container {
196     display: block;
197     padding-inline-start: 0;
198   }
199   header .links {
200     display: block;
201   }
202   header .dropdown-container ul {
203     display: block !important;
204     position: relative;
205     background-color: transparent;
206     border: 0;
207     padding: 0;
208     margin: 0;
209     box-shadow: none;
210   }
211 }
212
213 .tri-layout-mobile-tabs {
214   position: sticky;
215   top: 0;
216   z-index: 5;
217   background-color: #FFF;
218   border-bottom: 1px solid #DDD;
219   box-shadow: $bs-card;
220 }
221 .tri-layout-mobile-tab {
222   text-align: center;
223   border-bottom: 3px solid #BBB;
224   cursor: pointer;
225   &:first-child {
226     border-inline-end: 1px solid #DDD;
227   }
228   &.active {
229     border-bottom-color: currentColor;
230   }
231 }
232
233 .breadcrumbs {
234   display: flex;
235   flex-direction: row;
236   align-items: center;
237   justify-content: flex-start;
238   flex-wrap: wrap;
239   opacity: 0.7;
240   .icon-list-item {
241     width: auto;
242     padding-top: $-xs;
243     padding-bottom: $-xs;
244   }
245   .separator {
246     display: inline-block;
247     fill: #aaa;
248     font-size: 1.6em;
249     line-height: 0.8;
250     margin: -2px 0 0;
251   }
252   &:hover, &:focus-within {
253     opacity: 1;
254   }
255 }
256
257 @include smaller-than($l) {
258   .breadcrumbs .icon-list-item {
259     padding: $-xs;
260     > span + span {
261       display: none;
262     }
263     > span:first-child {
264       margin-inline-end: 0;
265     }
266   }
267 }
268
269 .dropdown-search {
270   position: relative;
271   .dropdown-search-toggle {
272     padding: 6px;
273     border: 1px solid transparent;
274     border-radius: 4px;
275     &:hover {
276       border-color: #DDD;
277     }
278   }
279   .svg-icon {
280     margin-inline-end: 0;
281   }
282 }
283
284 .faded {
285   a, button, span, span > div {
286     color: #666;
287     fill: #666;
288   }
289   .text-button {
290     opacity: 0.5;
291     transition: all ease-in-out 120ms;
292     &:hover {
293       opacity: 1;
294       text-decoration: none;
295     }
296   }
297 }
298
299 .faded span.faded-text {
300   display: inline-block;
301   padding: $-s;
302 }
303
304 .action-buttons .text-button {
305   display: inline-block;
306   padding: $-xs $-s;
307   &:last-child {
308     padding-inline-end: 0;
309   }
310   &:first-child {
311     padding-inline-start: 0;
312   }
313 }
314
315
316 .action-buttons .dropdown-container:last-child a {
317   padding-inline-end: 0;
318   padding-inline-start: $-s;
319 }
320 .action-buttons {
321   text-align: end;
322   &.text-left {
323     text-align: start;
324     .text-button {
325       padding-inline-end: $-m;
326       padding-inline-start: 0;
327     }
328   }
329   &.text-center {
330     text-align: center;
331   }
332 }
333
334 @include smaller-than($m) {
335   .action-buttons .text-button {
336     padding: $-xs $-xs;
337   }
338   .action-buttons .dropdown-container:last-child a {
339     padding-inline-start: $-xs;
340   }
341 }