dxw_govuk_frontend_rails 3.5.0 → 3.10.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CONTRIBUTING.md +1 -0
- data/Gemfile.lock +3 -2
- data/README.md +45 -42
- data/lib/dxw_govuk_frontend_rails/version.rb +1 -1
- data/package-lock.json +3 -3
- data/package.json +1 -1
- data/vendor/assets/javascripts/govuk_frontend_rails.js +265 -121
- data/vendor/assets/stylesheets/_base.scss +3 -0
- data/vendor/assets/stylesheets/all.scss +1 -3
- data/vendor/assets/stylesheets/components/_all.scss +32 -29
- data/vendor/assets/stylesheets/components/accordion/_accordion.scss +2 -208
- data/vendor/assets/stylesheets/components/accordion/_index.scss +206 -0
- data/vendor/assets/stylesheets/components/back-link/_back-link.scss +2 -65
- data/vendor/assets/stylesheets/components/back-link/_index.scss +110 -0
- data/vendor/assets/stylesheets/components/breadcrumbs/_breadcrumbs.scss +2 -118
- data/vendor/assets/stylesheets/components/breadcrumbs/_index.scss +137 -0
- data/vendor/assets/stylesheets/components/button/_button.scss +2 -284
- data/vendor/assets/stylesheets/components/button/_index.scss +280 -0
- data/vendor/assets/stylesheets/components/character-count/_character-count.scss +2 -31
- data/vendor/assets/stylesheets/components/character-count/_index.scss +24 -0
- data/vendor/assets/stylesheets/components/checkboxes/_checkboxes.scss +2 -308
- data/vendor/assets/stylesheets/components/checkboxes/_index.scss +305 -0
- data/vendor/assets/stylesheets/components/date-input/_date-input.scss +2 -30
- data/vendor/assets/stylesheets/components/date-input/_index.scss +26 -0
- data/vendor/assets/stylesheets/components/details/_details.scss +2 -88
- data/vendor/assets/stylesheets/components/details/_index.scss +83 -0
- data/vendor/assets/stylesheets/components/error-message/_error-message.scss +2 -15
- data/vendor/assets/stylesheets/components/error-message/_index.scss +11 -0
- data/vendor/assets/stylesheets/components/error-summary/_error-summary.scss +2 -59
- data/vendor/assets/stylesheets/components/error-summary/_index.scss +43 -0
- data/vendor/assets/stylesheets/components/fieldset/_fieldset.scss +2 -68
- data/vendor/assets/stylesheets/components/fieldset/_index.scss +64 -0
- data/vendor/assets/stylesheets/components/file-upload/_file-upload.scss +2 -81
- data/vendor/assets/stylesheets/components/file-upload/_index.scss +50 -0
- data/vendor/assets/stylesheets/components/footer/_footer.scss +2 -244
- data/vendor/assets/stylesheets/components/footer/_index.scss +234 -0
- data/vendor/assets/stylesheets/components/header/_header.scss +2 -318
- data/vendor/assets/stylesheets/components/header/_index.scss +309 -0
- data/vendor/assets/stylesheets/components/hint/_hint.scss +2 -50
- data/vendor/assets/stylesheets/components/hint/_index.scss +44 -0
- data/vendor/assets/stylesheets/components/input/_index.scss +187 -0
- data/vendor/assets/stylesheets/components/input/_input.scss +2 -103
- data/vendor/assets/stylesheets/components/inset-text/_index.scss +24 -0
- data/vendor/assets/stylesheets/components/inset-text/_inset-text.scss +2 -28
- data/vendor/assets/stylesheets/components/label/_index.scss +41 -0
- data/vendor/assets/stylesheets/components/label/_label.scss +2 -45
- data/vendor/assets/stylesheets/components/notification-banner/_index.scss +89 -0
- data/vendor/assets/stylesheets/components/notification-banner/_notification-banner.scss +2 -0
- data/vendor/assets/stylesheets/components/panel/_index.scss +44 -0
- data/vendor/assets/stylesheets/components/panel/_panel.scss +2 -44
- data/vendor/assets/stylesheets/components/phase-banner/_index.scss +27 -0
- data/vendor/assets/stylesheets/components/phase-banner/_phase-banner.scss +2 -31
- data/vendor/assets/stylesheets/components/radios/_index.scss +342 -0
- data/vendor/assets/stylesheets/components/radios/_radios.scss +2 -346
- data/vendor/assets/stylesheets/components/select/_index.scss +49 -0
- data/vendor/assets/stylesheets/components/select/_select.scss +2 -57
- data/vendor/assets/stylesheets/components/skip-link/_index.scss +34 -0
- data/vendor/assets/stylesheets/components/skip-link/_skip-link.scss +2 -37
- data/vendor/assets/stylesheets/components/summary-list/_index.scss +145 -0
- data/vendor/assets/stylesheets/components/summary-list/_summary-list.scss +2 -157
- data/vendor/assets/stylesheets/components/table/_index.scss +50 -0
- data/vendor/assets/stylesheets/components/table/_table.scss +2 -54
- data/vendor/assets/stylesheets/components/tabs/_index.scss +135 -0
- data/vendor/assets/stylesheets/components/tabs/_tabs.scss +2 -142
- data/vendor/assets/stylesheets/components/tag/_index.scss +86 -0
- data/vendor/assets/stylesheets/components/tag/_tag.scss +2 -44
- data/vendor/assets/stylesheets/components/textarea/_index.scss +47 -0
- data/vendor/assets/stylesheets/components/textarea/_textarea.scss +2 -55
- data/vendor/assets/stylesheets/components/warning-text/_index.scss +57 -0
- data/vendor/assets/stylesheets/components/warning-text/_warning-text.scss +2 -60
- data/vendor/assets/stylesheets/core/_global-styles.scss +5 -3
- data/vendor/assets/stylesheets/core/_links.scss +5 -3
- data/vendor/assets/stylesheets/core/_lists.scss +17 -3
- data/vendor/assets/stylesheets/core/_section-break.scss +5 -3
- data/vendor/assets/stylesheets/core/_template.scss +5 -3
- data/vendor/assets/stylesheets/core/_typography.scss +5 -3
- data/vendor/assets/stylesheets/helpers/_clearfix.scss +1 -1
- data/vendor/assets/stylesheets/helpers/_colour.scss +1 -1
- data/vendor/assets/stylesheets/helpers/_device-pixels.scss +3 -3
- data/vendor/assets/stylesheets/helpers/_focused.scss +1 -1
- data/vendor/assets/stylesheets/helpers/_font-faces.scss +9 -11
- data/vendor/assets/stylesheets/helpers/_grid.scss +2 -1
- data/vendor/assets/stylesheets/helpers/_links.scss +96 -4
- data/vendor/assets/stylesheets/helpers/_media-queries.scss +2 -6
- data/vendor/assets/stylesheets/helpers/_shape-arrow.scss +1 -1
- data/vendor/assets/stylesheets/helpers/_spacing.scss +7 -6
- data/vendor/assets/stylesheets/helpers/_typography.scss +13 -12
- data/vendor/assets/stylesheets/helpers/_visually-hidden.scss +30 -30
- data/vendor/assets/stylesheets/objects/_form-group.scss +1 -4
- data/vendor/assets/stylesheets/objects/_grid.scss +3 -6
- data/vendor/assets/stylesheets/objects/_main-wrapper.scss +5 -4
- data/vendor/assets/stylesheets/objects/_width-container.scss +2 -4
- data/vendor/assets/stylesheets/overrides/_display.scss +12 -4
- data/vendor/assets/stylesheets/overrides/_spacing.scss +5 -3
- data/vendor/assets/stylesheets/overrides/_typography.scss +5 -3
- data/vendor/assets/stylesheets/overrides/_width.scss +6 -3
- data/vendor/assets/stylesheets/settings/_colours-applied.scss +11 -5
- data/vendor/assets/stylesheets/settings/_colours-organisations.scss +3 -0
- data/vendor/assets/stylesheets/settings/_colours-palette.scss +42 -35
- data/vendor/assets/stylesheets/settings/_compatibility.scss +0 -1
- data/vendor/assets/stylesheets/settings/_ie8.scss +1 -1
- data/vendor/assets/stylesheets/settings/_measurements.scss +4 -5
- data/vendor/assets/stylesheets/settings/_typography-font-families.scss +2 -2
- data/vendor/assets/stylesheets/settings/_typography-font.scss +14 -5
- data/vendor/assets/stylesheets/settings/_typography-responsive.scss +6 -2
- data/vendor/assets/stylesheets/tools/_compatibility.scss +1 -1
- data/vendor/assets/stylesheets/tools/_font-url.scss +1 -4
- data/vendor/assets/stylesheets/tools/_ie8.scss +1 -1
- data/vendor/assets/stylesheets/tools/_iff.scss +3 -1
- data/vendor/assets/stylesheets/tools/_image-url.scss +1 -4
- data/vendor/assets/stylesheets/tools/_px-to-em.scss +1 -1
- data/vendor/assets/stylesheets/tools/_px-to-rem.scss +1 -1
- data/vendor/assets/stylesheets/utilities/_visually-hidden.scss +0 -1
- data/vendor/assets/stylesheets/vendor/_sass-mq.scss +0 -4
- metadata +36 -3
@@ -1,55 +1,2 @@
|
|
1
|
-
@import "../../
|
2
|
-
@import "
|
3
|
-
@import "../../helpers/all";
|
4
|
-
|
5
|
-
@import "../error-message/error-message";
|
6
|
-
@import "../hint/hint";
|
7
|
-
@import "../label/label";
|
8
|
-
|
9
|
-
@include govuk-exports("govuk/component/textarea") {
|
10
|
-
.govuk-textarea {
|
11
|
-
@include govuk-font($size: 19, $line-height: 1.25);
|
12
|
-
|
13
|
-
box-sizing: border-box; // should this be global?
|
14
|
-
display: block;
|
15
|
-
width: 100%;
|
16
|
-
min-height: 40px;
|
17
|
-
@include govuk-responsive-margin(6, "bottom");
|
18
|
-
padding: govuk-spacing(1);
|
19
|
-
|
20
|
-
resize: vertical;
|
21
|
-
|
22
|
-
border: $govuk-border-width-form-element solid $govuk-input-border-colour;
|
23
|
-
border-radius: 0;
|
24
|
-
|
25
|
-
-webkit-appearance: none;
|
26
|
-
|
27
|
-
&:focus {
|
28
|
-
outline: $govuk-focus-width solid $govuk-focus-colour;
|
29
|
-
// Ensure outline appears outside of the element
|
30
|
-
outline-offset: 0;
|
31
|
-
// Double the border by adding its width again. Use `box-shadow` to do
|
32
|
-
// this instead of changing `border-width` (which changes element size) and
|
33
|
-
// since `outline` is already used for the yellow focus state.
|
34
|
-
box-shadow: inset 0 0 0 $govuk-border-width-form-element;
|
35
|
-
|
36
|
-
@include govuk-if-ie8 {
|
37
|
-
// IE8 doesn't support `box-shadow` so double the border with
|
38
|
-
// `border-width`.
|
39
|
-
border-width: $govuk-border-width-form-element * 2;
|
40
|
-
}
|
41
|
-
}
|
42
|
-
}
|
43
|
-
|
44
|
-
.govuk-textarea--error {
|
45
|
-
border: $govuk-border-width-form-element-error solid $govuk-error-colour;
|
46
|
-
|
47
|
-
&:focus {
|
48
|
-
border-color: $govuk-input-border-colour;
|
49
|
-
// Remove `box-shadow` inherited from `:focus` as `textarea--error`
|
50
|
-
// already has the thicker border.
|
51
|
-
box-shadow: none;
|
52
|
-
}
|
53
|
-
|
54
|
-
}
|
55
|
-
}
|
1
|
+
@import "../../base";
|
2
|
+
@import "./index";
|
@@ -0,0 +1,57 @@
|
|
1
|
+
@include govuk-exports("govuk/component/warning-text") {
|
2
|
+
.govuk-warning-text {
|
3
|
+
position: relative;
|
4
|
+
@include govuk-responsive-margin(6, "bottom");
|
5
|
+
padding: govuk-spacing(2) 0;
|
6
|
+
}
|
7
|
+
|
8
|
+
.govuk-warning-text__assistive {
|
9
|
+
@include govuk-visually-hidden;
|
10
|
+
}
|
11
|
+
|
12
|
+
.govuk-warning-text__icon {
|
13
|
+
@include govuk-font($size: false, $weight: bold);
|
14
|
+
|
15
|
+
box-sizing: border-box;
|
16
|
+
|
17
|
+
display: inline-block;
|
18
|
+
|
19
|
+
position: absolute;
|
20
|
+
left: 0;
|
21
|
+
|
22
|
+
min-width: 35px;
|
23
|
+
min-height: 35px;
|
24
|
+
margin-top: -7px;
|
25
|
+
|
26
|
+
@include govuk-media-query($from: tablet) {
|
27
|
+
margin-top: -5px;
|
28
|
+
}
|
29
|
+
|
30
|
+
// When a user customises their colours the background colour will often be removed.
|
31
|
+
// Adding a border to the component keeps it's shape as a circle.
|
32
|
+
border: 3px solid govuk-colour("black");
|
33
|
+
border-radius: 50%;
|
34
|
+
|
35
|
+
color: govuk-colour("white");
|
36
|
+
background: govuk-colour("black");
|
37
|
+
|
38
|
+
font-size: 30px;
|
39
|
+
line-height: 29px;
|
40
|
+
|
41
|
+
text-align: center;
|
42
|
+
|
43
|
+
// Prevent the exclamation mark from being included when the warning text
|
44
|
+
// is copied, for example.
|
45
|
+
-webkit-user-select: none;
|
46
|
+
-moz-user-select: none;
|
47
|
+
-ms-user-select: none;
|
48
|
+
user-select: none;
|
49
|
+
}
|
50
|
+
|
51
|
+
.govuk-warning-text__text {
|
52
|
+
@include govuk-font($size: 19, $weight: bold);
|
53
|
+
@include govuk-text-colour;
|
54
|
+
display: block;
|
55
|
+
padding-left: 45px;
|
56
|
+
}
|
57
|
+
}
|
@@ -1,60 +1,2 @@
|
|
1
|
-
@import "../../
|
2
|
-
@import "
|
3
|
-
@import "../../helpers/all";
|
4
|
-
|
5
|
-
@include govuk-exports("govuk/component/warning-text") {
|
6
|
-
|
7
|
-
.govuk-warning-text {
|
8
|
-
position: relative;
|
9
|
-
@include govuk-responsive-margin(6, "bottom");
|
10
|
-
padding: govuk-spacing(2) 0;
|
11
|
-
}
|
12
|
-
|
13
|
-
.govuk-warning-text__assistive {
|
14
|
-
@include govuk-visually-hidden;
|
15
|
-
}
|
16
|
-
|
17
|
-
.govuk-warning-text__icon {
|
18
|
-
@include govuk-font($size: false, $weight: bold);
|
19
|
-
|
20
|
-
display: inline-block;
|
21
|
-
|
22
|
-
position: absolute;
|
23
|
-
left: 0;
|
24
|
-
|
25
|
-
min-width: 29px;
|
26
|
-
min-height: 29px;
|
27
|
-
margin-top: -7px;
|
28
|
-
|
29
|
-
@include govuk-media-query($from: tablet) {
|
30
|
-
margin-top: -5px;
|
31
|
-
}
|
32
|
-
|
33
|
-
// When a user customises their colours the background colour will often be removed.
|
34
|
-
// Adding a border to the component keeps it's shape as a circle.
|
35
|
-
border: 3px solid govuk-colour("black");
|
36
|
-
border-radius: 50%;
|
37
|
-
|
38
|
-
color: govuk-colour("white");
|
39
|
-
background: govuk-colour("black");
|
40
|
-
|
41
|
-
font-size: 30px;
|
42
|
-
line-height: 29px;
|
43
|
-
|
44
|
-
text-align: center;
|
45
|
-
|
46
|
-
// Prevent the exclamation mark from being included when the warning text
|
47
|
-
// is copied, for example.
|
48
|
-
-webkit-user-select: none;
|
49
|
-
-moz-user-select: none;
|
50
|
-
-ms-user-select: none;
|
51
|
-
user-select: none;
|
52
|
-
}
|
53
|
-
|
54
|
-
.govuk-warning-text__text {
|
55
|
-
@include govuk-font($size: 19, $weight: bold);
|
56
|
-
@include govuk-text-colour;
|
57
|
-
display: block;
|
58
|
-
padding-left: 45px;
|
59
|
-
}
|
60
|
-
}
|
1
|
+
@import "../../base";
|
2
|
+
@import "./index";
|
@@ -1,6 +1,8 @@
|
|
1
|
-
@
|
2
|
-
@
|
3
|
-
|
1
|
+
@if not mixin-exists("govuk-exports") {
|
2
|
+
@warn "Importing items from the core layer without first importing `base` is deprecated, and will no longer work as of GOV.UK Frontend v4.0.";
|
3
|
+
}
|
4
|
+
|
5
|
+
@import "../base";
|
4
6
|
|
5
7
|
@import "links";
|
6
8
|
@import "typography";
|
@@ -1,6 +1,8 @@
|
|
1
|
-
@
|
2
|
-
@
|
3
|
-
|
1
|
+
@if not mixin-exists("govuk-exports") {
|
2
|
+
@warn "Importing items from the core layer without first importing `base` is deprecated, and will no longer work as of GOV.UK Frontend v4.0.";
|
3
|
+
}
|
4
|
+
|
5
|
+
@import "../base";
|
4
6
|
|
5
7
|
@include govuk-exports("govuk/core/links") {
|
6
8
|
|
@@ -1,6 +1,8 @@
|
|
1
|
-
@
|
2
|
-
@
|
3
|
-
|
1
|
+
@if not mixin-exists("govuk-exports") {
|
2
|
+
@warn "Importing items from the core layer without first importing `base` is deprecated, and will no longer work as of GOV.UK Frontend v4.0.";
|
3
|
+
}
|
4
|
+
|
5
|
+
@import "../base";
|
4
6
|
|
5
7
|
@include govuk-exports("govuk/core/lists") {
|
6
8
|
|
@@ -48,6 +50,14 @@
|
|
48
50
|
}
|
49
51
|
}
|
50
52
|
|
53
|
+
%govuk-list--spaced > li {
|
54
|
+
margin-bottom: govuk-spacing(2);
|
55
|
+
|
56
|
+
@include govuk-media-query($from: tablet) {
|
57
|
+
margin-bottom: govuk-spacing(3);
|
58
|
+
}
|
59
|
+
}
|
60
|
+
|
51
61
|
.govuk-list--bullet {
|
52
62
|
@extend %govuk-list--bullet;
|
53
63
|
}
|
@@ -55,4 +65,8 @@
|
|
55
65
|
.govuk-list--number {
|
56
66
|
@extend %govuk-list--number;
|
57
67
|
}
|
68
|
+
|
69
|
+
.govuk-list--spaced {
|
70
|
+
@extend %govuk-list--spaced;
|
71
|
+
}
|
58
72
|
}
|
@@ -1,6 +1,8 @@
|
|
1
|
-
@
|
2
|
-
@
|
3
|
-
|
1
|
+
@if not mixin-exists("govuk-exports") {
|
2
|
+
@warn "Importing items from the core layer without first importing `base` is deprecated, and will no longer work as of GOV.UK Frontend v4.0.";
|
3
|
+
}
|
4
|
+
|
5
|
+
@import "../base";
|
4
6
|
|
5
7
|
@include govuk-exports("govuk/core/section-break") {
|
6
8
|
|
@@ -1,6 +1,8 @@
|
|
1
|
-
@
|
2
|
-
@
|
3
|
-
|
1
|
+
@if not mixin-exists("govuk-exports") {
|
2
|
+
@warn "Importing items from the core layer without first importing `base` is deprecated, and will no longer work as of GOV.UK Frontend v4.0.";
|
3
|
+
}
|
4
|
+
|
5
|
+
@import "../base";
|
4
6
|
|
5
7
|
@include govuk-exports("govuk/core/template") {
|
6
8
|
|
@@ -1,6 +1,8 @@
|
|
1
|
-
@
|
2
|
-
@
|
3
|
-
|
1
|
+
@if not mixin-exists("govuk-exports") {
|
2
|
+
@warn "Importing items from the core layer without first importing `base` is deprecated, and will no longer work as of GOV.UK Frontend v4.0.";
|
3
|
+
}
|
4
|
+
|
5
|
+
@import "../base";
|
4
6
|
|
5
7
|
@include govuk-exports("govuk/core/typography") {
|
6
8
|
|
@@ -52,7 +52,7 @@
|
|
52
52
|
/// colour will be returned which meets contrast requirements . If you want to
|
53
53
|
/// use the non-websafe version you can set this to `false` but your should
|
54
54
|
/// ensure that you still meets contrast requirements for accessibility - for
|
55
|
-
/// example,
|
55
|
+
/// example, do not use the non-websafe version for text.
|
56
56
|
///
|
57
57
|
/// @return {Colour} Representation of colour for organisation
|
58
58
|
/// @throw if `$organisation` is not a known organisation
|
@@ -28,10 +28,10 @@
|
|
28
28
|
/// @access public
|
29
29
|
|
30
30
|
@mixin govuk-device-pixel-ratio($ratio: 2) {
|
31
|
+
// stylelint-disable indentation
|
31
32
|
@media only screen and (-webkit-min-device-pixel-ratio: $ratio),
|
32
|
-
only screen and (
|
33
|
-
only screen and (
|
34
|
-
only screen and ( min-resolution: #{$ratio}dppx) {
|
33
|
+
only screen and (min-resolution: #{($ratio * 96)}dpi),
|
34
|
+
only screen and (min-resolution: #{$ratio}dppx) {
|
35
35
|
@content;
|
36
36
|
}
|
37
37
|
}
|
@@ -2,9 +2,6 @@
|
|
2
2
|
/// @group helpers
|
3
3
|
////
|
4
4
|
|
5
|
-
// Disables linting for this file only
|
6
|
-
// sass-lint:disable no-css-comments, no-duplicate-properties, property-sort-order, indentation
|
7
|
-
|
8
5
|
@import "../tools/exports";
|
9
6
|
|
10
7
|
/// Font Face - GDS Transport
|
@@ -18,23 +15,24 @@
|
|
18
15
|
@include govuk-not-ie8 { // In IE8, which cannot render WOFF format, we fall back to system fonts
|
19
16
|
@include govuk-exports("govuk/helpers/font-faces") {
|
20
17
|
@at-root {
|
21
|
-
/*! Copyright (c) 2011 by Margaret Calvert & Henrik Kubel. All rights reserved. The font has been customised for exclusive use on gov.uk. This cut is not commercially available. */
|
22
|
-
|
18
|
+
/*! Copyright (c) 2011 by Margaret Calvert & Henrik Kubel. All rights reserved. The font has been customised for exclusive use on gov.uk. This cut is not commercially available. */ /* stylelint-disable-line scss/comment-no-loud */
|
23
19
|
@font-face {
|
24
20
|
font-family: "GDS Transport";
|
25
|
-
src: govuk-font-url("light-94a07e06a1-v2.woff2") format("woff2"),
|
26
|
-
govuk-font-url("light-f591b13f7d-v2.woff") format("woff");
|
27
|
-
font-weight: normal;
|
28
21
|
font-style: normal;
|
22
|
+
font-weight: normal;
|
23
|
+
src:
|
24
|
+
govuk-font-url("light-94a07e06a1-v2.woff2") format("woff2"),
|
25
|
+
govuk-font-url("light-f591b13f7d-v2.woff") format("woff");
|
29
26
|
font-display: fallback;
|
30
27
|
}
|
31
28
|
|
32
29
|
@font-face {
|
33
30
|
font-family: "GDS Transport";
|
34
|
-
src: govuk-font-url("bold-b542beb274-v2.woff2") format("woff2"),
|
35
|
-
govuk-font-url("bold-affa96571d-v2.woff") format("woff");
|
36
|
-
font-weight: bold;
|
37
31
|
font-style: normal;
|
32
|
+
font-weight: bold;
|
33
|
+
src:
|
34
|
+
govuk-font-url("bold-b542beb274-v2.woff2") format("woff2"),
|
35
|
+
govuk-font-url("bold-affa96571d-v2.woff") format("woff");
|
38
36
|
font-display: fallback;
|
39
37
|
}
|
40
38
|
}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
////
|
2
|
-
/// @group helpers
|
2
|
+
/// @group helpers/layout
|
3
3
|
////
|
4
4
|
|
5
5
|
/// Grid width percentage
|
@@ -44,6 +44,7 @@
|
|
44
44
|
/// @example scss - Customising the float direction
|
45
45
|
/// .govuk-grid-column-one-half-right {
|
46
46
|
/// @include govuk-grid-column(two-thirds, $float: right);
|
47
|
+
/// }
|
47
48
|
///
|
48
49
|
/// @access public
|
49
50
|
|
@@ -1,5 +1,5 @@
|
|
1
1
|
////
|
2
|
-
/// @group helpers
|
2
|
+
/// @group helpers/links
|
3
3
|
////
|
4
4
|
|
5
5
|
/// Common link mixin
|
@@ -66,6 +66,100 @@
|
|
66
66
|
}
|
67
67
|
}
|
68
68
|
|
69
|
+
/// Error link style mixin
|
70
|
+
///
|
71
|
+
/// Provides the error unvisited, visited, hover and active states for links.
|
72
|
+
///
|
73
|
+
/// If you use this mixin in a component you must also include the
|
74
|
+
/// govuk-link-common mixin in order to get the focus state.
|
75
|
+
///
|
76
|
+
/// @example scss
|
77
|
+
/// .govuk-component__link {
|
78
|
+
/// @include govuk-link-common;
|
79
|
+
/// @include govuk-link-style-error;
|
80
|
+
/// }
|
81
|
+
///
|
82
|
+
/// @access public
|
83
|
+
|
84
|
+
@mixin govuk-link-style-error {
|
85
|
+
&:link,
|
86
|
+
&:visited {
|
87
|
+
color: $govuk-error-colour;
|
88
|
+
}
|
89
|
+
|
90
|
+
&:hover {
|
91
|
+
color: scale-color($govuk-error-colour, $lightness: -30%);
|
92
|
+
}
|
93
|
+
|
94
|
+
&:active {
|
95
|
+
color: $govuk-error-colour;
|
96
|
+
}
|
97
|
+
|
98
|
+
// When focussed, the text colour needs to be darker to ensure that colour
|
99
|
+
// contrast is still acceptable
|
100
|
+
&:focus {
|
101
|
+
color: $govuk-focus-text-colour;
|
102
|
+
}
|
103
|
+
|
104
|
+
// alphagov/govuk_template includes a specific a:link:focus selector
|
105
|
+
// designed to make unvisited link s a slightly darker blue when focussed, so
|
106
|
+
// we need to override the text colour for that combination of selectors so
|
107
|
+
// so that unvisited links styled as buttons do not end up with dark blue
|
108
|
+
// text when focussed.
|
109
|
+
@include govuk-compatibility(govuk_template) {
|
110
|
+
&:link:focus {
|
111
|
+
color: $govuk-focus-text-colour;
|
112
|
+
}
|
113
|
+
}
|
114
|
+
}
|
115
|
+
|
116
|
+
/// Success link style mixin
|
117
|
+
///
|
118
|
+
/// Provides the success unvisited, visited, hover and active states for links.
|
119
|
+
///
|
120
|
+
/// If you use this mixin in a component you must also include the
|
121
|
+
/// govuk-link-common mixin in order to get the focus state.
|
122
|
+
///
|
123
|
+
/// @example scss
|
124
|
+
/// .govuk-component__link {
|
125
|
+
/// @include govuk-link-common;
|
126
|
+
/// @include govuk-link-style-success;
|
127
|
+
/// }
|
128
|
+
///
|
129
|
+
/// @access public
|
130
|
+
|
131
|
+
@mixin govuk-link-style-success {
|
132
|
+
&:link,
|
133
|
+
&:visited {
|
134
|
+
color: $govuk-success-colour;
|
135
|
+
}
|
136
|
+
|
137
|
+
&:hover {
|
138
|
+
color: scale-color($govuk-success-colour, $lightness: -30%);
|
139
|
+
}
|
140
|
+
|
141
|
+
&:active {
|
142
|
+
color: $govuk-success-colour;
|
143
|
+
}
|
144
|
+
|
145
|
+
// When focussed, the text colour needs to be darker to ensure that colour
|
146
|
+
// contrast is still acceptable
|
147
|
+
&:focus {
|
148
|
+
color: $govuk-focus-text-colour;
|
149
|
+
}
|
150
|
+
|
151
|
+
// alphagov/govuk_template includes a specific a:link:focus selector
|
152
|
+
// designed to make unvisited link s a slightly darker blue when focussed, so
|
153
|
+
// we need to override the text colour for that combination of selectors so
|
154
|
+
// so that unvisited links styled as buttons do not end up with dark blue
|
155
|
+
// text when focussed.
|
156
|
+
@include govuk-compatibility(govuk_template) {
|
157
|
+
&:link:focus {
|
158
|
+
color: $govuk-focus-text-colour;
|
159
|
+
}
|
160
|
+
}
|
161
|
+
}
|
162
|
+
|
69
163
|
/// Muted style link mixin
|
70
164
|
///
|
71
165
|
/// Used for secondary links on a page - the link will appear in muted colours
|
@@ -142,7 +236,6 @@
|
|
142
236
|
}
|
143
237
|
}
|
144
238
|
|
145
|
-
|
146
239
|
/// No visited state link mixin
|
147
240
|
///
|
148
241
|
/// Used in cases where it is not helpful to distinguish between visited and
|
@@ -196,11 +289,10 @@
|
|
196
289
|
|
197
290
|
@mixin govuk-link-print-friendly {
|
198
291
|
@include govuk-media-query($media-type: print) {
|
199
|
-
|
200
292
|
&[href^="/"],
|
201
293
|
&[href^="http://"],
|
202
294
|
&[href^="https://"] {
|
203
|
-
|
295
|
+
&:after {
|
204
296
|
content: " (" attr(href) ")";
|
205
297
|
font-size: 90%;
|
206
298
|
|