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