@nice-digital/nds-core 1.3.2 → 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 +5 -5
- 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-tokens.scss +44 -0
- package/scss/spacing/_index.scss +31 -0
- package/scss/typography/{_typography-headings.scss → _headings.scss} +22 -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} +42 -38
- 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,21 +0,0 @@
|
|
|
1
|
-
////
|
|
2
|
-
/// @group helpers
|
|
3
|
-
////
|
|
4
|
-
|
|
5
|
-
/// Text truncate
|
|
6
|
-
/// Requires inline-block or block for proper styling
|
|
7
|
-
/// @since 0.1.0
|
|
8
|
-
@mixin nds-text-truncate {
|
|
9
|
-
overflow: hidden;
|
|
10
|
-
text-overflow: ellipsis;
|
|
11
|
-
white-space: nowrap;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
/// Set and element to display as block and align
|
|
15
|
-
/// centrally via auto left/right margins
|
|
16
|
-
/// @since 0.1.0
|
|
17
|
-
@mixin nds-center-block {
|
|
18
|
-
display: block;
|
|
19
|
-
margin-left: auto;
|
|
20
|
-
margin-right: auto;
|
|
21
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
////
|
|
2
|
-
/// @group helpers
|
|
3
|
-
////
|
|
4
|
-
|
|
5
|
-
//## Mixins
|
|
6
|
-
|
|
7
|
-
/// Portrait media query
|
|
8
|
-
@mixin nds-portrait {
|
|
9
|
-
@media screen and (orientation: portrait) {
|
|
10
|
-
@content;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
/// Landscape media query
|
|
15
|
-
@mixin nds-landscape {
|
|
16
|
-
@media screen and (orientation: landscape) {
|
|
17
|
-
@content;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
/// Makes an element visually hidden, but still accessible to keyboards and assistive devices.
|
|
22
|
-
@mixin nds-invisible {
|
|
23
|
-
clip: rect(0, 0, 0, 0);
|
|
24
|
-
height: 1px;
|
|
25
|
-
overflow: hidden;
|
|
26
|
-
position: absolute !important;
|
|
27
|
-
width: 1px;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/// Reverses the CSS output created by the `invisible()` mixin.
|
|
31
|
-
@mixin nds-invisible-off {
|
|
32
|
-
clip: auto;
|
|
33
|
-
height: auto;
|
|
34
|
-
overflow: visible;
|
|
35
|
-
position: static !important;
|
|
36
|
-
width: auto;
|
|
37
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
////
|
|
2
|
-
/// @group components
|
|
3
|
-
////
|
|
4
|
-
|
|
5
|
-
/// Container placeholder.
|
|
6
|
-
/// @since 1.0.0
|
|
7
|
-
@mixin nds-container {
|
|
8
|
-
margin: auto;
|
|
9
|
-
max-width: rem($nds-container-max-width);
|
|
10
|
-
width: 96%; // IE11 support for calc not consistent https://caniuse.com/calc (See "Known issues")
|
|
11
|
-
width: calc(100% - #{rem($nds-container-gutter * 2)});
|
|
12
|
-
}
|
package/scss/layout/_layout.scss
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@import 'layout-container';
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/// Extra small break point
|
|
2
|
-
/// @since 0.2.0
|
|
3
|
-
$nds-breakpoint-xs: 400px !default;
|
|
4
|
-
|
|
5
|
-
/// 'Small' break point. Roughly portrait tablets.
|
|
6
|
-
/// @since 0.2.0
|
|
7
|
-
$nds-breakpoint-sm: 600px !default;
|
|
8
|
-
|
|
9
|
-
/// 'Medium' break point. Roughly landscape tablets.
|
|
10
|
-
/// @since 0.2.0
|
|
11
|
-
$nds-breakpoint-md: 900px !default;
|
|
12
|
-
|
|
13
|
-
/// 'Large' break point. Roughly 'dektops'.
|
|
14
|
-
/// @since 0.2.0
|
|
15
|
-
$nds-breakpoint-lg: 1200px !default;
|
|
16
|
-
|
|
17
|
-
/// 'Extra large' break point for wide screens
|
|
18
|
-
/// @since 0.2.0
|
|
19
|
-
$nds-breakpoint-xl: 1600px !default;
|
|
20
|
-
|
|
21
|
-
/// Whether the site is responsive. Setting to false will disable
|
|
22
|
-
/// generation of the responsie grid selectors.
|
|
23
|
-
/// True by default.
|
|
24
|
-
/// @since 0.2.0
|
|
25
|
-
$nds-responsive: true !default;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
////
|
|
2
|
-
/// @group grid
|
|
3
|
-
////
|
|
4
|
-
|
|
5
|
-
/// The maximum width of the default container, in pixels
|
|
6
|
-
/// @since 0.5.2
|
|
7
|
-
$nds-container-max-width: 1170;
|
|
8
|
-
|
|
9
|
-
/// The gutter for the default container
|
|
10
|
-
/// @since 1.0.0
|
|
11
|
-
$nds-container-gutter: $nds-spacing-medium;
|
|
12
|
-
|
|
13
|
-
/// The maximum content width to ensure good readability
|
|
14
|
-
/// @since 1.7.0
|
|
15
|
-
$nds-readable-width: 66ch;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
// SASS MQ OVERRIDES
|
|
2
|
-
|
|
3
|
-
// A map of breakpoints (name: px) required for SASS MQ
|
|
4
|
-
$mq-breakpoints: (
|
|
5
|
-
xs: $nds-breakpoint-xs,
|
|
6
|
-
sm: $nds-breakpoint-sm,
|
|
7
|
-
md: $nds-breakpoint-md,
|
|
8
|
-
lg: $nds-breakpoint-lg,
|
|
9
|
-
xl: $nds-breakpoint-xl
|
|
10
|
-
);
|
|
11
|
-
|
|
12
|
-
// Base font size
|
|
13
|
-
$mq-base-font-size: $nds-base-font-size * 1px;
|
|
14
|
-
|
|
15
|
-
$mq-static-breakpoint: lg;
|
|
16
|
-
|
|
17
|
-
$mq-responsive: $nds-responsive;
|
|
@@ -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