govuk_tech_docs 1.9.0.pre.rc2 → 2.0.0.pre.test.pre.release.pre.524

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. checksums.yaml +5 -5
  2. data/.ruby-version +1 -1
  3. data/.travis.yml +4 -1
  4. data/CHANGELOG.md +7 -2
  5. data/example/.ruby-version +1 -1
  6. data/govuk_tech_docs.gemspec +23 -4
  7. data/lib/assets/javascripts/govuk_tech_docs.js +2 -0
  8. data/lib/assets/stylesheets/_core.scss +0 -48
  9. data/lib/assets/stylesheets/_govuk_tech_docs.scss +4 -8
  10. data/lib/assets/stylesheets/modules/_anchored-heading.scss +6 -6
  11. data/lib/assets/stylesheets/modules/_app-pane.scss +46 -47
  12. data/lib/assets/stylesheets/modules/_collapsible.scss +7 -3
  13. data/lib/assets/stylesheets/modules/_contribution-banner.scss +9 -7
  14. data/lib/assets/stylesheets/modules/_footer.scss +6 -127
  15. data/lib/assets/stylesheets/modules/_page-review.scss +15 -14
  16. data/lib/assets/stylesheets/modules/_search.scss +53 -42
  17. data/lib/assets/stylesheets/modules/_technical-documentation.scss +65 -95
  18. data/lib/assets/stylesheets/modules/_toc.scss +76 -47
  19. data/lib/assets/stylesheets/palette/_syntax-highlighting.scss +5 -5
  20. data/lib/govuk_tech_docs.rb +13 -11
  21. data/lib/govuk_tech_docs/api_reference/api_reference_extension.rb +1 -1
  22. data/lib/govuk_tech_docs/api_reference/api_reference_renderer.rb +1 -0
  23. data/lib/govuk_tech_docs/api_reference/templates/api_reference_full.html.erb +1 -1
  24. data/lib/govuk_tech_docs/page_review.rb +1 -0
  25. data/lib/govuk_tech_docs/pages.rb +1 -1
  26. data/lib/govuk_tech_docs/redirects.rb +1 -1
  27. data/lib/govuk_tech_docs/table_of_contents/heading_tree_renderer.rb +1 -1
  28. data/lib/govuk_tech_docs/table_of_contents/headings_builder.rb +1 -1
  29. data/lib/govuk_tech_docs/table_of_contents/helpers.rb +1 -0
  30. data/lib/govuk_tech_docs/version.rb +1 -1
  31. data/lib/source/layouts/_footer.erb +32 -7
  32. data/lib/source/layouts/_header.erb +41 -27
  33. data/lib/source/layouts/_search.erb +4 -2
  34. data/lib/source/layouts/core.erb +7 -8
  35. data/lib/source/stylesheets/manifest.css +3 -0
  36. data/package-lock.json +3 -3
  37. data/package.json +3 -2
  38. metadata +38 -33
  39. data/lib/assets/stylesheets/_accessibility.scss +0 -9
  40. data/lib/assets/stylesheets/govuk_frontend_toolkit/_colours.scss +0 -2
  41. data/lib/assets/stylesheets/govuk_frontend_toolkit/_conditionals.scss +0 -81
  42. data/lib/assets/stylesheets/govuk_frontend_toolkit/_css3.scss +0 -90
  43. data/lib/assets/stylesheets/govuk_frontend_toolkit/_device-pixels.scss +0 -10
  44. data/lib/assets/stylesheets/govuk_frontend_toolkit/_font_stack.scss +0 -19
  45. data/lib/assets/stylesheets/govuk_frontend_toolkit/_grid_layout.scss +0 -136
  46. data/lib/assets/stylesheets/govuk_frontend_toolkit/_helpers.scss +0 -16
  47. data/lib/assets/stylesheets/govuk_frontend_toolkit/_measurements.scss +0 -14
  48. data/lib/assets/stylesheets/govuk_frontend_toolkit/_shims.scss +0 -55
  49. data/lib/assets/stylesheets/govuk_frontend_toolkit/_typography.scss +0 -249
  50. data/lib/assets/stylesheets/govuk_frontend_toolkit/_url-helpers.scss +0 -16
  51. data/lib/assets/stylesheets/govuk_frontend_toolkit/colours/_organisation.scss +0 -103
  52. data/lib/assets/stylesheets/govuk_frontend_toolkit/colours/_palette.scss +0 -77
  53. data/lib/assets/stylesheets/govuk_frontend_toolkit/design-patterns/_alpha-beta.scss +0 -66
  54. data/lib/assets/stylesheets/govuk_frontend_toolkit/design-patterns/_breadcrumbs.scss +0 -53
  55. data/lib/assets/stylesheets/govuk_frontend_toolkit/design-patterns/_buttons.scss +0 -141
  56. data/lib/assets/stylesheets/govuk_frontend_toolkit/design-patterns/_media-player.scss +0 -242
  57. data/lib/assets/stylesheets/modules/_govuk-logo.scss +0 -47
  58. data/lib/assets/stylesheets/modules/_header.scss +0 -289
  59. data/lib/assets/stylesheets/modules/_skip-link.scss +0 -31
  60. data/lib/source/images/gov.uk_logotype_crown-2x.png +0 -0
  61. data/lib/source/images/gov.uk_logotype_crown.png +0 -0
  62. data/lib/source/images/gov.uk_logotype_crown_invert_trans.png +0 -0
  63. data/lib/source/images/govuk-crest-2x.png +0 -0
  64. data/lib/source/images/govuk-crest.png +0 -0
  65. data/lib/source/images/open-government-licence.png +0 -0
  66. data/lib/source/images/open-government-licence_2x.png +0 -0
@@ -1,13 +1,14 @@
1
1
  .page-expiry--not-expired,
2
2
  .page-expiry--default {
3
- padding: $gutter-half;
4
- margin-top: $gutter;
5
- margin-bottom: $gutter;
6
- background-color: $govuk-blue;
7
- color: $page-colour;
3
+ @include govuk-font($size: 19);
4
+ padding: govuk-spacing(3);
5
+ margin-top: govuk-spacing(6);
6
+ margin-bottom: govuk-spacing(6);
7
+ background-color: $govuk-brand-colour;
8
+ color: govuk-colour("white");
8
9
 
9
- @include media(tablet) {
10
- padding: $gutter;
10
+ @include govuk-media-query(tablet) {
11
+ padding: govuk-spacing(6);
11
12
  }
12
13
 
13
14
  a:link,
@@ -16,20 +17,20 @@
16
17
  }
17
18
 
18
19
  a:hover {
19
- color: $link-hover-colour;
20
+ color: $govuk-link-hover-colour;
20
21
  }
21
22
 
22
23
  a:active {
23
- color: $link-active-colour;
24
+ color: $govuk-link-active-colour;
24
25
  }
25
26
  }
26
27
 
27
28
  .page-expiry--expired {
28
29
  display: none;
29
30
 
30
- padding: $gutter-half;
31
- margin-top: $gutter * 2;
32
- background-color: $error-background;
33
- border: 1px solid $error-colour;
34
- color: $error-colour;
31
+ padding: govuk-spacing(3);
32
+ margin-top: govuk-spacing(9);
33
+ border: govuk-spacing(1) solid $govuk-error-colour;
34
+ background-color: govuk-colour("white");
35
+ color: $govuk-text-colour;
35
36
  }
@@ -1,33 +1,15 @@
1
- @include screen {
1
+ @include govuk-media-query($media-type: screen) {
2
2
  .page-title + .search {
3
- margin-top: $gutter;
3
+ margin-top: govuk-spacing(6);
4
4
  }
5
5
 
6
- .search {
7
- @include core-16;
8
- margin-bottom: $gutter-half;
9
- height: 40px;
10
- .search__label {
11
- position: absolute;
12
- left: -9999em;
13
- top: auto;
14
- width: 1px;
15
- height: 1px;
16
- overflow: hidden;
17
- }
18
- .form-control {
19
- @include box-sizing(border-box);
20
- @include core-19;
21
- width: 100%;
22
- padding: 5px 4px 2px;
23
- border: 2px solid $text-colour;
24
- appearance: none;
25
-
26
- &:focus {
27
- outline: 3px solid $focus-colour;
28
- outline-offset: 0;
29
- }
30
- }
6
+ .js .search__label {
7
+ position: absolute;
8
+ left: -9999em;
9
+ top: auto;
10
+ width: 1px;
11
+ height: 1px;
12
+ overflow: hidden;
31
13
  }
32
14
  }
33
15
 
@@ -60,22 +42,39 @@ html.has-search-results-open {
60
42
  overflow-x: scroll;
61
43
  -webkit-overflow-scrolling: touch;
62
44
  -ms-overflow-style: none;
63
- @include media(tablet) {
45
+ @include govuk-media-query(tablet) {
64
46
  padding: 22px 20px 0 30px;
65
47
  top: 0;
66
48
  // The width of the sidebar
67
49
  left: 330px;
68
50
  }
51
+
52
+ a:link, a:visited {
53
+ text-decoration: none;
54
+ color: $govuk-link-colour;
55
+ }
56
+
57
+ a:hover {
58
+ text-decoration: underline;
59
+
60
+ &:focus {
61
+ text-decoration: none;
62
+ }
63
+ }
64
+ a:focus {
65
+ outline: none;
66
+ @include govuk-focused-text;
67
+ }
69
68
  }
70
69
  .search-results__inner {
71
70
  position: relative;
72
- background: $white;
73
- border-top: 1px solid $grey-2;
71
+ background: govuk-colour("white");
72
+ border-top: 1px solid govuk-colour("mid-grey");
74
73
  max-width: 40rem;
75
74
  padding: 15px;
76
- @include media(tablet) {
75
+ @include govuk-media-query(tablet) {
77
76
  padding: 15px 200px 50px 40px;
78
- border: 1px solid $grey-2;
77
+ border: 1px solid govuk-colour("mid-grey");
79
78
  &::after {
80
79
  content: '';
81
80
  position: absolute;
@@ -83,28 +82,40 @@ html.has-search-results-open {
83
82
  left: -9px;
84
83
  width: 10px;
85
84
  height: 20px;
86
- background: no-repeat file-url('search-result-caret.svg') center right;
85
+ background: no-repeat url('/images/search-result-caret.svg') center right;
87
86
  background-size: contain;
88
87
  }
89
88
  }
90
89
  }
91
90
  .search-results__title {
92
- @include bold-27;
93
- margin-bottom: $gutter;
91
+ @include govuk-font($size: 27, $weight: bold);
92
+ margin-bottom: govuk-spacing(6);
94
93
  }
95
94
  .search-results__close {
96
- @include core-16;
95
+ @include govuk-font($size: 16);
97
96
  position: absolute;
98
97
  top: 18px;
99
98
  right: 20px;
100
99
  appearance: none;
100
+ -webkit-appearance: none;
101
101
  background: none;
102
102
  border: 0;
103
103
  padding: 0;
104
+ cursor: pointer;
105
+
104
106
  &:focus {
105
- outline: 3px solid $focus-colour;;
106
- outline-offset: 0;
107
+ background-color: $govuk-focus-colour;
108
+ outline: $govuk-focus-width solid transparent;
109
+ box-shadow: inset 0 0 0 1px $govuk-focus-colour;
107
110
  }
111
+
112
+ &:focus:not(:active):not(:hover) {
113
+ border-color: $govuk-focus-colour;
114
+ color: $govuk-focus-text-colour;
115
+ background-color: $govuk-focus-colour;
116
+ box-shadow: 0 2px 0 $govuk-focus-text-colour;
117
+ }
118
+
108
119
  &::after {
109
120
  content: '';
110
121
  display: inline-block;
@@ -112,9 +123,9 @@ html.has-search-results-open {
112
123
  padding-left: 8px;
113
124
  height: 18px;
114
125
  width: 18px;
115
- background: no-repeat file-url('govuk-icn-close.png') center right;
116
- @include device-pixel-ratio {
117
- background-image: file-url('govuk-icn-close@2x.png');
126
+ background: no-repeat url('/images/govuk-icn-close.png') center right;
127
+ @include govuk-device-pixel-ratio {
128
+ background-image: url('/images/govuk-icn-close@2x.png');
118
129
  }
119
130
  background-size: contain;
120
131
  }
@@ -128,7 +139,7 @@ html.has-search-results-open {
128
139
  overflow: hidden;
129
140
  }
130
141
  .search-result {
131
- margin-bottom: $gutter;
142
+ margin-bottom: govuk-spacing(6);
132
143
  }
133
144
  .search-result mark {
134
145
  background-color: transparent;
@@ -1,137 +1,116 @@
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
- // TODO: Headings are hidden underneath the sticky 'table of contents' on mobile
4
- // when following a link to them
5
-
6
- @mixin heading-offset($tabletTopMargin) {
7
- // Scale margins with font size on mobile (16/19ths)
8
- $mobileTopMargin: ceil($tabletTopMargin * (16 / 19));
9
-
10
- padding-top: min($mobileTopMargin, $gutter-half);
11
- margin-top: max(0, $mobileTopMargin - $gutter-half);
12
-
13
- @include media(tablet) {
14
- padding-top: min($tabletTopMargin, $gutter);
15
- margin-top: max(0, $tabletTopMargin - $gutter);
16
- }
17
- }
18
-
19
1
  .technical-documentation {
2
+ @include govuk-font($size: 19);
20
3
  // Required for IE11 to render <main> correctly
21
4
  display: block;
22
- margin: 0 $gutter-half 10px;
5
+ margin: govuk-spacing(3);
6
+ font-size: 19px;
23
7
  max-width: 40em;
24
8
 
25
9
  line-height: 1.4;
26
10
 
27
- color: $text-colour;
11
+ color: $govuk-text-colour;
28
12
 
29
- @include media(tablet) {
13
+ @include govuk-media-query(tablet) {
30
14
  // We add 2 pixels to the gutter here to ensure there's sufficient spacing between
31
15
  // an anchor link (see _anchored-heading.scss) on a heading and the left-hand pane.
32
- margin: 0 ($gutter + 2px) $gutter;
16
+ margin: 0 govuk-spacing(6) (govuk-spacing(6) + 2px);
33
17
  }
34
18
 
35
19
  .has-search-results-open & {
36
20
  visibility: hidden;
37
21
  }
38
22
 
39
- // Headings
40
- h1 {
41
- @include bold-48;
42
- @include heading-offset($gutter * 2);
43
- border-top: 5px solid $text-colour;
23
+ > h1 {
24
+ @extend %govuk-heading-xl;
44
25
 
45
26
  &:first-of-type {
46
- @include heading-offset($gutter);
47
- border-top: none;
27
+ padding-top: govuk-spacing(6);
48
28
  }
49
29
  }
50
30
 
51
- h2 {
52
- @include bold-36;
53
- @include heading-offset($gutter * 1.5);
31
+ > h2 {
32
+ @extend %govuk-heading-l;
33
+ padding-top: govuk-spacing(6);
34
+ margin-top: govuk-spacing(3);
54
35
  }
55
36
 
56
- h3, h4, h5, h6 {
57
- @include heading-offset($gutter);
37
+ > h3 {
38
+ @extend %govuk-heading-m;
58
39
  }
59
40
 
60
- h3 {
61
- @include bold-24;
41
+ > h4 {
42
+ @extend %govuk-heading-s;
62
43
  }
63
44
 
64
- h4 {
65
- @include bold-19;
45
+ > p {
46
+ @extend %govuk-body-m;
66
47
  }
67
48
 
68
- h5 {
69
- @include bold-19;
70
- color: $secondary-text-colour;
49
+ > strong,
50
+ > b {
51
+ @include govuk-typography-weight-bold;
71
52
  }
72
53
 
73
- h6 {
74
- @include core-19;
75
- color: $secondary-text-colour;
54
+ > ul,
55
+ > ol {
56
+ @extend %govuk-list;
76
57
  }
77
58
 
78
- // Expand margin when h1 followed directly by paragraph
79
- h1 + p {
80
- @include media(tablet) {
81
- margin-top: $gutter * 1.5;
82
- }
59
+ > ol {
60
+ @extend %govuk-list--number;
83
61
  }
84
62
 
85
- // Tighten up margins where headings follow each other
86
- h1 + h2 {
87
- @include heading-offset($gutter);
63
+ > ul {
64
+ @extend %govuk-list--bullet;
88
65
  }
89
66
 
90
- h2 + h3, h3 + h4, h4 + h5, h5 + h6 {
91
- @include heading-offset(20px);
67
+ a {
68
+ @extend %govuk-link;
92
69
  }
93
70
 
94
- p {
95
- margin-top: ceil($gutter-half * (16 / 19));
96
- margin-bottom: 0;
71
+ > a {
72
+ @extend %govuk-body-m;
73
+ }
97
74
 
98
- @include media(tablet) {
99
- margin-top: $gutter-half;
100
- }
75
+ hr {
76
+ @extend %govuk-section-break;
77
+ @extend %govuk-section-break--visible;
78
+ @extend %govuk-section-break--xl;
101
79
  }
102
80
 
103
- img {
104
- max-width: 100%;
105
- width: auto;
106
- height: auto;
81
+ table {
82
+ @include govuk-responsive-margin(6, "bottom");
107
83
  }
108
84
 
109
- ol, ul {
110
- margin: $gutter-half 0 0;
111
- padding-left: 20px;
85
+ pre + h2 {
86
+ padding-top: govuk-spacing(4);
112
87
  }
113
88
 
114
- ol ol, ul ul, ol ul, ul ol {
115
- margin-top: 0;
89
+ pre + h3,
90
+ pre + h4 {
91
+ padding-top: govuk-spacing(2);
116
92
  }
117
93
 
118
- li {
119
- margin-top: 5px;
94
+ img {
95
+ max-width: 100%;
96
+ width: auto;
97
+ height: auto;
120
98
  }
121
99
 
122
100
  ol + p, ul + p, .table-container + p {
123
- margin-top: ceil($gutter * (16 / 19));
101
+ margin-top: ceil(govuk-spacing(6) * (16 / 19));
124
102
 
125
- @include media(tablet) {
126
- margin-top: $gutter;
103
+ @include govuk-media-query(tablet) {
104
+ margin-top: govuk-spacing(6);
127
105
  }
128
106
  }
129
107
 
130
108
  blockquote {
131
- background: $grey-4;
132
- padding: $gutter-half;
133
- margin: $gutter-half;
134
- border-left: 5px solid $grey-3;
109
+ @include govuk-font($size: 19);
110
+ background: govuk-colour("light-grey");
111
+ padding: govuk-spacing(3);
112
+ margin: govuk-spacing(3);
113
+ border-left: govuk-spacing(2) solid govuk-colour("mid-grey");
135
114
  }
136
115
 
137
116
  pre {
@@ -155,14 +134,14 @@
155
134
 
156
135
  code {
157
136
  background: $code-01;
158
- padding: 3px 5px;
137
+ padding: 3px govuk-spacing(1);
159
138
  border-radius: 1px;
160
139
 
161
140
  font-family: monaco, Consolas, "Lucida Console", monospace;
162
141
  font-size: 15px;
163
142
  color: $code-0E;
164
143
 
165
- @include media(tablet) {
144
+ @include govuk-media-query(tablet) {
166
145
  font-size: 16px;
167
146
  }
168
147
 
@@ -182,7 +161,7 @@
182
161
  h1, h2, h3, h4, h5, h6 {
183
162
  code {
184
163
  font-size: inherit;
185
- color: $text-colour;
164
+ color: $govuk-text-colour;
186
165
  background: none;
187
166
  padding: 0;
188
167
  }
@@ -193,7 +172,7 @@
193
172
  max-width: 100%;
194
173
  overflow-x: auto;
195
174
 
196
- margin-top: $gutter-half;
175
+ margin-top: govuk-spacing(3);
197
176
  }
198
177
 
199
178
  table {
@@ -204,13 +183,13 @@
204
183
  }
205
184
 
206
185
  th, td {
207
- padding: $gutter-one-third $gutter-two-thirds $gutter-one-third 0;
186
+ padding: govuk-spacing(2) govuk-spacing(4) govuk-spacing(2) 0;
208
187
 
209
188
  background-color: transparent;
210
- border-bottom: 1px solid $border-colour;
189
+ border-bottom: 1px solid $govuk-border-colour;
211
190
  border-width: 0 0 1px 0;
212
191
 
213
- @include core-16;
192
+ @include govuk-font($size: 16);
214
193
  vertical-align: top;
215
194
  text-align: left;
216
195
  }
@@ -226,16 +205,7 @@
226
205
  p+p, p+ul, p+ol,
227
206
  ul+p, ul+ol,
228
207
  ol+p {
229
- margin-top: $gutter-one-third;
208
+ margin-top: govuk-spacing(2);
230
209
  }
231
210
  }
232
-
233
- hr {
234
- height: 1px;
235
- border: none;
236
- margin-top: $gutter - 1px;
237
- margin-bottom: $gutter;
238
- background-color: $border-colour;
239
- color: $border-colour;
240
- }
241
211
  }