]> BookStack Code Mirror - bookstack/blob - resources/sass/styles.scss
Updated code view block line highlighting to only show on focus
[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-link);
117   }
118 }
119
120 .contained-search-box {
121   display: flex;
122   height: 38px;
123   z-index: -1;
124   input, button {
125     height: 100%;
126     border-radius: 0;
127     border: 1px solid #ddd;
128     @include lightDark(border-color, #ddd, #000);
129     margin-inline-start: -1px;
130     &:last-child {
131       border-inline-end: 0;
132     }
133   }
134   input {
135     flex: 5;
136     padding: $-xs $-s;
137     &:focus, &:active {
138       outline: 1px dotted var(--color-primary);
139       outline-offset: -2px;
140       border: 1px solid #ddd;
141       @include lightDark(border-color, #ddd, #000);
142     }
143   }
144   button {
145     width: 60px;
146   }
147   button.primary-background {
148     border-color: var(--color-primary);
149   }
150   button i {
151     padding: 0;
152   }
153   svg {
154     margin: 0;
155   }
156 }
157
158 .entity-selector {
159   border: 1px solid #DDD;
160   @include lightDark(border-color, #ddd, #111);
161   border-radius: 3px;
162   overflow: hidden;
163   font-size: 0.8em;
164   input[type="text"] {
165     width: 100%;
166     display: block;
167     border-radius: 0;
168     border: 0;
169     border-bottom: 1px solid #DDD;
170     font-size: 16px;
171     padding: $-s $-m;
172   }
173   .entity-list {
174     overflow-y: scroll;
175     height: 400px;
176     @include lightDark(background-color, #eee, #222);
177     margin-inline-end: 0;
178     margin-inline-start: 0;
179   }
180   .entity-list-item {
181     @include lightDark(background-color, #fff, #222);
182   }
183   .entity-list-item p {
184     margin-bottom: 0;
185   }
186   .entity-list-item:focus {
187     outline: 2px dotted var(--color-primary);
188     outline-offset: -4px;
189   }
190   .entity-list-item.selected {
191     @include lightDark(background-color, rgba(0, 0, 0, 0.05), rgba(255, 255, 255, 0.05));
192   }
193   .loading {
194     height: 400px;
195     padding-top: $-l;
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 .fullscreen {
209   border:0;
210   position:fixed;
211   top:0;
212   left:0;
213   right:0;
214   bottom:0;
215   width:100%;
216   height:100%;
217   z-index: 150;
218 }
219
220 .list-sort-container {
221   display: inline-block;
222   form {
223     display: inline-block;
224   }
225   .list-sort {
226     display: inline-grid;
227     margin-inline-start: $-s;
228     grid-template-columns: minmax(120px, max-content) 40px;
229     font-size: 0.9rem;
230     border: 2px solid #DDD;
231     @include lightDark(border-color, #ddd, #444);
232     border-radius: 4px;
233   }
234   .list-sort-label {
235     font-weight: bold;
236     display: inline-block;
237     @include lightDark(color, #555, #888);
238   }
239   .list-sort-type {
240     text-align: start;
241   }
242   .list-sort-type, .list-sort-dir {
243     padding: $-xs $-s;
244     cursor: pointer;
245   }
246   .list-sort-dir {
247     border-inline-start: 2px solid #DDD;
248     color: #888;
249     @include lightDark(border-color, #ddd, #444);
250     .svg-icon {
251       transition: transform ease-in-out 120ms;
252     }
253     &:hover .svg-icon {
254       transform: rotate(180deg);
255     }
256   }
257 }