]> BookStack Code Mirror - bookstack/blob - resources/sass/_blocks.scss
Added control-upon-access of the default favicon.ico file
[bookstack] / resources / sass / _blocks.scss
1
2 /**
3  * Callouts
4  */
5 .callout {
6   border-inline-start: 3px solid #BBB;
7   background-color: #EEE;
8   padding: $-s $-s $-s $-xl;
9   display: block;
10   position: relative;
11   overflow: auto;
12   &:before {
13     background-image: url('data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjQgMjQiIGZpbGw9IiMwMTUzODAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+ICAgIDxwYXRoIGQ9Ik0wIDBoMjR2MjRIMHoiIGZpbGw9Im5vbmUiLz4gICAgPHBhdGggZD0iTTEyIDJDNi40OCAyIDIgNi40OCAyIDEyczQuNDggMTAgMTAgMTAgMTAtNC40OCAxMC0xMFMxNy41MiAyIDEyIDJ6bTEgMTVoLTJ2LTZoMnY2em0wLThoLTJWN2gydjJ6Ii8+PC9zdmc+');
14     background-repeat: no-repeat;
15     content: '';
16     width: 1.2em;
17     height: 1.2em;
18     left: $-xs + 2px;
19     top: 50%;
20     margin-top: -9px;
21     display: inline-block;
22     position: absolute;
23     line-height: 1;
24     opacity: 0.8;
25   }
26   &.success {
27     border-left-color: $positive;
28     @include lightDark(background-color, lighten($positive, 68%), darken($positive, 22%));
29     @include lightDark(color, darken($positive, 16%), lighten($positive, 5%));
30   }
31   &.success:before {
32     background-image: url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjQgMjQiIGZpbGw9IiMzNzZjMzkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+ICAgIDxwYXRoIGQ9Ik0wIDBoMjR2MjRIMHoiIGZpbGw9Im5vbmUiLz4gICAgPHBhdGggZD0iTTEyIDJDNi40OCAyIDIgNi40OCAyIDEyczQuNDggMTAgMTAgMTAgMTAtNC40OCAxMC0xMFMxNy41MiAyIDEyIDJ6bS0yIDE1bC01LTUgMS40MS0xLjQxTDEwIDE0LjE3bDcuNTktNy41OUwxOSA4bC05IDl6Ii8+PC9zdmc+");
33   }
34   &.danger {
35     border-left-color: $negative;
36     @include lightDark(background-color, lighten($negative, 56%), darken($negative, 30%));
37     @include lightDark(color, darken($negative, 20%), lighten($negative, 5%));
38   }
39   &.danger:before {
40     background-image: url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjQgMjQiIGZpbGw9IiNiOTE4MTgiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+ICAgIDxwYXRoIGQ9Ik0xNS43MyAzSDguMjdMMyA4LjI3djcuNDZMOC4yNyAyMWg3LjQ2TDIxIDE1LjczVjguMjdMMTUuNzMgM3pNMTIgMTcuM2MtLjcyIDAtMS4zLS41OC0xLjMtMS4zIDAtLjcyLjU4LTEuMyAxLjMtMS4zLjcyIDAgMS4zLjU4IDEuMyAxLjMgMCAuNzItLjU4IDEuMy0xLjMgMS4zem0xLTQuM2gtMlY3aDJ2NnoiLz4gICAgPHBhdGggZD0iTTAgMGgyNHYyNEgweiIgZmlsbD0ibm9uZSIvPjwvc3ZnPg==");
41   }
42   &.info {
43     border-left-color: $info;
44     @include lightDark(color, darken($info, 20%), lighten($info, 10%));
45     @include lightDark(background-color, lighten($info, 50%), darken($info, 35%));
46   }
47   &.warning {
48     border-left-color: $warning;
49     @include lightDark(background-color, lighten($warning, 50%), darken($warning, 36%));
50     @include lightDark(color, darken($warning, 20%), $warning);
51   }
52   &.warning:before {
53     background-image: url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjQgMjQiIGZpbGw9IiNiNjUzMWMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+ICAgIDxwYXRoIGQ9Ik0wIDBoMjR2MjRIMHoiIGZpbGw9Im5vbmUiLz4gICAgPHBhdGggZD0iTTEgMjFoMjJMMTIgMiAxIDIxem0xMi0zaC0ydi0yaDJ2MnptMC00aC0ydi00aDJ2NHoiLz48L3N2Zz4=");
54   }
55   a {
56     color: inherit;
57     text-decoration: underline;
58   }
59 }
60
61 /**
62  * Card-style blocks
63  */
64
65 .card {
66   @include lightDark(background-color, #FFF, #222);
67   box-shadow: $bs-card;
68   border-radius: 3px;
69   .body, p.empty-text {
70     padding: $-m;
71   }
72   a, p {
73     word-wrap: break-word;
74     word-break: break-word;
75   }
76 }
77
78 .card-title {
79   padding: $-m $-m $-xs;
80   margin: 0;
81   font-size: $fs-m;
82   color: #222;
83   fill: #222;
84   font-weight: 400;
85 }
86 .card-title a {
87   line-height: 1;
88 }
89 .card-footer-link, button.card-footer-link  {
90   display: block;
91   padding: $-s $-m;
92   line-height: 1;
93   border-top: 1px solid;
94   width: 100%;
95   text-align: left;
96   @include lightDark(border-color, #DDD, #555);
97   border-radius: 0 0 3px 3px;
98   font-size: 0.9em;
99   margin-top: $-xs;
100   &:hover {
101     text-decoration: none;
102     @include lightDark(background-color, #f2f2f2, #2d2d2d);
103   }
104   &:focus {
105     @include lightDark(background-color, #eee, #222);
106     outline: 1px dotted #666;
107     outline-offset: -2px;
108   }
109 }
110
111 .card.border-card {
112   border: 1px solid;
113   @include lightDark(border-color, #ddd, #000);
114 }
115
116 .card.drag-card {
117   border: 1px solid #DDD;
118   @include lightDark(border-color, #ddd, #000);
119   @include lightDark(background-color, #fff, #333);
120   border-radius: 4px;
121   display: flex;
122   padding: 0 0 0 ($-s + 28px);
123   margin: $-s 0;
124   position: relative;
125   .drag-card-action {
126     cursor: pointer;
127   }
128   .handle, .drag-card-action {
129     display: flex;
130     align-items: center;
131     text-align: center;
132     justify-content: center;
133     width: 28px;
134     flex-grow: 0;
135     padding: 0 $-xs;
136     &:hover {
137       @include lightDark(background-color, #eee, #2d2d2d);
138     }
139     .svg-icon {
140       margin-inline-end: 0px;
141     }
142   }
143   .outline input {
144     margin: $-s 0;
145     width: 100%;
146   }
147   .outline {
148     position: relative;
149   }
150   .handle {
151     @include lightDark(background-color, #eee, #2d2d2d);
152     left: 0;
153     position: absolute;
154     top: 0;
155     bottom: 0;
156   }
157   > div {
158     padding: 0 $-s;
159     max-width: 80%;
160     flex: 1;
161   }
162 }
163
164 .grid-card {
165   display: flex;
166   flex-direction: column;
167   border: 1px solid #ddd;
168   @include lightDark(border-color, #ddd, #000);
169   margin-bottom: $-l;
170   border-radius: 4px;
171   overflow: hidden;
172   min-width: 100px;
173   color: $text-dark;
174   transition: border-color ease-in-out 120ms, box-shadow ease-in-out 120ms;
175   &:hover {
176     color: $text-dark;
177     text-decoration: none;
178     @include lightDark(box-shadow, $bs-card, $bs-card-dark);
179   }
180   h2 {
181     width: 100%;
182     font-size: 1.5em;
183     margin: 0 0 10px;
184   }
185   p {
186     font-size: .7rem;
187     margin: 0;
188     line-height: 1.6em;
189   }
190   .grid-card-content {
191     flex: 1;
192     border-top: 0;
193     border-bottom-width: 2px;
194   }
195   .grid-card-content, .grid-card-footer {
196     padding: $-l;
197   }
198   .grid-card-content + .grid-card-footer {
199     padding-top: 0;
200   }
201 }
202
203 .book-grid-item .grid-card-footer {
204   p.small {
205     font-size: .8em;
206     margin: 0;
207   }
208 }
209
210 .content-wrap.card {
211   padding: $-m $-xxl;
212   margin-inline-start: auto;
213   margin-inline-end: auto;
214   margin-bottom: $-l;
215   overflow: initial;
216   min-height: 60vh;
217   &.auto-height {
218     min-height: 0;
219   }
220   &.fill-width {
221     width: 100%;
222   }
223 }
224 @include smaller-than($xxl) {
225   .content-wrap.card {
226     padding: $-m $-xl;
227   }
228 }
229 @include smaller-than($m) {
230   .content-wrap.card {
231     padding: $-m $-l;
232   }
233 }
234 @include smaller-than($s) {
235   .content-wrap.card {
236     padding: $-m $-m;
237   }
238 }
239
240 .sub-card {
241   box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
242   border: 1.5px solid;
243   @include lightDark(border-color, #E2E2E2, #444);
244   border-radius: 4px;
245 }
246
247 .outline-hover {
248   border: 1px solid transparent !important;
249   &:hover {
250     border: 1px solid rgba(0, 0, 0, 0.1) !important;
251   }
252 }
253
254 .fade-in-when-active {
255   @include lightDark(opacity, 0.6, 0.7);
256   transition: opacity ease-in-out 120ms;
257   &:hover, &:focus-within {
258     opacity: 1 !important;
259   }
260   @media (prefers-contrast: more) {
261     opacity: 1 !important;
262   }
263 }
264
265 /**
266  * Tags
267  */
268 .tag-item {
269   display: inline-flex;
270   margin-bottom: $-xs;
271   margin-inline-end: $-xs;
272   border-radius: 4px;
273   border: 1px solid;
274   overflow: hidden;
275   font-size: 0.85em;
276   @include lightDark(border-color, #CCC, #666);
277   a, span, a:hover, a:active {
278     padding: 4px 8px;
279     @include lightDark(color, rgba(0, 0, 0, 0.7), rgba(255, 255, 255, 0.8));
280     transition: background-color ease-in-out 80ms;
281     text-decoration: none;
282   }
283   a:hover {
284     @include lightDark(background-color, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.3));
285   }
286   svg {
287     @include lightDark(fill, rgba(0, 0, 0, 0.5), rgba(255, 255, 255, 0.5));
288   }
289   .tag-value {
290     border-inline-start: 1px solid;
291     @include lightDark(border-color, #DDD, #666);
292     @include lightDark(background-color, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.2))
293   }
294 }
295
296 .tag-name.highlight, .tag-value.highlight {
297   font-weight: bold;
298 }
299
300 .tag-list div:last-child .tag-item {
301   margin-bottom: 0;
302 }
303
304 .item-list-row .tag-item {
305   margin-bottom: 0;
306 }
307
308 /**
309  * API Docs
310  */
311 .api-method {
312   font-size: 0.75rem;
313   background-color: #888;
314   padding: $-xs;
315   line-height: 1.3;
316   opacity: 0.7;
317   vertical-align: top;
318   border-radius: 3px;
319   color: #FFF;
320   display: inline-block;
321   min-width: 60px;
322   text-align: center;
323   font-weight: bold;
324   &[data-method="GET"] { background-color: #077b70 }
325   &[data-method="POST"] { background-color: #cf4d03 }
326   &[data-method="PUT"] { background-color: #0288D1 }
327   &[data-method="DELETE"] { background-color: #ab0f0e }
328 }
329
330 .sticky-sidebar {
331   position: sticky;
332   top: $-m;
333   max-height: calc(100vh - #{$-m});
334   overflow-y: auto;
335 }