@nice-digital/nds-core 1.3.3-alpha.0 → 2.0.0-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 +1 -0
- package/scss/colours/tokens/_alias.scss +163 -0
- package/scss/colours/tokens/_global.scss +47 -0
- package/scss/{helpers/_helpers-focus.scss → focus/_index.scss} +15 -11
- package/scss/{helpers/_helpers-glyphs.scss → glyphs/_index.scss} +12 -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} +9 -7
- package/scss/spacing/_index.scss +31 -0
- package/scss/typography/{_typography-headings.scss → _headings.scss} +20 -19
- package/scss/typography/_helpers.scss +172 -0
- package/scss/typography/_index.scss +4 -0
- package/scss/typography/_links.scss +78 -0
- package/scss/{settings/_settings-typography.scss → typography/_settings.scss} +38 -34
- package/scss/{helpers/_helpers-utils.scss → utils/_index.scss} +22 -19
- package/scss/{vendor/_vendor-is.scss → utils/vendor/_is.scss} +8 -6
- 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-colours-nice.scss +0 -80
- package/scss/settings/_settings-colours-semantic.scss +0 -247
- 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-math.scss +0 -79
- package/scss/vendor/_vendor.scss +0 -2
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
@use 'sass:color';
|
|
2
|
+
@use '../colours';
|
|
3
|
+
@use '../focus';
|
|
4
|
+
|
|
5
|
+
////
|
|
6
|
+
/// @group Typography
|
|
7
|
+
////
|
|
8
|
+
|
|
9
|
+
/// Default link style for use on a normal (light) background
|
|
10
|
+
/// @since 0.3.1
|
|
11
|
+
@mixin link-default {
|
|
12
|
+
color: colours.$link;
|
|
13
|
+
-webkit-tap-highlight-color: color.adjust(colours.$focus, $alpha: -0.666);
|
|
14
|
+
text-decoration: underline;
|
|
15
|
+
text-decoration-skip-ink: auto;
|
|
16
|
+
|
|
17
|
+
&:visited {
|
|
18
|
+
color: colours.$link-visited;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
&:hover {
|
|
22
|
+
color: colours.$link-hover;
|
|
23
|
+
text-decoration-thickness: 0.15rem;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&:focus {
|
|
27
|
+
@include focus.default-focus-style;
|
|
28
|
+
color: colours.$link-focus;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
&:active {
|
|
32
|
+
color: colours.$link-active;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/// Default links for use on a light background
|
|
37
|
+
/// @require {mixin} link-default
|
|
38
|
+
/// @since 0.5.0
|
|
39
|
+
@mixin links-default {
|
|
40
|
+
a {
|
|
41
|
+
@include link-default;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/// Inverse link style for use on an inverse (dark) background
|
|
46
|
+
/// @since 0.3.1
|
|
47
|
+
@mixin link-inverse {
|
|
48
|
+
color: colours.$link-inverse;
|
|
49
|
+
-webkit-tap-highlight-color: color.adjust(colours.$focus, $alpha: -0.666);
|
|
50
|
+
text-decoration: underline;
|
|
51
|
+
text-decoration-skip-ink: auto;
|
|
52
|
+
|
|
53
|
+
&:visited {
|
|
54
|
+
color: colours.$link-inverse-visited;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
&:hover {
|
|
58
|
+
color: colours.$link-inverse-hover;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
&:focus {
|
|
62
|
+
@include focus.inverse-focus-style;
|
|
63
|
+
color: colours.$link-inverse-focus;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
&:active {
|
|
67
|
+
color: colours.$link-inverse-active;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/// Inverse links for use on a dark background
|
|
72
|
+
/// @require {mixin} link-inverse
|
|
73
|
+
/// @since 0.3.1
|
|
74
|
+
@mixin links-inverse {
|
|
75
|
+
a {
|
|
76
|
+
@include link-inverse;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
@@ -1,26 +1,30 @@
|
|
|
1
|
+
@use '../media-queries';
|
|
2
|
+
@use '../spacing';
|
|
3
|
+
@use '../modular-scale';
|
|
4
|
+
|
|
1
5
|
/// Baseline, in pixels
|
|
2
6
|
/// @since 0.2.0
|
|
3
|
-
$
|
|
7
|
+
$baseline: 4 !default;
|
|
4
8
|
|
|
5
9
|
/// Base font size, in pixels
|
|
6
10
|
/// @since 0.2.0
|
|
7
|
-
$
|
|
11
|
+
$base-font-size: $baseline * 4 !default;
|
|
8
12
|
|
|
9
13
|
/// Base line height, in pixels
|
|
10
14
|
/// @since 0.2.0
|
|
11
|
-
$
|
|
15
|
+
$base-line-height: $baseline * 6 !default;
|
|
12
16
|
|
|
13
17
|
/// Sans-serif font stack
|
|
14
18
|
/// @since 2.0.0
|
|
15
|
-
$
|
|
19
|
+
$font-family-sans: 'Inter, "Helvetica Neue", Helvetica, Arial, sans-serif' !default;
|
|
16
20
|
|
|
17
21
|
/// Serif font stack
|
|
18
22
|
/// @since 2.0.0
|
|
19
|
-
$
|
|
23
|
+
$font-family-serif: 'Lora, Georgia, Times, serif' !default;
|
|
20
24
|
|
|
21
25
|
/// Mono font stack
|
|
22
26
|
/// @since 0.2.0
|
|
23
|
-
$
|
|
27
|
+
$font-family-mono: 'Monaco, Menlo, Consolas, "Courier New", monospace' !default;
|
|
24
28
|
|
|
25
29
|
/// The font families in use across NICE.
|
|
26
30
|
/// @prop {Font stack} sans [Inter, Helvetica Neue, Helvetica, Arial, sans-serif] The sans-serif font stack
|
|
@@ -28,33 +32,33 @@ $nds-font-family-mono: 'Monaco, Menlo, Consolas, "Courier New", monospace' !defa
|
|
|
28
32
|
/// @prop {Font stack} mono [Monaco, Menlo, Consolas, "Courier New", monospace] The monospace font stack
|
|
29
33
|
/// @see font-family
|
|
30
34
|
/// @since 0.2.0
|
|
31
|
-
$
|
|
32
|
-
sans: $
|
|
33
|
-
serif: $
|
|
34
|
-
mono: $
|
|
35
|
+
$font-families: (
|
|
36
|
+
sans: $font-family-sans,
|
|
37
|
+
serif: $font-family-serif,
|
|
38
|
+
mono: $font-family-mono
|
|
35
39
|
) !default;
|
|
36
40
|
|
|
37
41
|
/// The modular scale ratio to use for typography
|
|
38
42
|
/// @since 0.2.0
|
|
39
|
-
$
|
|
43
|
+
$type-ratio: modular-scale.get-ratio(fourth) !default;
|
|
40
44
|
|
|
41
45
|
/// The minimum root font size, in pixels
|
|
42
46
|
/// @since 0.2.13
|
|
43
|
-
$
|
|
47
|
+
$root-font-size-min: 15;
|
|
44
48
|
|
|
45
|
-
/// The maximum root font size, used from breakpoint `$
|
|
49
|
+
/// The maximum root font size, used from breakpoint `$root-font-size-max-breakpoint`
|
|
46
50
|
/// @since 0.2.13
|
|
47
|
-
$
|
|
51
|
+
$root-font-size-max: 18;
|
|
48
52
|
|
|
49
53
|
/// The breakpoint at which the root font size starts changing from minimum
|
|
50
54
|
/// towards maximum.
|
|
51
55
|
/// @since 0.2.13
|
|
52
|
-
$
|
|
56
|
+
$root-font-size-min-breakpoint: media-queries.$md;
|
|
53
57
|
|
|
54
58
|
/// The breakpoint at which the root font size stops changing and is at its maximum
|
|
55
59
|
/// towards maximum.
|
|
56
60
|
/// @since 0.2.13
|
|
57
|
-
$
|
|
61
|
+
$root-font-size-max-breakpoint: media-queries.$lg;
|
|
58
62
|
|
|
59
63
|
/// A map of named font sizes to their corresponding modular scale factor
|
|
60
64
|
/// @prop {Integer} h1 [5] Heading 1
|
|
@@ -66,7 +70,7 @@ $nds-root-font-size-max-breakpoint: $nds-breakpoint-lg;
|
|
|
66
70
|
/// @prop {Integer} lead [2] Lead
|
|
67
71
|
/// @prop {Integer} p [0] Paragraph
|
|
68
72
|
/// @since 0.1.0
|
|
69
|
-
$
|
|
73
|
+
$named-font-sizes: (
|
|
70
74
|
h1: 5,
|
|
71
75
|
h2: 4,
|
|
72
76
|
h3: 3,
|
|
@@ -79,59 +83,59 @@ $nds-named-font-sizes: (
|
|
|
79
83
|
|
|
80
84
|
/// Numeric font sizes
|
|
81
85
|
/// @since 0.2.0
|
|
82
|
-
$
|
|
86
|
+
$font-sizes: (
|
|
83
87
|
-2: (
|
|
84
88
|
fs: 12,
|
|
85
89
|
lh: 18,
|
|
86
|
-
mb:
|
|
87
|
-
mt:
|
|
90
|
+
mb: spacing.$small,
|
|
91
|
+
mt: spacing.$small
|
|
88
92
|
),
|
|
89
93
|
-1: (
|
|
90
94
|
fs: 14,
|
|
91
95
|
lh: 20,
|
|
92
|
-
mb:
|
|
93
|
-
mt:
|
|
96
|
+
mb: spacing.$medium,
|
|
97
|
+
mt: spacing.$medium
|
|
94
98
|
),
|
|
95
99
|
0: (
|
|
96
100
|
fs: 16,
|
|
97
101
|
lh: 24,
|
|
98
|
-
mb:
|
|
99
|
-
mt:
|
|
102
|
+
mb: spacing.$medium,
|
|
103
|
+
mt: spacing.$medium
|
|
100
104
|
),
|
|
101
105
|
1: (
|
|
102
106
|
fs: 18,
|
|
103
107
|
lh: 24,
|
|
104
|
-
mb:
|
|
105
|
-
mt:
|
|
108
|
+
mb: spacing.$medium,
|
|
109
|
+
mt: spacing.$large
|
|
106
110
|
),
|
|
107
111
|
2: (
|
|
108
112
|
fs: 20,
|
|
109
113
|
lh: 28,
|
|
110
|
-
mb:
|
|
111
|
-
mt:
|
|
114
|
+
mb: spacing.$medium,
|
|
115
|
+
mt: spacing.$large
|
|
112
116
|
),
|
|
113
117
|
3: (
|
|
114
118
|
fs: 28,
|
|
115
119
|
lh: 32,
|
|
116
|
-
mb:
|
|
117
|
-
mt:
|
|
120
|
+
mb: spacing.$medium,
|
|
121
|
+
mt: spacing.$large
|
|
118
122
|
),
|
|
119
123
|
4: (
|
|
120
124
|
fs: 36,
|
|
121
125
|
lh: 40,
|
|
122
|
-
mb:
|
|
123
|
-
mt:
|
|
126
|
+
mb: spacing.$medium,
|
|
127
|
+
mt: spacing.$large
|
|
124
128
|
),
|
|
125
129
|
5: (
|
|
126
130
|
fs: 44,
|
|
127
131
|
lh: 56,
|
|
128
|
-
mb:
|
|
132
|
+
mb: spacing.$medium,
|
|
129
133
|
mt: 0
|
|
130
134
|
),
|
|
131
135
|
6: (
|
|
132
136
|
fs: 52,
|
|
133
137
|
lh: 60,
|
|
134
|
-
mb:
|
|
138
|
+
mb: spacing.$large,
|
|
135
139
|
mt: 0
|
|
136
140
|
)
|
|
137
141
|
);
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
@use 'sass:list';
|
|
2
|
+
@use 'sass:math';
|
|
3
|
+
@use '../typography/settings' as typography-settings;
|
|
4
|
+
|
|
5
|
+
@forward 'vendor/is';
|
|
6
|
+
|
|
1
7
|
////
|
|
2
8
|
/// @group helpers
|
|
3
9
|
////
|
|
@@ -6,29 +12,26 @@
|
|
|
6
12
|
/// @param {Number} $num The number whose units you wish to strip.
|
|
7
13
|
/// @since 0.2.0
|
|
8
14
|
/// @link https://davidtheclark.github.io/scut/strip-unit.html
|
|
9
|
-
@
|
|
10
|
-
|
|
11
|
-
@function nds-strip-unit($num) {
|
|
15
|
+
@function strip-unit($num) {
|
|
12
16
|
@return math.div($num, $num * 0 + 1);
|
|
13
17
|
}
|
|
14
18
|
|
|
15
19
|
/// Convert pixel-values to em-values.
|
|
16
20
|
/// @param {Number} $pixels - The px-value you wish to convert to ems. No px unit necessary (e.g. 20 is fine, so is 20px). Passing a list will result in a list of em values (see examples).
|
|
17
|
-
/// @param {Number} $base [
|
|
21
|
+
/// @param {Number} $base [typography.$base-font-size] - A base-value with which to calculate the em-value
|
|
18
22
|
/// @since 0.2.0
|
|
19
23
|
/// @link https://davidtheclark.github.io/scut/em.html
|
|
20
|
-
@function em($pixels, $base:
|
|
24
|
+
@function em($pixels, $base: typography-settings.$base-font-size) {
|
|
21
25
|
// $base could be in em or px (no unit = px).
|
|
22
26
|
// Adjust accordingly to create a $divisor that
|
|
23
27
|
// serves as context for $pixels.
|
|
24
|
-
$multiplier: if(unit($base) == em, 16, 1);
|
|
25
|
-
$divisor:
|
|
26
|
-
|
|
28
|
+
$multiplier: if(math.unit($base) == em, 16, 1);
|
|
29
|
+
$divisor: strip-unit($base) * $multiplier;
|
|
27
30
|
$em-vals: ();
|
|
28
31
|
|
|
29
32
|
@each $val in $pixels {
|
|
30
|
-
$val-in-ems: math.div(
|
|
31
|
-
$em-vals: append($em-vals, $val-in-ems);
|
|
33
|
+
$val-in-ems: math.div(strip-unit($val), $divisor) * 1em;
|
|
34
|
+
$em-vals: list.append($em-vals, $val-in-ems);
|
|
32
35
|
}
|
|
33
36
|
|
|
34
37
|
@if length($em-vals) == 1 {
|
|
@@ -42,20 +45,20 @@
|
|
|
42
45
|
|
|
43
46
|
/// Convert pixel-values to rem-values.
|
|
44
47
|
/// @param {Number} $pixels - The px-value you wish to convert to rems. No px unit necessary (e.g. 20 is fine, so is 20px). Passing a list will result in a list of rem values (see examples).
|
|
45
|
-
/// @param {Number} $base [
|
|
48
|
+
/// @param {Number} $base [typography.$base-font-size] - A base-value with which to calculate the em-value
|
|
46
49
|
/// @since 0.2.0
|
|
47
50
|
/// @link https://davidtheclark.github.io/scut/rem.html
|
|
48
|
-
@function rem($pixels, $base:
|
|
51
|
+
@function rem($pixels, $base: typography-settings.$base-font-size) {
|
|
49
52
|
$rem-vals: ();
|
|
50
53
|
@each $val in $pixels {
|
|
51
|
-
$val-in-rems: math.div(
|
|
52
|
-
$rem-vals: append($rem-vals, $val-in-rems);
|
|
54
|
+
$val-in-rems: math.div(strip-unit($val), $base) * 1rem;
|
|
55
|
+
$rem-vals: list.append($rem-vals, $val-in-rems);
|
|
53
56
|
}
|
|
54
57
|
|
|
55
58
|
@if length($rem-vals) == 1 {
|
|
56
59
|
// return a single value instead of a list,
|
|
57
60
|
// so it can be used in calculations
|
|
58
|
-
@return nth($rem-vals, 1);
|
|
61
|
+
@return list.nth($rem-vals, 1);
|
|
59
62
|
} @else {
|
|
60
63
|
@return $rem-vals;
|
|
61
64
|
}
|
|
@@ -71,17 +74,17 @@
|
|
|
71
74
|
/// .something {
|
|
72
75
|
/// color: red;
|
|
73
76
|
|
|
74
|
-
/// @include
|
|
77
|
+
/// @include when-is(a, button) {
|
|
75
78
|
/// color: blue;
|
|
76
79
|
/// }
|
|
77
80
|
/// }
|
|
78
|
-
@mixin
|
|
81
|
+
@mixin when-is($element-selectors...) {
|
|
79
82
|
$selectors: ();
|
|
80
83
|
@each $element-selector in $element-selectors {
|
|
81
|
-
$selectors: append($selectors, $element-selector + &);
|
|
84
|
+
$selectors: list.append($selectors, $element-selector + &);
|
|
82
85
|
}
|
|
83
86
|
|
|
84
|
-
@at-root #{zip($selectors)} {
|
|
87
|
+
@at-root #{list.zip($selectors)} {
|
|
85
88
|
@content;
|
|
86
89
|
}
|
|
87
90
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
@use 'sass:math';
|
|
2
|
+
|
|
1
3
|
// See https://gist.github.com/HugoGiraudel/2933ef053ae0bf70ad8b
|
|
2
4
|
// ----
|
|
3
5
|
// Sass (v3.4.9)
|
|
@@ -9,7 +11,7 @@
|
|
|
9
11
|
}
|
|
10
12
|
|
|
11
13
|
@function is-time($value) {
|
|
12
|
-
@return is-number($value) and index('ms' 's', unit($value)) != null;
|
|
14
|
+
@return is-number($value) and index('ms' 's', math.unit($value)) != null;
|
|
13
15
|
}
|
|
14
16
|
|
|
15
17
|
@function is-duration($value) {
|
|
@@ -17,11 +19,11 @@
|
|
|
17
19
|
}
|
|
18
20
|
|
|
19
21
|
@function is-angle($value) {
|
|
20
|
-
@return is-number($value) and index('deg' 'rad' 'grad' 'turn', unit($value)) != null;
|
|
22
|
+
@return is-number($value) and index('deg' 'rad' 'grad' 'turn', math.unit($value)) != null;
|
|
21
23
|
}
|
|
22
24
|
|
|
23
25
|
@function is-frequency($value) {
|
|
24
|
-
@return is-number($value) and index('Hz' 'kHz', unit($value)) != null;
|
|
26
|
+
@return is-number($value) and index('Hz' 'kHz', math.unit($value)) != null;
|
|
25
27
|
}
|
|
26
28
|
|
|
27
29
|
@function is-integer($value) {
|
|
@@ -29,11 +31,11 @@
|
|
|
29
31
|
}
|
|
30
32
|
|
|
31
33
|
@function is-relative-length($value) {
|
|
32
|
-
@return is-number($value) and index('em' 'ex' 'ch' 'rem' 'vw' 'vh' 'vmin' 'vmax', unit($value)) != null;
|
|
34
|
+
@return is-number($value) and index('em' 'ex' 'ch' 'rem' 'vw' 'vh' 'vmin' 'vmax', math.unit($value)) != null;
|
|
33
35
|
}
|
|
34
36
|
|
|
35
37
|
@function is-absolute-length($value) {
|
|
36
|
-
@return is-number($value) and index('cm' 'mm' 'in' 'px' 'pt' 'pc', unit($value)) != null;
|
|
38
|
+
@return is-number($value) and index('cm' 'mm' 'in' 'px' 'pt' 'pc', math.unit($value)) != null;
|
|
37
39
|
}
|
|
38
40
|
|
|
39
41
|
@function is-percentage($value) {
|
|
@@ -45,7 +47,7 @@
|
|
|
45
47
|
}
|
|
46
48
|
|
|
47
49
|
@function is-resolution($value) {
|
|
48
|
-
@return is-number($value) and index('dpi' 'dpcm' 'dppx', unit($value)) != null;
|
|
50
|
+
@return is-number($value) and index('dpi' 'dpcm' 'dppx', math.unit($value)) != null;
|
|
49
51
|
}
|
|
50
52
|
|
|
51
53
|
@function is-position($value) {
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
////
|
|
2
|
+
/// @group visibility
|
|
3
|
+
////
|
|
4
|
+
|
|
5
|
+
/// Portrait media query
|
|
6
|
+
@mixin portrait {
|
|
7
|
+
@media screen and (orientation: portrait) {
|
|
8
|
+
@content;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/// Landscape media query
|
|
13
|
+
@mixin landscape {
|
|
14
|
+
@media screen and (orientation: landscape) {
|
|
15
|
+
@content;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/// Makes an element visually hidden, but still accessible to keyboards and assistive devices.
|
|
20
|
+
@mixin invisible {
|
|
21
|
+
clip: rect(0, 0, 0, 0);
|
|
22
|
+
height: 1px;
|
|
23
|
+
overflow: hidden;
|
|
24
|
+
position: absolute !important;
|
|
25
|
+
width: 1px;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/// Reverses the CSS output created by the `invisible()` mixin.
|
|
29
|
+
@mixin invisible-off {
|
|
30
|
+
clip: auto;
|
|
31
|
+
height: auto;
|
|
32
|
+
overflow: visible;
|
|
33
|
+
position: static !important;
|
|
34
|
+
width: auto;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/// Hide the element when printing
|
|
38
|
+
/// @output the CSS to hide on the print stylesheet
|
|
39
|
+
/// @since 1.0.0
|
|
40
|
+
@mixin hide-print {
|
|
41
|
+
@media print {
|
|
42
|
+
display: none !important;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/// Only show the element when printing (not for other media)
|
|
47
|
+
/// @output the CSS to hide on all media except print
|
|
48
|
+
/// @since 1.0.0
|
|
49
|
+
@mixin show-print {
|
|
50
|
+
display: none !important;
|
|
51
|
+
@media print {
|
|
52
|
+
display: block !important;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/// Remove an appended link URL
|
|
57
|
+
/// @output removes content attribute
|
|
58
|
+
/// @since 1.0.0
|
|
59
|
+
@mixin remove-appended-print-link {
|
|
60
|
+
@media print {
|
|
61
|
+
&:after {
|
|
62
|
+
content: none !important;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
package/scss/core.scss
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
////
|
|
2
|
-
/// @group helpers
|
|
3
|
-
////
|
|
4
|
-
|
|
5
|
-
/// Make an element adapt its height to fit floated children, and clear floats in both directions.
|
|
6
|
-
/// @since 0.1.0
|
|
7
|
-
@mixin nds-clearfix {
|
|
8
|
-
&:before,
|
|
9
|
-
&:after {
|
|
10
|
-
content: ' ';
|
|
11
|
-
display: table;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
&:after {
|
|
15
|
-
clear: both;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
/// Placeholder for clearfix
|
|
20
|
-
/// @since 0.1.0
|
|
21
|
-
%nds-clearfix {
|
|
22
|
-
@include nds-clearfix;
|
|
23
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
////
|
|
2
|
-
/// @group helpers
|
|
3
|
-
////
|
|
4
|
-
|
|
5
|
-
/// Shortcut for getting the first item from a list
|
|
6
|
-
/// @link http://hugogiraudel.com/2013/08/08/advanced-sass-list-functions/#selecting-values-from-list
|
|
7
|
-
/// @since 0.1.0
|
|
8
|
-
@function nds-first($list) {
|
|
9
|
-
@return nth($list, 1);
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
/// Shortcut for getting the last item from a list
|
|
13
|
-
/// @link http://hugogiraudel.com/2013/08/08/advanced-sass-list-functions/#selecting-values-from-list
|
|
14
|
-
/// @since 0.1.0
|
|
15
|
-
@function nds-last($list) {
|
|
16
|
-
@return nth($list, length($list));
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
/// Returns last index of `$value` in `$list`.
|
|
20
|
-
///
|
|
21
|
-
/// @ignore Documentation: http://at-import.github.io/SassyLists/documentation/#function-sl-last-index
|
|
22
|
-
///
|
|
23
|
-
/// @param {List} $list - list to search
|
|
24
|
-
/// @param {*} $value - value to be searched for
|
|
25
|
-
///
|
|
26
|
-
/// @example
|
|
27
|
-
/// sl-last-index(a b a, a)
|
|
28
|
-
/// // 3
|
|
29
|
-
///
|
|
30
|
-
/// @example
|
|
31
|
-
/// sl-last-index(a b a, z)
|
|
32
|
-
/// // null
|
|
33
|
-
///
|
|
34
|
-
/// @return {Number | Null}
|
|
35
|
-
///
|
|
36
|
-
/// @since 0.1.0
|
|
37
|
-
@function nds-last-index($list, $value) {
|
|
38
|
-
@for $i from length($list) through 1 {
|
|
39
|
-
@if nth($list, $i) == $value {
|
|
40
|
-
@return $i;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
@return null;
|
|
45
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
////
|
|
2
|
-
/// @group helpers
|
|
3
|
-
////
|
|
4
|
-
|
|
5
|
-
/// Styles to hide and show under the print media query
|
|
6
|
-
|
|
7
|
-
/// Hide the element when printing
|
|
8
|
-
/// @output the CSS to hide on the print stylesheet
|
|
9
|
-
/// @since 1.0.0
|
|
10
|
-
@mixin nds-hide-print {
|
|
11
|
-
@media print {
|
|
12
|
-
display: none !important;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
///Only show the element when printing (not for other media)
|
|
17
|
-
/// @output the CSS to hide on all media except print
|
|
18
|
-
/// @since 1.0.0
|
|
19
|
-
@mixin nds-show-print {
|
|
20
|
-
display: none !important;
|
|
21
|
-
@media print {
|
|
22
|
-
display: block !important;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
///Remove an appended link URL
|
|
27
|
-
/// @output removes content attribute
|
|
28
|
-
/// @since 1.0.0
|
|
29
|
-
@mixin nds-remove-appended-print-link {
|
|
30
|
-
@media print {
|
|
31
|
-
&:after {
|
|
32
|
-
content: none !important;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
@@ -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;
|