]> BookStack Code Mirror - bookstack/blob - resources/sass/_header.scss
[Fix] app_footer_links_desc
[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     &:focus {
195       @include lightDark(background-color, #eee, #333);
196       outline-color: var(--color-primary);
197       color: var(--color-primary);
198     }
199   }
200   header .dropdown-container {
201     display: block;
202     padding-inline-start: 0;
203   }
204   header .links {
205     display: block;
206   }
207   header .dropdown-container ul {
208     display: block !important;
209     position: relative;
210     background-color: transparent;
211     border: 0;
212     padding: 0;
213     margin: 0;
214     box-shadow: none;
215   }
216 }
217
218 .tri-layout-mobile-tabs {
219   position: sticky;
220   top: 0;
221   z-index: 5;
222   background-color: #FFF;
223   border-bottom: 1px solid #DDD;
224   box-shadow: $bs-card;
225 }
226 .tri-layout-mobile-tab {
227   text-align: center;
228   border-bottom: 3px solid #BBB;
229   cursor: pointer;
230   &:first-child {
231     border-inline-end: 1px solid #DDD;
232   }
233   &[aria-selected="true"] {
234     border-bottom-color: currentColor;
235   }
236 }
237
238 .breadcrumbs {
239   display: flex;
240   flex-direction: row;
241   align-items: center;
242   justify-content: flex-start;
243   flex-wrap: wrap;
244   opacity: 0.7;
245   .icon-list-item {
246     width: auto;
247     padding-top: $-xs;
248     padding-bottom: $-xs;
249   }
250   .separator {
251     display: inline-block;
252     fill: #aaa;
253     font-size: 1.6em;
254     line-height: 0.8;
255     margin: -2px 0 0;
256   }
257   &:hover, &:focus-within {
258     opacity: 1;
259   }
260 }
261
262 @include smaller-than($l) {
263   .breadcrumbs .icon-list-item {
264     padding: $-xs;
265     > span + span {
266       display: none;
267     }
268     > span:first-child {
269       margin-inline-end: 0;
270     }
271   }
272 }
273
274 .dropdown-search {
275   position: relative;
276   .dropdown-search-toggle {
277     padding: $-xs;
278     border: 1px solid transparent;
279     border-radius: 4px;
280     &:hover {
281       border-color: #DDD;
282     }
283   }
284   .svg-icon {
285     margin-inline-end: 0;
286   }
287 }
288
289 .dropdown-search-toggle.compact {
290   padding: $-xxs $-xs;
291   .avatar {
292     height: 22px;
293     width: 22px;
294   }
295 }
296
297 .faded {
298   a, button, span, span > div {
299     color: #666;
300     fill: #666;
301   }
302   .text-button {
303     opacity: 0.5;
304     transition: all ease-in-out 120ms;
305     &:hover {
306       opacity: 1;
307       text-decoration: none;
308     }
309   }
310 }
311
312 .faded span.faded-text {
313   display: inline-block;
314   padding: $-s;
315 }
316
317 .action-buttons .text-button {
318   display: inline-block;
319   padding: $-xs $-s;
320   &:last-child {
321     padding-inline-end: 0;
322   }
323   &:first-child {
324     padding-inline-start: 0;
325   }
326 }
327
328
329 .action-buttons .dropdown-container:last-child a {
330   padding-inline-end: 0;
331   padding-inline-start: $-s;
332 }
333 .action-buttons {
334   text-align: end;
335   &.text-left {
336     text-align: start;
337     .text-button {
338       padding-inline-end: $-m;
339       padding-inline-start: 0;
340     }
341   }
342   &.text-center {
343     text-align: center;
344   }
345 }
346
347 @include smaller-than($m) {
348   .action-buttons .text-button {
349     padding: $-xs $-xs;
350   }
351   .action-buttons .dropdown-container:last-child a {
352     padding-inline-start: $-xs;
353   }
354 }