Skip to content

Commit e4f2063

Browse files
authored
Merge pull request #52 from couchbase/ui-spacing-fixes
fix vertical spaces and align issues
2 parents feb1ce5 + 71e6ce7 commit e4f2063

File tree

7 files changed

+255
-19
lines changed

7 files changed

+255
-19
lines changed

src/css/base.css

Lines changed: 207 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,11 +198,217 @@ label::after {
198198
outline-width: 0;
199199
}
200200

201+
/* Common margin padding css class */
202+
/* margin-top */
203+
.mt-0 {
204+
margin-top: 0 !important;
205+
}
206+
207+
.mt-1 {
208+
margin-top: var(--base-extra-small-space) !important; /* 8px */
209+
}
210+
211+
.mt-2 {
212+
margin-top: var(--base-small-space) !important; /* 12px */
213+
}
214+
215+
.mt-3 {
216+
margin-top: var(--base-space) !important; /* 16px */
217+
}
218+
219+
.mt-4 {
220+
margin-top: var(--base-medium-space) !important; /* 24px */
221+
}
222+
223+
.mt-5 {
224+
margin-top: var(--base-large-space) !important; /* 32px */
225+
}
226+
227+
/* margin-bottom */
228+
.mb-0 {
229+
margin-bottom: 0 !important;
230+
}
231+
232+
.mb-1 {
233+
margin-bottom: var(--base-extra-small-space) !important; /* 8px */
234+
}
235+
236+
.mb-2 {
237+
margin-bottom: var(--base-small-space) !important; /* 12px */
238+
}
239+
240+
.mb-3 {
241+
margin-bottom: var(--base-space) !important; /* 16px */
242+
}
243+
244+
.mb-4 {
245+
margin-bottom: var(--base-medium-space) !important; /* 24px */
246+
}
247+
248+
.mb-5 {
249+
margin-bottom: var(--base-large-space) !important; /* 32px */
250+
}
251+
201252
/* Responsive css */
202-
@media screen and (min-width: 1024px) {
253+
/* For tablet,ipad Portrait view mode 1024px screen */
254+
@media screen and (min-width: 740px) {
255+
/* Spacing media query */
256+
.mt-sm-0 {
257+
margin-top: 0 !important;
258+
}
259+
260+
.mt-sm-1 {
261+
margin-top: var(--base-extra-small-space) !important; /* 8px */
262+
}
263+
264+
.mt-sm-2 {
265+
margin-top: var(--base-small-space) !important; /* 12px */
266+
}
267+
268+
.mt-sm-3 {
269+
margin-top: var(--base-space) !important; /* 16px */
270+
}
271+
272+
.mt-sm-4 {
273+
margin-top: var(--base-medium-space) !important; /* 24px */
274+
}
275+
276+
.mt-sm-5 {
277+
margin-top: var(--base-large-space) !important; /* 32px */
278+
}
279+
280+
/* margin-bottom */
281+
.mb-sm-0 {
282+
margin-bottom: 0 !important;
283+
}
284+
285+
.mb-sm-1 {
286+
margin-bottom: var(--base-extra-small-space) !important; /* 8px */
287+
}
288+
289+
.mb-sm-2 {
290+
margin-bottom: var(--base-small-space) !important; /* 12px */
291+
}
292+
293+
.mb-sm-3 {
294+
margin-bottom: var(--base-space) !important; /* 16px */
295+
}
296+
297+
.mb-sm-4 {
298+
margin-bottom: var(--base-medium-space) !important; /* 24px */
299+
}
300+
301+
.mb-sm-5 {
302+
margin-bottom: var(--base-large-space) !important; /* 32px */
303+
}
304+
}
305+
/* For tablet,ipad landscape mode 1024px screen */
306+
@media screen and (min-width: 993px) {
203307
.container-fluid {
204308
max-width: var(--width-container-fluid);
205309
padding: 0;
206310
margin: 0 auto;
207311
}
312+
313+
/* Spacing media query */
314+
.mt-md-0 {
315+
margin-top: 0 !important;
316+
}
317+
318+
.mt-md-1 {
319+
margin-top: var(--base-extra-small-space) !important; /* 8px */
320+
}
321+
322+
.mt-md-2 {
323+
margin-top: var(--base-small-space) !important; /* 12px */
324+
}
325+
326+
.mt-md-3 {
327+
margin-top: var(--base-space) !important; /* 16px */
328+
}
329+
330+
.mt-md-4 {
331+
margin-top: var(--base-medium-space) !important; /* 24px */
332+
}
333+
334+
.mt-md-5 {
335+
margin-top: var(--base-large-space) !important; /* 32px */
336+
}
337+
338+
/* margin-bottom */
339+
.mb-md-0 {
340+
margin-bottom: 0 !important;
341+
}
342+
343+
.mb-md-1 {
344+
margin-bottom: var(--base-extra-small-space) !important; /* 8px */
345+
}
346+
347+
.mb-md-2 {
348+
margin-bottom: var(--base-small-space) !important; /* 12px */
349+
}
350+
351+
.mb-md-3 {
352+
margin-bottom: var(--base-space) !important; /* 16px */
353+
}
354+
355+
.mb-md-4 {
356+
margin-bottom: var(--base-medium-space) !important; /* 24px */
357+
}
358+
359+
.mb-md-5 {
360+
margin-bottom: var(--base-large-space) !important; /* 32px */
361+
}
362+
}
363+
/* For large desktop to small desktop screen */
364+
@media screen and (min-width: 1200px) {
365+
/* Spacing media query */
366+
.mt-lg-0 {
367+
margin-top: 0 !important;
368+
}
369+
370+
.mt-lg-1 {
371+
margin-top: var(--base-extra-small-space) !important; /* 8px */
372+
}
373+
374+
.mt-lg-2 {
375+
margin-top: var(--base-small-space) !important; /* 12px */
376+
}
377+
378+
.mt-lg-3 {
379+
margin-top: var(--base-space) !important; /* 16px */
380+
}
381+
382+
.mt-lg-4 {
383+
margin-top: var(--base-medium-space) !important; /* 24px */
384+
}
385+
386+
.mt-lg-5 {
387+
margin-top: var(--base-large-space) !important; /* 32px */
388+
}
389+
390+
/* margin-bottom */
391+
.mb-lg-0 {
392+
margin-bottom: 0 !important;
393+
}
394+
395+
.mb-lg-1 {
396+
margin-bottom: var(--base-extra-small-space) !important; /* 8px */
397+
}
398+
399+
.mb-lg-2 {
400+
margin-bottom: var(--base-small-space) !important; /* 12px */
401+
}
402+
403+
.mb-lg-3 {
404+
margin-bottom: var(--base-space) !important; /* 16px */
405+
}
406+
407+
.mb-lg-4 {
408+
margin-bottom: var(--base-medium-space) !important; /* 24px */
409+
}
410+
411+
.mb-lg-5 {
412+
margin-bottom: var(--base-large-space) !important; /* 32px */
413+
}
208414
}

src/css/doc.css

Lines changed: 40 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
font-weight: var(--weight-semibold);
1616
letter-spacing: -0.025rem;
1717
line-height: var(--line-height-heading);
18-
margin: 1.5rem 0 1rem;
18+
margin-bottom: 0;
1919
}
2020

2121
.doc h1 {
@@ -45,8 +45,9 @@
4545

4646
.doc h2 {
4747
font-size: var(--heading-h2);
48-
max-width: fit-content;
48+
/* max-width: fit-content; */
4949
width: 100%;
50+
margin-top: var(--base-extra-large-space);
5051
/* NOTE used to restrict width of key line */
5152
}
5253

@@ -61,14 +62,17 @@
6162

6263
.doc h3 {
6364
font-size: var(--heading-h3);
65+
margin-top: var(--base-extra-large-space);
6466
}
6567

6668
.doc h4 {
6769
font-size: var(--heading-h4);
70+
margin-top: var(--base-extra-large-space);
6871
}
6972

7073
.doc h5 {
7174
font-size: var(--heading-h5);
75+
margin-top: var(--base-extra-large-space);
7276
}
7377

7478
.doc h1 > a.anchor,
@@ -126,10 +130,20 @@
126130
word-spacing: inherit;
127131
}
128132

129-
.doc .paragraph,
133+
.doc .paragraph {
134+
margin-top: var(--base-space);
135+
}
136+
137+
.doc .paragraph + .paragraph {
138+
margin-top: var(--base-medium-space);
139+
}
140+
141+
.doc .admonitionblock {
142+
margin-top: var(--base-large-space);
143+
}
144+
130145
.doc .olist,
131146
.doc .ulist,
132-
.doc .admonitionblock,
133147
.doc .exampleblock,
134148
.doc .imageblock,
135149
.doc .listingblock,
@@ -138,7 +152,7 @@
138152
.doc .swagger-container,
139153
.doc .verseblock,
140154
.doc .videoblock {
141-
margin-top: 1rem;
155+
margin-top: var(--base-medium-space);
142156
}
143157

144158
.doc .paragraph .title,
@@ -149,11 +163,11 @@
149163
.doc .literalblock .title,
150164
.doc .openblock .title,
151165
.doc caption {
152-
font-size: 1rem;
166+
font-size: var(--font-base);
153167
font-weight: var(--weight-semibold);
154168
/* letter-spacing: -0.025em; */
155169
line-height: 1.2;
156-
margin-bottom: 0.75rem;
170+
margin-bottom: var(--base-space);
157171
color: var(--color-brand-gray3);
158172
}
159173

@@ -430,14 +444,22 @@ ul ul ul {
430444
width: auto;
431445
}
432446

447+
.doc .quoteblock {
448+
margin-top: var(--base-medium-space);
449+
}
450+
433451
.doc .abstract blockquote {
434452
font-size: 0.9375rem;
435-
margin: 1rem 0 1.5625rem 0;
453+
margin: 0;
436454
font-weight: var(--weight-light);
437455
border-left: 2px solid var(--color-brand-gray5);
438456
padding-left: 1.125rem;
439457
}
440458

459+
.doc .quoteblock + .paragraph {
460+
margin-top: var(--base-extra-large-space);
461+
}
462+
441463
.doc .abstract blockquote * {
442464
font-weight: inherit;
443465
}
@@ -599,32 +621,36 @@ table.tableblock pre code.language-bash.hljs {
599621
}
600622

601623
.doc .dlist {
602-
margin: 1.5rem 0;
624+
margin: 1.5rem 0 0;
603625
}
604626

605627
.doc .dlist dl {
606628
margin: 0;
607629
}
608630

609631
.doc .dlist dt {
610-
font-weight: var(--weight-medium);
632+
font-weight: var(--weight-semibold);
611633
}
612634

613635
.doc .dlist dd + dt {
614636
margin-top: 1.5rem;
615637
}
616638

639+
.doc .dlist dt + dt {
640+
margin-top: var(--base-extra-small-space);
641+
}
642+
617643
.doc .dlist dd {
618644
margin-left: 1.5rem;
619645
}
620646

621647
.doc .dlist dt + dd {
622-
margin-top: 0.125rem;
648+
margin-top: var(--base-small-space);
623649
}
624650

625-
.doc .dlist dd > .openblock > .content > :first-child {
651+
/* .doc .dlist dd > .openblock > .content > :first-child {
626652
margin-top: 0;
627-
}
653+
} */
628654

629655
.doc .sidebarblock > .content {
630656
border: 1px solid var(--color-border);
@@ -778,7 +804,7 @@ table.tableblock pre code.language-bash.hljs {
778804
padding: var(--base-space);
779805
border-radius: 8px;
780806
border: 1px solid var(--color-brand-gray8);
781-
margin-top: var(--base-space);
807+
margin-top: var(--base-extra-large-space);
782808
}
783809

784810
.doc .tabs.ulist {

src/css/header.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
.header-bottom-row {
5050
background: var(--color-brand-blue-secondary);
5151
display: none;
52+
transition: all 0.3s;
5253
}
5354

5455
.navbar-new-bottom .nav-item {
@@ -300,7 +301,7 @@
300301
color: var(--color-brand-blue);
301302
}
302303

303-
.navbar-new-bottom.is-active {
304+
.header-bottom-row.is-active {
304305
display: block;
305306
position: absolute;
306307
width: 100%;

0 commit comments

Comments
 (0)