]> BookStack Code Mirror - bookstack/blob - resources/assets/sass/_blocks.scss
switch spaces to tabs
[bookstack] / resources / assets / sass / _blocks.scss
1
2 /*
3 * This file container all block styling including background shading,
4 * margins, paddings & borders.
5 */
6
7
8 /*
9 * Background Shading
10 */
11 .shaded {
12   background-color: #f1f1f1;
13   &.pos {
14     background-color: lighten($positive, 40%);
15   }
16   &.neg {
17     background-color: lighten($negative, 20%);
18   }
19   &.primary {
20     background-color: lighten($primary, 40%);
21   }
22   &.secondary {
23     background-color: lighten($secondary, 30%);
24   }
25 }
26
27 /*
28 * Bordering
29 */
30 .bordered {
31   border: 1px solid #BBB;
32   &.pos {
33     border-color: $positive;
34   }
35   &.neg {
36     border-color: $negative;
37   }
38   &.primary {
39     border-color: $primary;
40   }
41   &.secondary {
42     border-color: $secondary;
43   }
44   &.thick {
45     border-width: 2px;
46   }
47 }
48 .rounded {
49   border-radius: 3px;
50 }
51
52 /*
53 * Padding
54 */
55 .nopadding {
56   padding: 0;
57 }
58 .padded {
59   padding: $-l;
60   &.large {
61     padding: $-xl;
62   }
63   >h1, >h2, >h3, >h4 {
64     &:first-child {
65       margin-top: 0.1em;
66     }
67   }
68 }
69 .padded-vertical, .padded-top {
70   padding-top: $-m;
71   &.large {
72     padding-top: $-xl;
73   }
74 }
75
76 .padded-vertical, .padded-bottom {
77   padding-bottom: $-m;
78   &.large {
79     padding-bottom: $-xl;
80   }
81 }
82 .padded-horizontal, .padded-left {
83   padding-left: $-m;
84   &.large {
85     padding-left: $-xl;
86   }
87 }
88 .padded-horizontal, .padded-right {
89   padding-right: $-m;
90   &.large {
91     padding-right: $-xl;
92   }
93 }
94
95 /*
96 * Margins
97 */
98 .margins {
99   margin: $-l;
100   &.large {
101     margin: $-xl;
102   }
103 }
104 .margins-vertical, .margin-top {
105   margin-top: $-m;
106   &.large {
107     margin-top: $-xl;
108   }
109 }
110 .margins-vertical, .margin-bottom {
111   margin-bottom: $-m;
112   &.large {
113     margin-bottom: $-xl;
114   }
115 }
116 .margins-horizontal, .margin-left {
117   margin-left: $-m;
118   &.large {
119     margin-left: $-xl;
120   }
121 }
122 .margins-horizontal, .margin-right {
123   margin-right: $-m;
124   &.large {
125     margin-right: $-xl;
126   }
127 }
128
129
130 /**
131  * Callouts
132  */
133
134 .callout {
135   border-left: 3px solid #BBB;
136   background-color: #EEE;
137   padding: $-s $-s $-s $-xl;
138   display: block;
139   position: relative;
140   &:before {
141     background-image: url('data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjQgMjQiIGZpbGw9IiMwMTUzODAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+ICAgIDxwYXRoIGQ9Ik0wIDBoMjR2MjRIMHoiIGZpbGw9Im5vbmUiLz4gICAgPHBhdGggZD0iTTEyIDJDNi40OCAyIDIgNi40OCAyIDEyczQuNDggMTAgMTAgMTAgMTAtNC40OCAxMC0xMFMxNy41MiAyIDEyIDJ6bTEgMTVoLTJ2LTZoMnY2em0wLThoLTJWN2gydjJ6Ii8+PC9zdmc+');
142     background-repeat: no-repeat;
143     content: '';
144     width: 1.2em;
145     height: 1.2em;
146     left: $-xs + 1px;
147     top: 50%;
148     margin-top: -9px;
149     display: inline-block;
150     position: absolute;
151     line-height: 1;
152     opacity: 0.8;
153   }
154   &.success {
155     border-left-color: $positive;
156     background-color: lighten($positive, 45%);
157     color: darken($positive, 16%);
158   }
159   &.success:before {
160     background-image: url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjQgMjQiIGZpbGw9IiMzNzZjMzkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+ICAgIDxwYXRoIGQ9Ik0wIDBoMjR2MjRIMHoiIGZpbGw9Im5vbmUiLz4gICAgPHBhdGggZD0iTTEyIDJDNi40OCAyIDIgNi40OCAyIDEyczQuNDggMTAgMTAgMTAgMTAtNC40OCAxMC0xMFMxNy41MiAyIDEyIDJ6bS0yIDE1bC01LTUgMS40MS0xLjQxTDEwIDE0LjE3bDcuNTktNy41OUwxOSA4bC05IDl6Ii8+PC9zdmc+");
161   }
162   &.danger {
163     border-left-color: $negative;
164     background-color: lighten($negative, 34%);
165     color: darken($negative, 20%);
166   }
167   &.danger:before {
168     background-image: url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjQgMjQiIGZpbGw9IiNiOTE4MTgiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+ICAgIDxwYXRoIGQ9Ik0xNS43MyAzSDguMjdMMyA4LjI3djcuNDZMOC4yNyAyMWg3LjQ2TDIxIDE1LjczVjguMjdMMTUuNzMgM3pNMTIgMTcuM2MtLjcyIDAtMS4zLS41OC0xLjMtMS4zIDAtLjcyLjU4LTEuMyAxLjMtMS4zLjcyIDAgMS4zLjU4IDEuMyAxLjMgMCAuNzItLjU4IDEuMy0xLjMgMS4zem0xLTQuM2gtMlY3aDJ2NnoiLz4gICAgPHBhdGggZD0iTTAgMGgyNHYyNEgweiIgZmlsbD0ibm9uZSIvPjwvc3ZnPg==");
169   }
170   &.info {
171     border-left-color: $info;
172     background-color: lighten($info, 50%);
173     color: darken($info, 16%);
174   }
175   &.warning {
176     border-left-color: $warning;
177     background-color: lighten($warning, 36%);
178     color: darken($warning, 16%);
179   }
180   &.warning:before {
181     background-image: url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjQgMjQiIGZpbGw9IiNiNjUzMWMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+ICAgIDxwYXRoIGQ9Ik0wIDBoMjR2MjRIMHoiIGZpbGw9Im5vbmUiLz4gICAgPHBhdGggZD0iTTEgMjFoMjJMMTIgMiAxIDIxem0xMi0zaC0ydi0yaDJ2MnptMC00aC0ydi00aDJ2NHoiLz48L3N2Zz4=");
182   }
183 }
184
185 .card {
186   margin: $-m;
187   background-color: #FFF;
188   box-shadow: 0 0 1px 0 rgba(0, 0, 0, 0.2);
189   h3 {
190     padding: $-m;
191     border-bottom: 1px solid #E8E8E8;
192     margin: 0;
193     font-size: $fs-s;
194     color: #888;
195     fill: #888;
196     font-weight: 400;
197     text-transform: uppercase;
198   }
199   h3 a {
200     line-height: 1;
201   }
202   .body, p.empty-text {
203     padding: $-m;
204   }
205   a, p {
206     word-wrap: break-word;
207     word-break: break-word;
208   }
209 }
210
211 .sidebar .card {
212   h3, .body, .empty-text {
213     padding: $-s $-m;
214   }
215 }
216
217 .card.drag-card {
218   border: 1px solid #DDD;
219   border-radius: 4px;
220   display: flex;
221   padding: 0;
222   padding-left: $-s + 28px;
223   margin: $-s 0;
224   position: relative;
225   .drag-card-action {
226     cursor: pointer;
227   }
228   .handle, .drag-card-action {
229     display: flex;
230     padding: 0;
231     align-items: center;
232     text-align: center;
233     justify-content: center;
234     width: 28px;
235     flex-grow: 0;
236     padding-left: $-xs;
237     padding-right: $-xs;
238     &:hover {
239       background-color: #EEE;
240     }
241     .svg-icon {
242       margin-right: 0px;
243     }
244   }
245   > div .outline input {
246     margin: $-s 0;
247     width: 100%;
248   }
249   > div.padded {
250     padding: $-s 0 !important;
251   }
252   .handle {
253     background-color: #EEE;
254     left: 0;
255     position: absolute;
256     top: 0;
257     bottom: 0;
258   }
259   > div {
260     padding: 0 $-s;
261     max-width: 80%;
262     flex: 1;
263   }
264 }
265
266 .well {
267   background-color: #F8F8F8;
268   padding: $-m;
269   border: 1px solid #DDD;
270 }
271
272 .tag-item {
273   display: inline-flex;
274   margin-bottom: $-xs;
275   margin-right: $-xs;
276   border-radius: 4px;
277   border: 1px solid #CCC;
278   overflow: hidden;
279   font-size: 0.85em;
280   a, a:hover, a:active {
281     padding: 4px 8px;
282     color: #777;
283     transition: background-color ease-in-out 80ms;
284     text-decoration: none;
285   }
286   a:hover {
287     background-color: rgba(255, 255, 255, 0.7);
288   }
289   svg {
290     fill: #888;
291   }
292   .tag-value {
293     border-left: 1px solid #DDD;
294     background-color: rgba(255, 255, 255, 0.5);
295   }
296 }
297
298 .tag-list div:last-child .tag-item {
299   margin-bottom: 0;
300 }