@nice-digital/nds-core 1.3.4-alpha.0 → 1.3.5-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -3
- package/scss/colours/_index.scss +2 -0
- package/scss/{settings/_settings-colours-nice.scss → colours/_nice-brand.scss} +17 -17
- package/scss/{settings/_settings-colours-semantic.scss → colours/_semantic.scss} +58 -58
- package/scss/{helpers/_helpers-focus.scss → focus/_index.scss} +15 -11
- package/scss/{helpers/_helpers-glyphs.scss → glyphs/_index.scss} +10 -10
- package/scss/layout/_index.scss +43 -0
- package/scss/media-queries/_index.scss +29 -0
- package/scss/media-queries/vendor/_mq.scss +307 -0
- package/scss/{settings/_settings-modular-scale.scss → modular-scale/_index.scss} +6 -6
- package/scss/settings/_settings-colour-alias-tokens.scss +53 -0
- package/scss/settings/{_settings-colour-global.scss → _settings-colour-global-tokens.scss} +18 -1
- package/scss/spacing/_index.scss +31 -0
- package/scss/typography/{_typography-headings.scss → _headings.scss} +18 -16
- package/scss/typography/_helpers.scss +171 -0
- package/scss/typography/_index.scss +4 -0
- package/scss/typography/_links.scss +76 -0
- package/scss/{settings/_settings-typography.scss → typography/_settings.scss} +38 -34
- package/scss/{helpers/_helpers-utils.scss → utils/_index.scss} +16 -12
- package/scss/{vendor/_vendor-is.scss → utils/vendor/_is.scss} +0 -0
- package/scss/{vendor/_vendor-math.scss → utils/vendor/_math.scss} +0 -0
- package/scss/visibility/_index.scss +65 -0
- package/scss/core.scss +0 -4
- package/scss/helpers/_helpers-clearfix.scss +0 -23
- package/scss/helpers/_helpers-lists.scss +0 -45
- package/scss/helpers/_helpers-print.scss +0 -35
- package/scss/helpers/_helpers-text.scss +0 -21
- package/scss/helpers/_helpers-visibility.scss +0 -37
- package/scss/helpers/_helpers.scss +0 -2
- package/scss/layout/_layout-container.scss +0 -12
- package/scss/layout/_layout.scss +0 -1
- package/scss/settings/_settings-breakpoints.scss +0 -25
- package/scss/settings/_settings-glyphs.scss +0 -3
- package/scss/settings/_settings-layout.scss +0 -15
- package/scss/settings/_settings-mq.scss +0 -17
- package/scss/settings/_settings-print.scss +0 -5
- package/scss/settings/_settings-spacing.scss +0 -43
- package/scss/settings/_settings.scss +0 -4
- package/scss/typography/_typography-helpers.scss +0 -148
- package/scss/typography/_typography-links.scss +0 -73
- package/scss/typography/_typography.scss +0 -1
- package/scss/vendor/_vendor.scss +0 -2
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
////
|
|
2
|
-
/// @group spacing
|
|
3
|
-
////
|
|
4
|
-
|
|
5
|
-
/// Extra extra small spacing
|
|
6
|
-
/// @since 0.2.0
|
|
7
|
-
$nds-spacing-xx-small: 2;
|
|
8
|
-
|
|
9
|
-
/// Extra small spacing
|
|
10
|
-
/// @since 0.2.0
|
|
11
|
-
$nds-spacing-x-small: 4;
|
|
12
|
-
|
|
13
|
-
/// Small spacing
|
|
14
|
-
/// @since 0.2.0
|
|
15
|
-
$nds-spacing-small: 8;
|
|
16
|
-
|
|
17
|
-
/// Medium spacing
|
|
18
|
-
/// @since 0.2.0
|
|
19
|
-
$nds-spacing-medium: 16;
|
|
20
|
-
|
|
21
|
-
/// Large spacing
|
|
22
|
-
/// @since 0.2.0
|
|
23
|
-
$nds-spacing-large: 32;
|
|
24
|
-
|
|
25
|
-
/// Extra large spacing
|
|
26
|
-
/// @since 0.2.0
|
|
27
|
-
$nds-spacing-x-large: 48;
|
|
28
|
-
|
|
29
|
-
/// Extra extra large spacing
|
|
30
|
-
/// @since 0.2.0
|
|
31
|
-
$nds-spacing-xx-large: 64;
|
|
32
|
-
|
|
33
|
-
/// A map of spacing values
|
|
34
|
-
/// @since 0.2.15
|
|
35
|
-
$nds-spacings: (
|
|
36
|
-
xx-small: $nds-spacing-xx-small,
|
|
37
|
-
x-small: $nds-spacing-x-small,
|
|
38
|
-
small: $nds-spacing-small,
|
|
39
|
-
medium: $nds-spacing-medium,
|
|
40
|
-
large: $nds-spacing-large,
|
|
41
|
-
x-large: $nds-spacing-x-large,
|
|
42
|
-
xx-large: $nds-spacing-xx-large
|
|
43
|
-
);
|
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
////
|
|
2
|
-
/// @group Typography
|
|
3
|
-
////
|
|
4
|
-
|
|
5
|
-
/// Gets a font family from the `$nds-font-families` map, given a name
|
|
6
|
-
/// @param {String} $stack The stack name e.g. sans, serif or mono
|
|
7
|
-
/// @since 0.1.0
|
|
8
|
-
@function nds-get-font-family($stack) {
|
|
9
|
-
$result: map-get($nds-font-families, $stack);
|
|
10
|
-
@return unquote($result);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
/// Gets a numeric scale
|
|
14
|
-
/// @param $scale {Integer|Name} The integer ratio or named font-size.
|
|
15
|
-
/// @since 0.1.0
|
|
16
|
-
@function nds-get-scale-integer($scale) {
|
|
17
|
-
@if map-has-key($nds-named-font-sizes, $scale) {
|
|
18
|
-
@return map-get($nds-named-font-sizes, $scale);
|
|
19
|
-
} @else if is-integer($scale) {
|
|
20
|
-
@return $scale;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
@error '`$scale` must either be an integer or exist as a named font size in `$nds-named-font-sizes`';
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/// Gets a numeric font size (in px) from a given scale multiplier.
|
|
27
|
-
/// Usually not used directly - the font-size or font mixin is usually used instead.
|
|
28
|
-
/// @param $scale {Integer|Name} The integer ratio or named font-size.
|
|
29
|
-
/// @return {Number} Numeric font size (in px)
|
|
30
|
-
/// @example
|
|
31
|
-
/// $font-size: nds-get-font-size(2)
|
|
32
|
-
/// @example
|
|
33
|
-
/// $font-size: nds-get-font-size(h1)
|
|
34
|
-
/// @since 0.1.0
|
|
35
|
-
@function nds-get-font-size($scale) {
|
|
36
|
-
$scale-integer: nds-get-scale-integer($scale);
|
|
37
|
-
$font-map: map-get($nds-font-sizes, $scale-integer);
|
|
38
|
-
@return map-get($font-map, fs);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/// Gets a numeric line height (in px) from a given scale multiplier.
|
|
42
|
-
/// Usually not used directly - the font-size or font mixin is usually used instead.
|
|
43
|
-
/// @param $scale {Integer|Name} The integer ratio or named font-size.
|
|
44
|
-
/// @return {Number} Numeric line-height (in px)
|
|
45
|
-
/// @example
|
|
46
|
-
/// $line-height: nds-get-line-height(2)
|
|
47
|
-
/// @example
|
|
48
|
-
/// $line-height: nds-get-line-height(h1)
|
|
49
|
-
/// @since 0.1.0
|
|
50
|
-
@function nds-get-line-height($scale) {
|
|
51
|
-
$scale-integer: nds-get-scale-integer($scale);
|
|
52
|
-
$font-map: map-get($nds-font-sizes, $scale-integer);
|
|
53
|
-
@return map-get($font-map, lh);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
/// Applies font size and line-height for the given scale.
|
|
57
|
-
/// @param $scale {Integer|Name} The integer ratio or named font-size.
|
|
58
|
-
/// @param $important {Boolean} Whether to add an important declaration to the CSS rules.
|
|
59
|
-
/// @example
|
|
60
|
-
/// .test {
|
|
61
|
-
/// @include nds-font-size(-2);
|
|
62
|
-
/// }
|
|
63
|
-
/// @example
|
|
64
|
-
/// .test {
|
|
65
|
-
/// @include nds-font-size(h1, true);
|
|
66
|
-
/// }
|
|
67
|
-
/// @since 0.1.0
|
|
68
|
-
@mixin nds-font-size($scale: 0, $important: false) {
|
|
69
|
-
$font-size: nds-get-font-size($scale);
|
|
70
|
-
$line-height: nds-get-line-height($scale);
|
|
71
|
-
|
|
72
|
-
@if $important {
|
|
73
|
-
font-size: rem($font-size) !important;
|
|
74
|
-
line-height: rem($line-height) !important;
|
|
75
|
-
} @else {
|
|
76
|
-
font-size: rem($font-size);
|
|
77
|
-
line-height: rem($line-height);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
/// Nice font: includes font size, line height, and margins.
|
|
82
|
-
/// @param $scale {Integer|Name} The integer ratio or named font-size.
|
|
83
|
-
/// @param $important {Boolean} Whether to add an important declaration to the CSS rules.
|
|
84
|
-
/// @example
|
|
85
|
-
/// .test {
|
|
86
|
-
/// @include nds-font(3);
|
|
87
|
-
/// }
|
|
88
|
-
/// @example
|
|
89
|
-
/// .test {
|
|
90
|
-
/// @include nds-font(h1, true);
|
|
91
|
-
/// }
|
|
92
|
-
/// @since 0.1.0
|
|
93
|
-
@mixin nds-font($scale, $important: false) {
|
|
94
|
-
$scale-integer: nds-get-scale-integer($scale);
|
|
95
|
-
$font-map: map-get($nds-font-sizes, $scale-integer);
|
|
96
|
-
@include nds-font-size($scale, $important);
|
|
97
|
-
|
|
98
|
-
@if $important {
|
|
99
|
-
margin-bottom: rem(map-get($font-map, mb)) !important;
|
|
100
|
-
margin-top: rem(map-get($font-map, mt)) !important;
|
|
101
|
-
} @else {
|
|
102
|
-
margin-bottom: rem(map-get($font-map, mb));
|
|
103
|
-
margin-top: rem(map-get($font-map, mt));
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
/// Default paragraph style
|
|
108
|
-
/// @since 0.5.2
|
|
109
|
-
@mixin nds-p {
|
|
110
|
-
@include nds-font(p);
|
|
111
|
-
font-feature-settings: 'kern', 'onum', 'liga';
|
|
112
|
-
font-weight: normal;
|
|
113
|
-
max-width: 66ch;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
/// Lead paragraph style
|
|
117
|
-
/// @since 0.2.12
|
|
118
|
-
@mixin nds-lead {
|
|
119
|
-
@include nds-font(lead);
|
|
120
|
-
font-weight: normal;
|
|
121
|
-
max-width: 66ch;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
/// Base list style
|
|
125
|
-
/// @since 0.1.0
|
|
126
|
-
@mixin nds-list {
|
|
127
|
-
font-feature-settings: 'kern', 'onum', 'liga';
|
|
128
|
-
margin-left: rem($nds-spacing-medium);
|
|
129
|
-
max-width: 66ch;
|
|
130
|
-
padding: 0;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
// TODO: default-error-style probably belongs elsewhere?
|
|
134
|
-
|
|
135
|
-
/// The highlight style used for elements like inputs and textareas
|
|
136
|
-
/// if there's an error on the field
|
|
137
|
-
/// @param {Boolean} $rounded whether to use box shadow for border (outline can't be styled to have radius corners)
|
|
138
|
-
/// @output default styling for form elements in an errored state
|
|
139
|
-
/// @since 1.0
|
|
140
|
-
@mixin nds-default-error-style($rounded: false) {
|
|
141
|
-
@if $rounded {
|
|
142
|
-
box-shadow: 0 0 0 rem($nds-spacing-x-small) $nds-colour-error;
|
|
143
|
-
outline: $nds-spacing-x-small solid transparent;
|
|
144
|
-
outline-offset: $nds-spacing-x-small;
|
|
145
|
-
} @else {
|
|
146
|
-
outline: rem($nds-spacing-x-small) solid $nds-colour-error;
|
|
147
|
-
}
|
|
148
|
-
}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
////
|
|
2
|
-
/// @group Typography
|
|
3
|
-
////
|
|
4
|
-
|
|
5
|
-
/// Default link style for use on a normal (light) background
|
|
6
|
-
/// @since 0.3.1
|
|
7
|
-
@mixin nds-link-default {
|
|
8
|
-
color: $nds-colour-link;
|
|
9
|
-
-webkit-tap-highlight-color: rgba($nds-colour-focus, 0.333);
|
|
10
|
-
text-decoration: underline;
|
|
11
|
-
text-decoration-skip-ink: auto;
|
|
12
|
-
|
|
13
|
-
&:visited {
|
|
14
|
-
color: $nds-colour-link-visited;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
&:hover {
|
|
18
|
-
color: $nds-colour-link-hover;
|
|
19
|
-
text-decoration-thickness: 0.15rem;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
&:focus {
|
|
23
|
-
@include nds-default-focus-style;
|
|
24
|
-
color: $nds-colour-link-focus-text;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
&:active {
|
|
28
|
-
color: $nds-colour-link-active;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
/// Default links for use on a light background
|
|
32
|
-
/// @require {mixin} link-default
|
|
33
|
-
/// @since 0.5.0
|
|
34
|
-
@mixin nds-links-default {
|
|
35
|
-
a {
|
|
36
|
-
@include nds-link-default;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/// Inverse link style for use on an inverse (dark) background
|
|
41
|
-
/// @since 0.3.1
|
|
42
|
-
@mixin nds-link-inverse {
|
|
43
|
-
color: $nds-colour-link-inverse;
|
|
44
|
-
-webkit-tap-highlight-color: rgba($nds-colour-focus, 0.333);
|
|
45
|
-
text-decoration: underline;
|
|
46
|
-
text-decoration-skip-ink: auto;
|
|
47
|
-
|
|
48
|
-
&:visited {
|
|
49
|
-
color: $nds-colour-link-inverse-visited;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
&:hover {
|
|
53
|
-
color: $nds-colour-link-inverse-hover;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
&:focus {
|
|
57
|
-
@include nds-inverse-focus-style;
|
|
58
|
-
color: $nds-colour-link-inverse-focus-text;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
&:active {
|
|
62
|
-
color: $nds-colour-link-inverse-active;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
/// Inverse links for use on a dark background
|
|
67
|
-
/// @require {mixin} link-inverse
|
|
68
|
-
/// @since 0.3.1
|
|
69
|
-
@mixin nds-links-inverse {
|
|
70
|
-
a {
|
|
71
|
-
@include nds-link-inverse;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@import 'typography-helpers', 'typography-links', 'typography-headings';
|
package/scss/vendor/_vendor.scss
DELETED