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