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