-
Notifications
You must be signed in to change notification settings - Fork 173
/
Copy path_base_typography.scss
153 lines (125 loc) · 3.09 KB
/
_base_typography.scss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
@import 'settings';
@import 'base_fontfaces';
@import 'base_typography-heading-mixins';
// Typographic element styles
@mixin vf-b-typography {
@include vf-b-typography-fontfaces;
// stylelint-disable selector-max-type -- base styles can use type selectors
html {
color: $colors--light-theme--text-default;
font-family: unquote($font-base-family);
// These vendor prefixes are unique and cannot be added by autoprefixer
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
font-weight: $font-weight-regular-text;
// set default line height to match p
line-height: map-get($line-heights, default-text);
text-wrap: pretty;
@if ($increase-font-size-on-larger-screens) {
font-size: map-get($base-font-sizes, base);
@media (min-width: $breakpoint-x-large) {
font-size: map-get($base-font-sizes, large);
//the rem value is not affected by the change in font-size; it needs to be multiplied by the ratio new font-size/default font-size
line-height: map-get($line-heights, default-text) * $font-size-ratio--largescreen;
}
} @else {
font-size: map-get($base-font-sizes, base);
}
}
// headings
h1 {
@extend %vf-heading-1;
}
h2 {
@extend %vf-heading-2;
}
h3 {
@extend %vf-heading-3;
}
h4 {
@extend %vf-heading-4;
}
h5 {
@extend %vf-heading-5;
}
h6 {
@extend %vf-heading-6;
}
p {
@extend %paragraph;
max-width: $text-max-width;
}
.p-text--default {
@extend %default-text;
}
small,
.p-text--small {
@extend %small-text;
&.dense {
margin-bottom: map-get($sp-after, small--dense) + map-get($line-heights, default-text) - map-get($line-heights, small) - map-get($nudges, small);
}
}
.p-text--x-small {
@extend %x-small-text;
}
.p-text--small-caps,
// deprecated: .p-text--x-small-capitalised is deprecated, use .p-text--small-caps instead
.p-text--x-small-capitalised {
@extend %small-caps-text;
font-weight: $font-weight-bold;
}
//@section Adjusted spacing for headings (or a p) following a paragraph
p:not([class*='p-heading--']):not([class*='p-muted-heading']) {
& + h1,
& + .p-heading--1 {
@extend %sp--ph1;
}
& + h2,
& + .p-heading--2 {
@extend %sp--ph2;
}
& + h3,
& + .p-heading--3 {
@extend %sp--ph3;
}
& + h4,
& + .p-heading--4 {
@extend %sp--ph4;
}
& + h5,
& + .p-heading--5,
& + h6,
& + .p-heading--6 {
@extend %sp--ph5;
}
& + .p-muted-heading {
@extend %sp--pmuted;
}
// N.B.: selector order matters here - the epmty selector must come after all other rules affecting paragraphs
&:empty {
line-height: 0;
margin: 0;
padding: 0;
}
}
cite {
@extend %default-text;
}
// misc
b,
strong {
@extend %bold;
}
sub,
sup {
line-height: 0;
position: relative;
vertical-align: baseline;
}
abbr[title] {
border-bottom: 0.1em dotted;
cursor: help;
text-decoration: none;
}
// stylelint-enable selector-max-type
}