Skip to content
This repository was archived by the owner on Mar 7, 2025. It is now read-only.

Commit 45fc090

Browse files
committed
Merge pull request #13 from hotosm/feature/prose-responsive
Feature/prose responsive
2 parents c5a0f28 + 289b001 commit 45fc090

File tree

6 files changed

+128
-30
lines changed

6 files changed

+128
-30
lines changed

assets/styles/oam-design-system/_base.scss

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -68,19 +68,6 @@ a:active {
6868
}
6969

7070

71-
/* Media
72-
========================================================================== */
73-
74-
figure {
75-
padding: 0;
76-
margin: 0 0 1rem 0;
77-
}
78-
79-
img {
80-
vertical-align: middle;
81-
}
82-
83-
8471
/* Rows
8572
========================================================================== */
8673

assets/styles/oam-design-system/_drops.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@
204204
display: block;
205205
padding: 0.25rem 1rem;
206206
color: inherit;
207-
transition: all 0.24s ease 0s;
207+
transition: all 0.16s ease 0s;
208208
&:hover,
209209
&:focus {
210210
color: $link-color;

assets/styles/oam-design-system/_media.scss

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22
Media
33
========================================================================== */
44

5+
6+
figure {
7+
padding: 0;
8+
margin: 0 0 $global-spacing 0;
9+
}
10+
11+
img {
12+
vertical-align: middle;
13+
}
14+
515
.image-fluid {
616
max-width: 100%;
717
height: auto;
@@ -24,7 +34,6 @@
2434
font-size: 0.875rem;
2535
line-height: 1.25rem;
2636
padding-top: 1rem;
27-
max-width: 32rem;
2837
font-weight: $base-font-regular;
2938
}
3039

@@ -38,28 +47,18 @@ figure.align-center {
3847
margin-left: auto;
3948
margin-right: auto;
4049
text-align: center;
41-
42-
figcaption {
43-
margin: 0 auto;
44-
}
4550
}
4651

4752
img.align-left,
4853
figure.align-left {
4954
float: left;
5055
margin-right: $global-spacing * 1.5;
51-
52-
figcaption {
53-
text-align: left;
54-
}
56+
text-align: left;
5557
}
5658

5759
img.align-right,
5860
figure.align-right {
5961
float: right;
6062
margin-left: $global-spacing * 1.5;
61-
62-
figcaption {
63-
text-align: right;
64-
}
63+
text-align: right;
6564
}

assets/styles/oam-design-system/_tables.scss

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,17 @@
6161
}
6262
}
6363

64+
/* Prose specific */
65+
66+
.prose--responsive {
67+
> .table thead th {
68+
@include media(medium-up) {
69+
font-size: 1rem;
70+
line-height: 1.5;
71+
}
72+
}
73+
}
74+
6475

6576
/* Responsive table wrapper
6677
========================================================================== */

assets/styles/oam-design-system/_typography.scss

Lines changed: 103 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,38 @@
22
Typography
33
========================================================================== */
44

5+
6+
/* Prose
7+
========================================================================== */
8+
9+
.prose {
10+
font-size: $base-font-size; // 16px
11+
line-height: $base-line-height; // 24px
12+
13+
> * {
14+
margin-bottom: $base-font-size * $base-line-height; // same as line-height
15+
}
16+
}
17+
18+
.prose--responsive {
19+
$prose-resp-font-size: 1.25rem; // 20px
20+
$prose-resp-line-height: 1.6; // 32px
21+
22+
@include media(medium-up) {
23+
font-size: $prose-resp-font-size;
24+
line-height: $prose-resp-line-height;
25+
26+
> * {
27+
margin-bottom: $prose-resp-font-size * $prose-resp-line-height; // same as line-height
28+
}
29+
}
30+
}
31+
32+
33+
/* Common elements
34+
========================================================================== */
35+
36+
537
p, ul, ol, dl, pre, blockquote {
638
margin: 0 0 $global-spacing 0;
739
}
@@ -16,6 +48,16 @@ p, ul, ol, dl, pre, blockquote {
1648
opacity: 0.64;
1749
}
1850

51+
/* Prose specific */
52+
53+
.prose--responsive {
54+
> .lead {
55+
@include media(medium-up) {
56+
font-size: 1.5rem;
57+
line-height: 1.6666667;
58+
}
59+
}
60+
}
1961

2062
/* Lists
2163
========================================================================== */
@@ -32,7 +74,6 @@ ol {
3274
list-style-type: decimal;
3375
}
3476

35-
3677
dt {
3778
@extend .heading-alt;
3879
font-size: 0.875rem;
@@ -64,6 +105,19 @@ dd {
64105
}
65106
}
66107

108+
/* Prose specific */
109+
110+
.prose--responsive {
111+
> dl dt {
112+
@include media(medium-up) {
113+
padding-top: $global-spacing / 4;
114+
padding-bottom: $global-spacing / 4;
115+
font-size: 1rem;
116+
line-height: 1.5;
117+
}
118+
}
119+
}
120+
67121

68122
/* Blockquote
69123
========================================================================== */
@@ -96,6 +150,24 @@ hr, .hr {
96150
margin: ($global-spacing * 2) auto;
97151
}
98152

153+
/* Prose specific */
154+
155+
.prose {
156+
> hr,
157+
>.hr {
158+
margin: ($global-spacing * 3) auto;
159+
}
160+
}
161+
162+
.prose--responsive {
163+
> hr,
164+
> .hr {
165+
@include media(medium-up) {
166+
margin: ($global-spacing * 4) auto;
167+
}
168+
}
169+
}
170+
99171

100172
/* Emphasis
101173
========================================================================== */
@@ -186,6 +258,35 @@ h4, h5, h6 {
186258
> h4:not(:first-child),
187259
> h5:not(:first-child),
188260
> h6:not(:first-child) {
189-
margin-top: $global-spacing * 2;
261+
margin-top: $global-spacing * 2.5;
262+
}
263+
264+
> h1 + h2:not(:first-child),
265+
> h2 + h3:not(:first-child),
266+
> h3 + h4:not(:first-child),
267+
> h4 + h5:not(:first-child),
268+
> h5 + h6:not(:first-child) {
269+
margin-top: 0;
270+
}
271+
}
272+
273+
.prose--responsive {
274+
> h1 { @include heading(1.75rem, xlarge-up); } // 28, 32, 36, 40
275+
> h2 { @include heading(1.5rem, xlarge-up); } // 24, 28, 32, 36
276+
> h3 { @include heading(1.25rem, xlarge-up); } // 20, 24, 28, 32
277+
> h4,
278+
> h5,
279+
> h6 { @include heading(1rem, xlarge-up); } // 16, 20, 24, 28
280+
281+
282+
@include media(medium-up) {
283+
> h1:not(:first-child),
284+
> h2:not(:first-child),
285+
> h3:not(:first-child),
286+
> h4:not(:first-child),
287+
> h5:not(:first-child),
288+
> h6:not(:first-child) {
289+
margin-top: $global-spacing * 4;
290+
}
190291
}
191292
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "oam-design-system",
3-
"version": "0.1.5-alpha",
3+
"version": "0.1.6-alpha",
44
"description": "OpenAerialMap Design System",
55
"repository": {
66
"type": "git",

0 commit comments

Comments
 (0)