]> BookStack Code Mirror - bookstack/blob - resources/sass/styles.scss
398d16fac3afe34ef75bf5348764f7dac0f399a2
[bookstack] / resources / sass / styles.scss
1 @use "sass:math";
2
3 @import "reset";
4 @import "variables";
5 @import "mixins";
6 @import "spacing";
7 @import "opacity";
8 @import "html";
9 @import "text";
10 @import "colors";
11 @import "layout";
12 @import "blocks";
13 @import "buttons";
14 @import "tables";
15 @import "forms";
16 @import "animations";
17 @import "tinymce";
18 @import "codemirror";
19 @import "components";
20 @import "header";
21 @import "footer";
22 @import "lists";
23 @import "pages";
24
25 // Jquery Sortable Styles
26 .dragged {
27   position: absolute;
28   opacity: 0.5;
29   z-index: 2000;
30 }
31 body.dragging, body.dragging * {
32   cursor: move !important;
33 }
34
35 // User Avatar Images
36 .avatar {
37   border-radius: 100%;
38   @include lightDark(background-color, #eee, #000);
39   width: 30px;
40   height: 30px;
41   &.med {
42     width: 40px;
43     height: 40px;
44   }
45   &.large {
46     width: 80px;
47     height: 80px;
48   }
49   &.huge {
50     width: 120px;
51     height: 120px;
52   }
53   &.square {
54     border-radius: 3px;
55   }
56   &[src$="user_avatar.png"] {
57     @include whenDark {
58       filter: invert(1);
59     }
60   }
61 }
62
63 // Loading icon
64 $loadingSize: 10px;
65 .loading-container {
66   position: relative;
67   display: block;
68   margin: $-xl auto;
69   > div {
70     width: $loadingSize;
71     height: $loadingSize;
72     border-radius: $loadingSize;
73     display: inline-block;
74     vertical-align: top;
75     transform: translate3d(-10px, 0, 0);
76     margin-top: $-xs;
77     animation-name: loadingBob;
78     animation-duration: 1.4s;
79     animation-iteration-count: infinite;
80     animation-timing-function: cubic-bezier(.62, .28, .23, .99);
81     margin-inline-end: 4px;
82     background-color: var(--color-page);
83     animation-delay: -300ms;
84   }
85   > div:first-child {
86       left: -($loadingSize+$-xs);
87       background-color: var(--color-book);
88       animation-delay: -600ms;
89   }
90   > div:last-of-type {
91     left: $loadingSize+$-xs;
92     background-color: var(--color-chapter);
93     animation-delay: 0ms;
94   }
95   > span {
96     margin-inline-start: $-s;
97     font-style: italic;
98     color: #888;
99     vertical-align: top;
100   }
101 }
102
103 .skip-to-content-link {
104   position: fixed;
105   top: -52px;
106   left: 0;
107   background-color: #FFF;
108   z-index: 15;
109   border-radius: 0 4px 4px 0;
110   display: block;
111   box-shadow: $bs-dark;
112   font-weight: bold;
113   &:focus {
114     top: $-xl;
115     outline-offset: -10px;
116     outline: 2px dotted var(--color-primary);
117   }
118 }
119
120 .contained-search-box {
121   display: flex;
122   height: 38px;
123   input, button {
124     border-radius: 0;
125     border: 1px solid #ddd;
126     @include lightDark(border-color, #ddd, #000);
127     margin-inline-start: -1px;
128   }
129   input {
130     flex: 5;
131     padding: $-xs $-s;
132     &:focus, &:active {
133       outline: 0;
134     }
135   }
136   button {
137     width: 60px;
138   }
139   button i {
140     padding: 0;
141   }
142   button.cancel.active {
143     background-color: $negative;
144     color: #EEE;
145   }
146   svg {
147     margin: 0;
148   }
149 }
150
151 .entity-selector {
152   border: 1px solid #DDD;
153   @include lightDark(border-color, #ddd, #111);
154   border-radius: 3px;
155   overflow: hidden;
156   font-size: 0.8em;
157   input[type="text"] {
158     width: 100%;
159     display: block;
160     border-radius: 0;
161     border: 0;
162     border-bottom: 1px solid #DDD;
163     font-size: 16px;
164     padding: $-s $-m;
165   }
166   .entity-list {
167     overflow-y: scroll;
168     height: 400px;
169     @include lightDark(background-color, #eee, #222);
170     margin-inline-end: 0;
171     margin-inline-start: 0;
172   }
173   .entity-list-item {
174     @include lightDark(background-color, #fff, #222);
175   }
176   .entity-list-item p {
177     margin-bottom: 0;
178   }
179   .entity-list-item:focus {
180     outline: 2px dotted var(--color-primary);
181     outline-offset: -4px;
182   }
183   .entity-list-item.selected {
184     @include lightDark(background-color, rgba(0, 0, 0, 0.05), rgba(255, 255, 255, 0.05));
185   }
186   .loading {
187     height: 400px;
188     padding-top: $-l;
189   }
190   .entity-selector-add button {
191     margin: 0;
192     display: block;
193     width: 100%;
194     border: 0;
195     border-top: 1px solid #DDD;
196   }
197   &.compact {
198     font-size: 10px;
199     .entity-item-snippet {
200       display: none;
201     }
202     h4 {
203       font-size: 14px;
204     }
205   }
206 }
207
208 .scroll-box {
209   max-height: 250px;
210   overflow-y: scroll;
211   border: 1px solid;
212   @include lightDark(border-color, #DDD, #000);
213   border-radius: 3px;
214   min-height: 20px;
215   @include lightDark(background-color, #EEE, #000);
216 }
217 .scroll-box-item {
218   border-bottom: 1px solid;
219   border-top: 1px solid;
220   @include lightDark(border-color, #DDD, #000);
221   margin-top: -1px;
222   @include lightDark(background-color, #FFF, #222);
223   display: flex;
224   padding: 1px;
225   &:last-child {
226     border-bottom: 0;
227   }
228   &:hover {
229     cursor: pointer;
230     @include lightDark(background-color, #f8f8f8, #333);
231   }
232   .handle {
233     color: #AAA;
234     cursor: grab;
235   }
236   .handle svg {
237     margin: 0;
238   }
239   > * {
240     padding: $-xs $-m;
241   }
242   .handle + * {
243     padding-left: 0;
244   }
245   &:hover .handle {
246     @include lightDark(color, #444, #FFF);
247   }
248   a:hover {
249     text-decoration: none;
250   }
251 }
252
253 input.scroll-box-search, .scroll-box-header-item {
254   font-size: 0.8rem;
255   padding: $-xs $-m;
256   border: 1px solid;
257   @include lightDark(border-color, #DDD, #000);
258   @include lightDark(background-color, #FFF, #222);
259   margin-bottom: -1px;
260   border-radius: 3px 3px 0 0;
261   width: 100%;
262   max-width: 100%;
263   height: auto;
264   line-height: 1.4;
265   color: #666;
266 }
267
268 .scroll-box-search + .scroll-box,
269 .scroll-box-header-item + .scroll-box {
270   border-radius: 0 0 3px 3px;
271 }
272
273 .fullscreen {
274   border:0;
275   position:fixed;
276   top:0;
277   left:0;
278   right:0;
279   bottom:0;
280   width:100%;
281   height:100%;
282   z-index: 150;
283 }
284
285 .list-sort-container {
286   display: inline-block;
287   form {
288     display: inline-block;
289   }
290   .list-sort {
291     display: inline-grid;
292     margin-inline-start: $-s;
293     grid-template-columns: minmax(120px, max-content) 40px;
294     font-size: 0.9rem;
295     border: 2px solid #DDD;
296     @include lightDark(border-color, #ddd, #444);
297     border-radius: 4px;
298   }
299   .list-sort-label {
300     font-weight: bold;
301     display: inline-block;
302     @include lightDark(color, #555, #888);
303   }
304   .list-sort-type {
305     text-align: start;
306   }
307   .list-sort-type, .list-sort-dir {
308     padding: $-xs $-s;
309     cursor: pointer;
310   }
311   .list-sort-dir {
312     border-inline-start: 2px solid #DDD;
313     color: #888;
314     @include lightDark(border-color, #ddd, #444);
315     .svg-icon {
316       transition: transform ease-in-out 120ms;
317     }
318     &:hover .svg-icon {
319       transform: rotate(180deg);
320     }
321   }
322 }