govuk_tech_docs 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.editorconfig +29 -0
- data/.gitignore +34 -0
- data/.rspec +2 -0
- data/.travis.yml +5 -0
- data/CHANGELOG.md +36 -0
- data/Gemfile +4 -0
- data/LICENSE +21 -0
- data/README.md +47 -0
- data/Rakefile +9 -0
- data/example/.ruby-version +1 -0
- data/example/Gemfile +3 -0
- data/example/config.rb +3 -0
- data/example/config/tech-docs.yml +23 -0
- data/example/source/index.html.md.erb +17 -0
- data/example/source/javascripts/application.js +1 -0
- data/example/source/stylesheets/print.css.scss +3 -0
- data/example/source/stylesheets/screen-old-ie.css.scss +4 -0
- data/example/source/stylesheets/screen.css.scss +1 -0
- data/govuk_tech_docs.gemspec +38 -0
- data/lib/assets/javascripts/_analytics.js +31 -0
- data/lib/assets/javascripts/_govuk/modules.js +57 -0
- data/lib/assets/javascripts/_modules/anchored-headings.js +18 -0
- data/lib/assets/javascripts/_modules/in-page-navigation.js +124 -0
- data/lib/assets/javascripts/_modules/navigation.js +34 -0
- data/lib/assets/javascripts/_modules/table-of-contents.js +103 -0
- data/lib/assets/javascripts/_start-modules.js +9 -0
- data/lib/assets/javascripts/_vendor/fixedsticky.js +194 -0
- data/lib/assets/javascripts/_vendor/jquery.js +5 -0
- data/lib/assets/javascripts/_vendor/lodash.js +613 -0
- data/lib/assets/javascripts/_vendor/modernizr.js +3 -0
- data/lib/assets/javascripts/govuk_tech_docs.js +10 -0
- data/lib/assets/stylesheets/_accessibility.scss +9 -0
- data/lib/assets/stylesheets/_core.scss +62 -0
- data/lib/assets/stylesheets/_fonts.scss +29 -0
- data/lib/assets/stylesheets/_govuk_tech_docs.scss +2 -0
- data/lib/assets/stylesheets/_syntax-highlighting.scss +196 -0
- data/lib/assets/stylesheets/govuk_frontend_toolkit/_colours.scss +2 -0
- data/lib/assets/stylesheets/govuk_frontend_toolkit/_conditionals.scss +81 -0
- data/lib/assets/stylesheets/govuk_frontend_toolkit/_css3.scss +90 -0
- data/lib/assets/stylesheets/govuk_frontend_toolkit/_device-pixels.scss +10 -0
- data/lib/assets/stylesheets/govuk_frontend_toolkit/_font_stack.scss +19 -0
- data/lib/assets/stylesheets/govuk_frontend_toolkit/_grid_layout.scss +136 -0
- data/lib/assets/stylesheets/govuk_frontend_toolkit/_helpers.scss +16 -0
- data/lib/assets/stylesheets/govuk_frontend_toolkit/_measurements.scss +14 -0
- data/lib/assets/stylesheets/govuk_frontend_toolkit/_shims.scss +55 -0
- data/lib/assets/stylesheets/govuk_frontend_toolkit/_typography.scss +249 -0
- data/lib/assets/stylesheets/govuk_frontend_toolkit/_url-helpers.scss +16 -0
- data/lib/assets/stylesheets/govuk_frontend_toolkit/colours/_organisation.scss +103 -0
- data/lib/assets/stylesheets/govuk_frontend_toolkit/colours/_palette.scss +77 -0
- data/lib/assets/stylesheets/govuk_frontend_toolkit/design-patterns/_alpha-beta.scss +66 -0
- data/lib/assets/stylesheets/govuk_frontend_toolkit/design-patterns/_breadcrumbs.scss +53 -0
- data/lib/assets/stylesheets/govuk_frontend_toolkit/design-patterns/_buttons.scss +141 -0
- data/lib/assets/stylesheets/govuk_frontend_toolkit/design-patterns/_media-player.scss +242 -0
- data/lib/assets/stylesheets/modules/_anchored-heading.scss +54 -0
- data/lib/assets/stylesheets/modules/_app-pane.scss +64 -0
- data/lib/assets/stylesheets/modules/_footer.scss +130 -0
- data/lib/assets/stylesheets/modules/_govuk-logo.scss +47 -0
- data/lib/assets/stylesheets/modules/_header.scss +289 -0
- data/lib/assets/stylesheets/modules/_phase-banner.scss +22 -0
- data/lib/assets/stylesheets/modules/_skip-link.scss +31 -0
- data/lib/assets/stylesheets/modules/_technical-documentation.scss +236 -0
- data/lib/assets/stylesheets/modules/_toc.scss +221 -0
- data/lib/assets/stylesheets/palette/_syntax-highlighting.scss +23 -0
- data/lib/assets/stylesheets/utilities/_fonts.scss +29 -0
- data/lib/assets/stylesheets/utilities/_printable.scss +13 -0
- data/lib/assets/stylesheets/vendor/_fixedsticky.scss +22 -0
- data/lib/govuk_tech_docs.rb +54 -0
- data/lib/govuk_tech_docs/table_of_contents/heading.rb +29 -0
- data/lib/govuk_tech_docs/table_of_contents/heading_tree.rb +27 -0
- data/lib/govuk_tech_docs/table_of_contents/heading_tree_builder.rb +41 -0
- data/lib/govuk_tech_docs/table_of_contents/heading_tree_renderer.rb +46 -0
- data/lib/govuk_tech_docs/table_of_contents/headings_builder.rb +37 -0
- data/lib/govuk_tech_docs/table_of_contents/helpers.rb +20 -0
- data/lib/govuk_tech_docs/tech_docs_html_renderer.rb +24 -0
- data/lib/govuk_tech_docs/unique_identifier_extension.rb +13 -0
- data/lib/govuk_tech_docs/unique_identifier_generator.rb +72 -0
- data/lib/govuk_tech_docs/version.rb +3 -0
- data/lib/source/favicon.ico +0 -0
- data/lib/source/images/anchored-heading-icon-2x.png +0 -0
- data/lib/source/images/anchored-heading-icon.png +0 -0
- data/lib/source/images/gov.uk_logotype_crown-2x.png +0 -0
- data/lib/source/images/gov.uk_logotype_crown.png +0 -0
- data/lib/source/images/gov.uk_logotype_crown_invert_trans.png +0 -0
- data/lib/source/images/govuk-crest-2x.png +0 -0
- data/lib/source/images/govuk-crest.png +0 -0
- data/lib/source/images/govuk-icn-close.png +0 -0
- data/lib/source/images/govuk-icn-close@2x.png +0 -0
- data/lib/source/images/govuk-icn-numbered-list.png +0 -0
- data/lib/source/images/govuk-icn-numbered-list@2x.png +0 -0
- data/lib/source/images/open-government-licence.png +0 -0
- data/lib/source/images/open-government-licence_2x.png +0 -0
- data/lib/source/layouts/_analytics.erb +14 -0
- data/lib/source/layouts/_footer.erb +10 -0
- data/lib/source/layouts/_header.erb +46 -0
- data/lib/source/layouts/core.erb +59 -0
- data/lib/source/layouts/layout.erb +16 -0
- metadata +323 -0
@@ -0,0 +1,47 @@
|
|
1
|
+
/**
|
2
|
+
* GOV.UK Logo Component
|
3
|
+
*
|
4
|
+
* Based on the existing GOV.UK logo from the header in GOV.UK Template.
|
5
|
+
*
|
6
|
+
* Notes:
|
7
|
+
*
|
8
|
+
* - The printable-crown element is an image that is included when the page is
|
9
|
+
* printed. It's hidden for the screen media type, where the background image
|
10
|
+
* is used instead.
|
11
|
+
*
|
12
|
+
* Example Usage:
|
13
|
+
*
|
14
|
+
* <span class="govuk-logo">
|
15
|
+
* <img class="govuk-logo__printable-crown" src="/images/gov.uk_logotype_crown_invert_trans.png" height="32" width="36">
|
16
|
+
* GOV.UK
|
17
|
+
* </span>
|
18
|
+
*/
|
19
|
+
|
20
|
+
.govuk-logo {
|
21
|
+
font-weight: bold;
|
22
|
+
display: inline-block;
|
23
|
+
|
24
|
+
@include screen {
|
25
|
+
background-image: file-url('/images/gov.uk_logotype_crown.png');
|
26
|
+
background-repeat: no-repeat;
|
27
|
+
|
28
|
+
@include device-pixel-ratio {
|
29
|
+
background-image: file-url('/images/gov.uk_logotype_crown-2x.png');
|
30
|
+
background-size: 36px 32px;
|
31
|
+
}
|
32
|
+
|
33
|
+
@include media(tablet) {
|
34
|
+
margin-right: 8px;
|
35
|
+
background-position: 0 1px;
|
36
|
+
}
|
37
|
+
}
|
38
|
+
}
|
39
|
+
|
40
|
+
.govuk-logo__printable-crown {
|
41
|
+
vertical-align: middle;
|
42
|
+
margin-right: 1px;
|
43
|
+
|
44
|
+
@include screen {
|
45
|
+
visibility: hidden;
|
46
|
+
}
|
47
|
+
}
|
@@ -0,0 +1,289 @@
|
|
1
|
+
/**
|
2
|
+
* Header Component
|
3
|
+
*
|
4
|
+
* Based on the existing GOV.UK header in GOV.UK Template, with an 'inline'
|
5
|
+
* product name and hopefully improved mobile behaviour
|
6
|
+
*
|
7
|
+
* Notes:
|
8
|
+
*
|
9
|
+
* - Make sure you include header.js in your application. This will update
|
10
|
+
* the aria-expanded and aria-hidden attributes on the toggle and the nav
|
11
|
+
* respectively so that screen readers know what's happening.
|
12
|
+
* - Link the current page to the same place as your skip link (e.g. #main) –
|
13
|
+
* this means that it is included by screen readers but is referred to as a
|
14
|
+
* 'same page' link, and clicking it does not reload the page.
|
15
|
+
*
|
16
|
+
* Example Usage:
|
17
|
+
*
|
18
|
+
* <header class="header">
|
19
|
+
* <div class="header__container">
|
20
|
+
* <div class="header__brand">
|
21
|
+
* <a href="/">
|
22
|
+
* <span class="header__title">My Product Page</span>
|
23
|
+
* </a>
|
24
|
+
* </div>
|
25
|
+
*
|
26
|
+
* <div data-module="navigation">
|
27
|
+
* <button type="button" class="header__navigation-toggle js-nav-toggle" aria-controls="navigation" aria-label="Show or hide top level navigation">
|
28
|
+
* Menu
|
29
|
+
* </button>
|
30
|
+
*
|
31
|
+
* <nav id="navigation" class="header__navigation" aria-label="Top Level Navigation" aria-hidden="true">
|
32
|
+
* <ul>
|
33
|
+
* <li class="active"><a href="#main">Active Page</a></li>
|
34
|
+
* <li><a href="/other.html">Other Page</a></li>
|
35
|
+
* </ul>
|
36
|
+
* </nav>
|
37
|
+
* </div>
|
38
|
+
* </div>
|
39
|
+
* </header>
|
40
|
+
*/
|
41
|
+
|
42
|
+
$active-nav-color: #1d8feb;
|
43
|
+
|
44
|
+
.header {
|
45
|
+
@extend %contain-floats;
|
46
|
+
|
47
|
+
@include screen {
|
48
|
+
background: $black;
|
49
|
+
color: $white;
|
50
|
+
border-bottom: 10px solid $white;
|
51
|
+
}
|
52
|
+
}
|
53
|
+
|
54
|
+
.header__container {
|
55
|
+
@extend %site-width-container;
|
56
|
+
@extend %contain-floats;
|
57
|
+
zoom: 1;
|
58
|
+
|
59
|
+
padding: 9px 0 6px;
|
60
|
+
|
61
|
+
@include screen {
|
62
|
+
border-bottom: 10px solid $mainstream-brand;
|
63
|
+
margin-bottom: -10px;
|
64
|
+
}
|
65
|
+
}
|
66
|
+
|
67
|
+
.header.header--full-width {
|
68
|
+
margin-bottom: 0;
|
69
|
+
|
70
|
+
@include screen {
|
71
|
+
border-bottom: 10px solid $mainstream-brand;
|
72
|
+
}
|
73
|
+
|
74
|
+
.header__container {
|
75
|
+
border-bottom: none;
|
76
|
+
width: auto;
|
77
|
+
max-width: none;
|
78
|
+
margin: 0 $gutter-half;
|
79
|
+
|
80
|
+
@include media(tablet) {
|
81
|
+
margin: 0 $gutter;
|
82
|
+
}
|
83
|
+
}
|
84
|
+
}
|
85
|
+
|
86
|
+
.header--without-border {
|
87
|
+
border-bottom: none;
|
88
|
+
margin-bottom: 0;
|
89
|
+
|
90
|
+
.header__container {
|
91
|
+
border-bottom: none;
|
92
|
+
margin-bottom: 0;
|
93
|
+
}
|
94
|
+
}
|
95
|
+
|
96
|
+
.header__brand {
|
97
|
+
font-size: 30px;
|
98
|
+
|
99
|
+
// Give brand focus outline on mobile
|
100
|
+
&:after {
|
101
|
+
content: ".";
|
102
|
+
height: 0;
|
103
|
+
clear: both;
|
104
|
+
visibility: hidden;
|
105
|
+
}
|
106
|
+
|
107
|
+
a:link, a:visited {
|
108
|
+
text-decoration: none;
|
109
|
+
}
|
110
|
+
|
111
|
+
a:hover {
|
112
|
+
text-decoration: underline;
|
113
|
+
}
|
114
|
+
|
115
|
+
.govuk-logo {
|
116
|
+
float: left;
|
117
|
+
}
|
118
|
+
|
119
|
+
@include screen {
|
120
|
+
a:link, a:visited {
|
121
|
+
color: $white;
|
122
|
+
}
|
123
|
+
|
124
|
+
a:focus {
|
125
|
+
background-color: inherit;
|
126
|
+
}
|
127
|
+
|
128
|
+
@include media(tablet) {
|
129
|
+
float: left;
|
130
|
+
|
131
|
+
.govuk-logo {
|
132
|
+
float: none;
|
133
|
+
}
|
134
|
+
|
135
|
+
a:hover {
|
136
|
+
text-decoration: none;
|
137
|
+
border-bottom: 1px solid $white;
|
138
|
+
}
|
139
|
+
}
|
140
|
+
}
|
141
|
+
|
142
|
+
@include print {
|
143
|
+
a:link, a:visited {
|
144
|
+
color: $black;
|
145
|
+
}
|
146
|
+
}
|
147
|
+
}
|
148
|
+
|
149
|
+
.header__title {
|
150
|
+
@include core-24;
|
151
|
+
display: block;
|
152
|
+
float: left;
|
153
|
+
clear: left;
|
154
|
+
|
155
|
+
@include media(tablet) {
|
156
|
+
display: inherit;
|
157
|
+
float: none;
|
158
|
+
clear: none;
|
159
|
+
}
|
160
|
+
|
161
|
+
.phase-banner {
|
162
|
+
margin-left: 5px;
|
163
|
+
}
|
164
|
+
}
|
165
|
+
|
166
|
+
.header__navigation {
|
167
|
+
@include screen {
|
168
|
+
|
169
|
+
// We want the same font size on mobile as tablet, so we can't use bold-16.
|
170
|
+
@include _core-font-generator(
|
171
|
+
$font-size: 16px,
|
172
|
+
$font-size-640: 16px,
|
173
|
+
$font-size-print: 12pt,
|
174
|
+
$line-height: (20 / 16),
|
175
|
+
$line-height-640: (20 / 16),
|
176
|
+
$font-weight: 700
|
177
|
+
);
|
178
|
+
|
179
|
+
clear: both;
|
180
|
+
|
181
|
+
padding-top: 10px;
|
182
|
+
|
183
|
+
a:link, a:visited {
|
184
|
+
color: $white;
|
185
|
+
text-decoration: none;
|
186
|
+
padding: 8px 0;
|
187
|
+
display: inline-block;
|
188
|
+
}
|
189
|
+
|
190
|
+
.active a:link, .active a:visited {
|
191
|
+
color: $active-nav-color;
|
192
|
+
}
|
193
|
+
|
194
|
+
a:focus, .active a:focus {
|
195
|
+
color: $black;
|
196
|
+
}
|
197
|
+
|
198
|
+
a:hover, a:active {
|
199
|
+
text-decoration: underline;
|
200
|
+
}
|
201
|
+
|
202
|
+
ul {
|
203
|
+
border-top: 1px solid $grey-1;
|
204
|
+
margin: 0;
|
205
|
+
padding: 8px 0 0;
|
206
|
+
}
|
207
|
+
|
208
|
+
li {
|
209
|
+
list-style: none;
|
210
|
+
margin: 2px 0;
|
211
|
+
}
|
212
|
+
|
213
|
+
@include media(tablet) {
|
214
|
+
display: block;
|
215
|
+
clear: none;
|
216
|
+
padding-top: 2px;
|
217
|
+
border-top: none;
|
218
|
+
float: right;
|
219
|
+
|
220
|
+
a:link, a:visited {
|
221
|
+
padding: 0;
|
222
|
+
}
|
223
|
+
|
224
|
+
ul {
|
225
|
+
border-top: none;
|
226
|
+
padding: 0;
|
227
|
+
}
|
228
|
+
|
229
|
+
li {
|
230
|
+
float: left;
|
231
|
+
margin: 12px 0 0 $gutter-half;
|
232
|
+
}
|
233
|
+
}
|
234
|
+
}
|
235
|
+
|
236
|
+
@include print {
|
237
|
+
display: none;
|
238
|
+
}
|
239
|
+
}
|
240
|
+
|
241
|
+
.header__navigation-toggle {
|
242
|
+
display: none;
|
243
|
+
}
|
244
|
+
|
245
|
+
.js {
|
246
|
+
.header__navigation {
|
247
|
+
display: none;
|
248
|
+
|
249
|
+
@include media(tablet) {
|
250
|
+
display: block;
|
251
|
+
}
|
252
|
+
}
|
253
|
+
|
254
|
+
.header__navigation-toggle {
|
255
|
+
display: block;
|
256
|
+
float: right;
|
257
|
+
color: $white;
|
258
|
+
background: transparent;
|
259
|
+
border: 1px solid $grey-1;
|
260
|
+
border-radius: 3px;
|
261
|
+
padding: 2px 6px 1px;
|
262
|
+
font-size: 80%;
|
263
|
+
font-weight: bold;
|
264
|
+
|
265
|
+
input {
|
266
|
+
display: none;
|
267
|
+
}
|
268
|
+
|
269
|
+
@include media(tablet) {
|
270
|
+
display: none;
|
271
|
+
}
|
272
|
+
|
273
|
+
&:after {
|
274
|
+
display: inline-block;
|
275
|
+
font-size: 8px;
|
276
|
+
padding-left: 5px;
|
277
|
+
vertical-align: middle;
|
278
|
+
content: " \25BC";
|
279
|
+
}
|
280
|
+
}
|
281
|
+
|
282
|
+
&.nav-open .header__navigation-toggle:after {
|
283
|
+
content: "\25B2";
|
284
|
+
}
|
285
|
+
|
286
|
+
&.nav-open .header__navigation {
|
287
|
+
display: block;
|
288
|
+
}
|
289
|
+
}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
/**
|
2
|
+
* Phase Banner Component
|
3
|
+
*
|
4
|
+
* Example Usage:
|
5
|
+
*
|
6
|
+
* <span class="header__title">
|
7
|
+
* My Product <span class="phase-banner">Beta</span>
|
8
|
+
* </span>
|
9
|
+
*/
|
10
|
+
|
11
|
+
.phase-banner {
|
12
|
+
@include bold-14;
|
13
|
+
padding: 2px 5px 0;
|
14
|
+
text-transform: uppercase;
|
15
|
+
letter-spacing: 1px;
|
16
|
+
vertical-align: middle;
|
17
|
+
|
18
|
+
@include screen {
|
19
|
+
background: $govuk-blue;
|
20
|
+
color: $white;
|
21
|
+
}
|
22
|
+
}
|
@@ -0,0 +1,31 @@
|
|
1
|
+
/**
|
2
|
+
* Skip Link Component
|
3
|
+
*
|
4
|
+
* Notes:
|
5
|
+
*
|
6
|
+
* - Should be the first element in your <body>
|
7
|
+
* - Ensure the target (e.g. #main) exists within your pages.
|
8
|
+
*
|
9
|
+
* Example Usage:
|
10
|
+
*
|
11
|
+
* <a href="#main" class="skip-link">Skip to main content</a>
|
12
|
+
*/
|
13
|
+
|
14
|
+
.skip-link {
|
15
|
+
display: block;
|
16
|
+
position: absolute;
|
17
|
+
left: -9999em;
|
18
|
+
|
19
|
+
&:focus {
|
20
|
+
position: relative;
|
21
|
+
left: inherit;
|
22
|
+
background: $yellow;
|
23
|
+
color: $black;
|
24
|
+
text-decoration: none;
|
25
|
+
padding: 5px $gutter-half;
|
26
|
+
|
27
|
+
@include media(tablet) {
|
28
|
+
padding: 5px $gutter;
|
29
|
+
}
|
30
|
+
}
|
31
|
+
}
|
@@ -0,0 +1,236 @@
|
|
1
|
+
// Adds combination of margin and padding to headings to make them appear
|
2
|
+
// correctly when they're linked to as anchors, and scale them on mobile
|
3
|
+
@mixin heading-offset($tabletTopMargin) {
|
4
|
+
// Scale margins with font size on mobile (16/19ths)
|
5
|
+
$mobileTopMargin: ceil($tabletTopMargin * (16 / 19));
|
6
|
+
|
7
|
+
// Offset headings down on mobile so that linking to anchors they appear after
|
8
|
+
// the sticky 'table of contents' element
|
9
|
+
$stickyTocOffset: 20px + $gutter-half + 10px + 1px;
|
10
|
+
|
11
|
+
// Pad the heading so that when linking to an anchor there is at most a
|
12
|
+
// $gutter-half (mobile) or $gutter (tablet and above) sized gap between the
|
13
|
+
// top of the viewport and the heading.
|
14
|
+
padding-top: min($mobileTopMargin, $gutter-half) + $stickyTocOffset;
|
15
|
+
margin-top: max(0, $mobileTopMargin - $gutter-half) - $stickyTocOffset;
|
16
|
+
|
17
|
+
@include media(tablet) {
|
18
|
+
padding-top: min($tabletTopMargin, $gutter);
|
19
|
+
margin-top: max(0, $tabletTopMargin - $gutter);
|
20
|
+
}
|
21
|
+
}
|
22
|
+
|
23
|
+
.technical-documentation {
|
24
|
+
// Required for IE11 to render <main> correctly
|
25
|
+
display: block;
|
26
|
+
margin: 0 $gutter-half 10px;
|
27
|
+
max-width: 40em;
|
28
|
+
|
29
|
+
line-height: 1.4;
|
30
|
+
|
31
|
+
color: $text-colour;
|
32
|
+
|
33
|
+
@include media(tablet) {
|
34
|
+
// We add 2 pixels to the gutter here to ensure there's sufficient spacing between
|
35
|
+
// an anchor link (see _anchored-heading.scss) on a heading and the left-hand pane.
|
36
|
+
margin: 0 ($gutter + 2px) $gutter;
|
37
|
+
}
|
38
|
+
|
39
|
+
// Headings
|
40
|
+
h1 {
|
41
|
+
@include bold-48;
|
42
|
+
@include heading-offset($gutter * 2);
|
43
|
+
border-top: 5px solid $text-colour;
|
44
|
+
|
45
|
+
&:first-of-type {
|
46
|
+
@include heading-offset($gutter);
|
47
|
+
border-top: none;
|
48
|
+
}
|
49
|
+
}
|
50
|
+
|
51
|
+
h2 {
|
52
|
+
@include bold-36;
|
53
|
+
@include heading-offset($gutter * 1.5);
|
54
|
+
}
|
55
|
+
|
56
|
+
h3, h4, h5, h6 {
|
57
|
+
@include heading-offset($gutter);
|
58
|
+
}
|
59
|
+
|
60
|
+
h3 {
|
61
|
+
@include bold-24;
|
62
|
+
}
|
63
|
+
|
64
|
+
h4 {
|
65
|
+
@include bold-19;
|
66
|
+
}
|
67
|
+
|
68
|
+
h5 {
|
69
|
+
@include bold-19;
|
70
|
+
color: $secondary-text-colour;
|
71
|
+
}
|
72
|
+
|
73
|
+
h6 {
|
74
|
+
@include core-19;
|
75
|
+
color: $secondary-text-colour;
|
76
|
+
}
|
77
|
+
|
78
|
+
// Expand margin when h1 followed directly by paragraph
|
79
|
+
h1 + p {
|
80
|
+
@include media(tablet) {
|
81
|
+
margin-top: $gutter * 1.5;
|
82
|
+
}
|
83
|
+
}
|
84
|
+
|
85
|
+
// Tighten up margins where headings follow each other
|
86
|
+
h1 + h2 {
|
87
|
+
@include heading-offset($gutter);
|
88
|
+
}
|
89
|
+
|
90
|
+
h2 + h3, h3 + h4, h4 + h5, h5 + h6 {
|
91
|
+
@include heading-offset(20px);
|
92
|
+
}
|
93
|
+
|
94
|
+
p {
|
95
|
+
margin-top: ceil($gutter-half * (16 / 19));
|
96
|
+
margin-bottom: 0;
|
97
|
+
|
98
|
+
@include media(tablet) {
|
99
|
+
margin-top: $gutter-half;
|
100
|
+
}
|
101
|
+
}
|
102
|
+
|
103
|
+
img {
|
104
|
+
max-width: 100%;
|
105
|
+
width: auto;
|
106
|
+
height: auto;
|
107
|
+
}
|
108
|
+
|
109
|
+
ol, ul {
|
110
|
+
margin: $gutter-half 0 0;
|
111
|
+
padding-left: 20px;
|
112
|
+
}
|
113
|
+
|
114
|
+
ol ol, ul ul, ol ul, ul ol {
|
115
|
+
margin-top: 0;
|
116
|
+
}
|
117
|
+
|
118
|
+
li {
|
119
|
+
margin-top: 5px;
|
120
|
+
}
|
121
|
+
|
122
|
+
ol + p, ul + p, .table-container + p {
|
123
|
+
margin-top: ceil($gutter * (16 / 19));
|
124
|
+
|
125
|
+
@include media(tablet) {
|
126
|
+
margin-top: $gutter;
|
127
|
+
}
|
128
|
+
}
|
129
|
+
|
130
|
+
blockquote {
|
131
|
+
background: $grey-4;
|
132
|
+
padding: $gutter-half;
|
133
|
+
margin: $gutter-half;
|
134
|
+
border-left: 5px solid $grey-3;
|
135
|
+
}
|
136
|
+
|
137
|
+
pre {
|
138
|
+
background: $code-00;
|
139
|
+
padding: 15px;
|
140
|
+
overflow: auto;
|
141
|
+
position: relative;
|
142
|
+
border: 1px solid $code-02;
|
143
|
+
}
|
144
|
+
|
145
|
+
pre code {
|
146
|
+
background: none;
|
147
|
+
color: inherit;
|
148
|
+
padding: 0;
|
149
|
+
}
|
150
|
+
|
151
|
+
code {
|
152
|
+
background: $code-01;
|
153
|
+
padding: 3px 5px;
|
154
|
+
border-radius: 1px;
|
155
|
+
|
156
|
+
font-family: monaco, Consolas, "Lucida Console", monospace;
|
157
|
+
font-size: 15px;
|
158
|
+
color: $code-0E;
|
159
|
+
|
160
|
+
@include media(tablet) {
|
161
|
+
font-size: 16px;
|
162
|
+
}
|
163
|
+
|
164
|
+
// Handle long strings (URLs, long variable names, etc) by allowing them
|
165
|
+
// to break anywhere if required.
|
166
|
+
overflow-wrap: break-word;
|
167
|
+
word-wrap: break-word;
|
168
|
+
|
169
|
+
-ms-word-break: break-all;
|
170
|
+
/* This is the dangerous one in WebKit, as it breaks things wherever */
|
171
|
+
word-break: break-all;
|
172
|
+
/* Instead use this non-standard one: */
|
173
|
+
word-break: break-word;
|
174
|
+
}
|
175
|
+
|
176
|
+
// Support monospace headings for e.g. listing API endpoints
|
177
|
+
h1, h2, h3, h4, h5, h6 {
|
178
|
+
code {
|
179
|
+
font-size: inherit;
|
180
|
+
color: $text-colour;
|
181
|
+
background: none;
|
182
|
+
padding: 0;
|
183
|
+
}
|
184
|
+
}
|
185
|
+
|
186
|
+
.table-container {
|
187
|
+
display: block;
|
188
|
+
max-width: 100%;
|
189
|
+
overflow-x: auto;
|
190
|
+
|
191
|
+
margin-top: $gutter-half;
|
192
|
+
}
|
193
|
+
|
194
|
+
table {
|
195
|
+
width: 100%;
|
196
|
+
|
197
|
+
border-collapse: collapse;
|
198
|
+
border-spacing: 0;
|
199
|
+
}
|
200
|
+
|
201
|
+
th, td {
|
202
|
+
padding: $gutter-one-third $gutter-two-thirds $gutter-one-third 0;
|
203
|
+
|
204
|
+
background-color: transparent;
|
205
|
+
border-bottom: 1px solid $border-colour;
|
206
|
+
border-width: 0 0 1px 0;
|
207
|
+
|
208
|
+
@include core-16;
|
209
|
+
vertical-align: top;
|
210
|
+
text-align: left;
|
211
|
+
}
|
212
|
+
|
213
|
+
th {
|
214
|
+
font-weight: bold;
|
215
|
+
}
|
216
|
+
|
217
|
+
td {
|
218
|
+
p, ul, ol {
|
219
|
+
margin: 0;
|
220
|
+
}
|
221
|
+
p+p, p+ul, p+ol,
|
222
|
+
ul+p, ul+ol,
|
223
|
+
ol+p {
|
224
|
+
margin-top: $gutter-one-third;
|
225
|
+
}
|
226
|
+
}
|
227
|
+
|
228
|
+
hr {
|
229
|
+
height: 1px;
|
230
|
+
border: none;
|
231
|
+
margin-top: $gutter - 1px;
|
232
|
+
margin-bottom: $gutter;
|
233
|
+
background-color: $border-colour;
|
234
|
+
color: $border-colour;
|
235
|
+
}
|
236
|
+
}
|