]> BookStack Code Mirror - bookstack/blob - resources/sass/_blocks.scss
Fixed failing test after drawio default url change
[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   border: 1px solid transparent;
70   .body, p.empty-text {
71     padding: $-m;
72   }
73   a, p {
74     word-wrap: break-word;
75     word-break: break-word;
76   }
77 }
78
79 .card-title {
80   padding: $-m $-m $-xs;
81   margin: 0;
82   font-size: $fs-m;
83   color: #222;
84   fill: #222;
85   font-weight: 400;
86 }
87 .card-title a {
88   line-height: 1;
89 }
90 .card-footer-link {
91   display: block;
92   padding: $-s $-m;
93   line-height: 1;
94   border-top: 1px solid;
95   @include lightDark(border-color, #DDD, #555);
96   border-radius: 0 0 3px 3px;
97   font-size: 0.9em;
98   margin-top: $-xs;
99   &:hover {
100     text-decoration: none;
101     @include lightDark(background-color, #f2f2f2, #2d2d2d);
102   }
103 }
104
105 .card.border-card {
106   border: 1px solid #DDD;
107 }
108
109 .card.drag-card {
110   border: 1px solid #DDD;
111   @include lightDark(border-color, #ddd, #000);
112   @include lightDark(background-color, #fff, #333);
113   border-radius: 4px;
114   display: flex;
115   padding: 0 0 0 ($-s + 28px);
116   margin: $-s 0;
117   position: relative;
118   .drag-card-action {
119     cursor: pointer;
120   }
121   .handle, .drag-card-action {
122     display: flex;
123     align-items: center;
124     text-align: center;
125     justify-content: center;
126     width: 28px;
127     flex-grow: 0;
128     padding: 0 $-xs;
129     &:hover {
130       background-color: #EEE;
131     }
132     .svg-icon {
133       margin-inline-end: 0px;
134     }
135   }
136   .outline input {
137     margin: $-s 0;
138     width: 100%;
139   }
140   .outline {
141     position: relative;
142   }
143   .handle {
144     @include lightDark(background-color, #eee, #2d2d2d);
145     left: 0;
146     position: absolute;
147     top: 0;
148     bottom: 0;
149   }
150   > div {
151     padding: 0 $-s;
152     max-width: 80%;
153     flex: 1;
154   }
155 }
156
157 .grid-card {
158   display: flex;
159   flex-direction: column;
160   border: 1px solid #ddd;
161   @include lightDark(border-color, #ddd, #000);
162   margin-bottom: $-l;
163   border-radius: 4px;
164   overflow: hidden;
165   min-width: 100px;
166   color: $text-dark;
167   transition: border-color ease-in-out 120ms, box-shadow ease-in-out 120ms;
168   &:hover {
169     color: $text-dark;
170     text-decoration: none;
171     @include lightDark(box-shadow, $bs-card, $bs-card-dark);
172   }
173   h2 {
174     width: 100%;
175     font-size: 1.5em;
176     margin: 0 0 10px;
177   }
178   p {
179     font-size: .7rem;
180     margin: 0;
181     line-height: 1.6em;
182   }
183   .grid-card-content {
184     flex: 1;
185     border-top: 0;
186     border-bottom-width: 2px;
187   }
188   .grid-card-content, .grid-card-footer {
189     padding: $-l;
190   }
191   .grid-card-content + .grid-card-footer {
192     padding-top: 0;
193   }
194 }
195
196 .book-grid-item .grid-card-footer {
197   p.small {
198     font-size: .8em;
199     margin: 0;
200   }
201 }
202
203 .content-wrap.card {
204   padding: $-m $-xxl;
205   margin-inline-start: auto;
206   margin-inline-end: auto;
207   margin-bottom: $-l;
208   overflow: initial;
209   min-height: 60vh;
210   &.auto-height {
211     min-height: 0;
212   }
213   &.fill-width {
214     width: 100%;
215   }
216 }
217 @include smaller-than($xxl) {
218   .content-wrap.card {
219     padding: $-m $-xl;
220   }
221 }
222 @include smaller-than($m) {
223   .content-wrap.card {
224     padding: $-m $-l;
225   }
226 }
227 @include smaller-than($s) {
228   .content-wrap.card {
229     padding: $-m $-m;
230   }
231 }
232
233 .outline-hover {
234   border: 1px solid transparent !important;
235   &:hover {
236     border: 1px solid rgba(0, 0, 0, 0.1) !important;
237   }
238 }
239
240 .fade-in-when-active {
241   @include lightDark(opacity, 0.6, 0.7);
242   transition: opacity ease-in-out 120ms;
243   &:hover, &:focus-within {
244     opacity: 1 !important;
245   }
246   @media (prefers-contrast: more) {
247     opacity: 1 !important;
248   }
249 }
250
251 /**
252  * Tags
253  */
254 .tag-item {
255   display: inline-flex;
256   margin-bottom: $-xs;
257   margin-inline-end: $-xs;
258   border-radius: 4px;
259   border: 1px solid;
260   overflow: hidden;
261   font-size: 0.85em;
262   @include lightDark(border-color, #CCC, #666);
263   a, span, a:hover, a:active {
264     padding: 4px 8px;
265     @include lightDark(color, rgba(0, 0, 0, 0.7), rgba(255, 255, 255, 0.8));
266     transition: background-color ease-in-out 80ms;
267     text-decoration: none;
268   }
269   a:hover {
270     @include lightDark(background-color, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.3));
271   }
272   svg {
273     @include lightDark(fill, rgba(0, 0, 0, 0.5), rgba(255, 255, 255, 0.5));
274   }
275   .tag-value {
276     border-inline-start: 1px solid;
277     @include lightDark(border-color, #DDD, #666);
278     @include lightDark(background-color, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.2))
279   }
280 }
281
282 .tag-name.highlight, .tag-value.highlight {
283   font-weight: bold;
284 }
285
286 .tag-list div:last-child .tag-item {
287   margin-bottom: 0;
288 }
289
290 td .tag-item {
291   margin-bottom: 0;
292 }
293
294 /**
295  * Pill boxes
296  */
297
298 .pill {
299   display: inline-block;
300   border: 1px solid currentColor;
301   padding: .2em .8em;
302   font-size: 0.8em;
303   border-radius: 1rem;
304   position: relative;
305   overflow: hidden;
306   line-height: 1.4;
307   &:before {
308     content: '';
309     background-color: currentColor;
310     position: absolute;
311     top: 0;
312     left: 0;
313     width: 100%;
314     height: 100%;
315     opacity: 0.1;
316   }
317 }
318
319 /**
320  * API Docs
321  */
322 .api-method {
323   font-size: 0.75rem;
324   background-color: #888;
325   padding: $-xs;
326   line-height: 1.3;
327   opacity: 0.7;
328   vertical-align: top;
329   border-radius: 3px;
330   color: #FFF;
331   display: inline-block;
332   min-width: 60px;
333   text-align: center;
334   font-weight: bold;
335   &[data-method="GET"] { background-color: #077b70 }
336   &[data-method="POST"] { background-color: #cf4d03 }
337   &[data-method="PUT"] { background-color: #0288D1 }
338   &[data-method="DELETE"] { background-color: #ab0f0e }
339 }
340
341 .sticky-sidebar {
342   position: sticky;
343   top: $-m;
344   max-height: calc(100vh - #{$-m});
345   overflow-y: auto;
346 }