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