@nice-digital/nds-core 1.3.5-alpha.0 → 2.0.2-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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nice-digital/nds-core",
3
- "version": "1.3.5-alpha.0",
3
+ "version": "2.0.2-alpha.0",
4
4
  "description": "Core code for the NICE Design System",
5
5
  "author": "Ian Routledge <ian.routledge@nice.org.uk>",
6
6
  "contributors": [
@@ -33,7 +33,7 @@
33
33
  "url": "https://github.com/nice-digital/nice-design-system/issues"
34
34
  },
35
35
  "dependencies": {
36
- "@nice-digital/icons": "^3.0.2-alpha.0",
36
+ "@nice-digital/icons": "^4.0.0-alpha.0",
37
37
  "prop-types": "^15.7.2",
38
38
  "sass-mq": "^6.0.0"
39
39
  },
@@ -44,5 +44,5 @@
44
44
  "devDependencies": {
45
45
  "@babel/cli": "^7.5.0"
46
46
  },
47
- "gitHead": "0ddae81edebd757a52ca6a2838610049a83acebd"
47
+ "gitHead": "04839cc13ae0a0fbd0baeefff5996943285dafab"
48
48
  }
@@ -1,2 +1 @@
1
- @forward "nice-brand";
2
- @forward "semantic";
1
+ @forward 'tokens/alias';
@@ -0,0 +1,163 @@
1
+ @use 'global';
2
+
3
+ // Text, links, focus
4
+ $text: global.$nice-black;
5
+ $text-inverse: global.$white;
6
+ $link: global.$custom-blue-1;
7
+ $link-hover: global.$custom-blue-2;
8
+ $link-visited: global.$custom-purple-1;
9
+ $link-active: global.$nice-black;
10
+ $link-focus: global.$custom-blue-1;
11
+ $link-inverse: global.$white;
12
+ $link-inverse-hover: global.$custom-grey-2;
13
+ $link-inverse-visited: global.$white;
14
+ $link-inverse-active: global.$custom-grey-2;
15
+ $link-inverse-focus: global.$white;
16
+ $code-background: global.$custom-grey-4;
17
+ $mark: global.$custom-yellow-highlight;
18
+ $focus: global.$custom-teal;
19
+ $focus-inverse: global.$white;
20
+ $text-print: global.$black;
21
+
22
+ // Buttons
23
+ $btn-cta: global.$yellow;
24
+ $btn-cta-hover: global.$custom-yellow-shade;
25
+ $btn-cta-text: global.$nice-black;
26
+ $btn-cta-border: global.$white;
27
+ $btn-primary: global.$black-tint-1;
28
+ $btn-primary-hover: global.$nice-black;
29
+ $btn-primary-text: global.$white;
30
+ $btn-secondary: global.$custom-grey-3;
31
+ $btn-secondary-hover: global.$black-tint-1;
32
+ $btn-secondary-text: global.$white;
33
+ $btn-inverse: global.$white;
34
+ $btn-inverse-hover: global.$custom-grey-2;
35
+ $btn-inverse-text: global.$nice-black;
36
+
37
+ // Borders
38
+ $border: global.$custom-grey-1;
39
+ $border-selected: global.$nice-teal;
40
+
41
+ // Status
42
+ $error: global.$custom-red-1;
43
+ $error-background: global.$custom-red-1-tint;
44
+ $info: global.$custom-blue-3;
45
+ $info-background: global.$custom-blue-3-tint;
46
+ $caution: global.$custom-orange-1;
47
+ $caution-background: global.$custom-orange-1-tint;
48
+ $success: global.$custom-green-1;
49
+ $success-background: global.$custom-green-1-tint;
50
+
51
+ // Fills
52
+ $fill-page-background: global.$nice-cream-tint-1;
53
+
54
+ // Forms
55
+ $form-group-hint: global.$black-tint-1;
56
+ $checkbox: global.$nice-black;
57
+ $checkbox-hint: global.$black-tint-1;
58
+ $radio: global.$nice-black;
59
+ $radio-hint: global.$black-tint-1;
60
+
61
+ // Components...
62
+
63
+ // A-Z list
64
+ $a-z-list-heading-background: global.$white;
65
+
66
+ // Action banner
67
+ $action-banner-default-background: global.$nice-blue;
68
+ $action-banner-default-border: global.$nice-black;
69
+ $action-banner-subtle-background: global.$nice-cream;
70
+ $action-banner-subtle-border: global.$nice-cream;
71
+
72
+ // Alphabet
73
+ $alphabet-letter-background: global.$white;
74
+ $alphabet-letter-span: global.$black-tint-1;
75
+
76
+ // Card
77
+ $card-author: global.$black-tint-1;
78
+ $card-metadata: global.$black-tint-1;
79
+
80
+ // Callout
81
+ $callout-background: global.$white;
82
+
83
+ // Column list
84
+ $column-list-boxed-background: global.$white;
85
+
86
+ // Enhanced pagination
87
+ $enhanced-pagination-current-item-background: global.$custom-grey-2;
88
+ $enhanced-pagination-link-hover-background: global.$white;
89
+
90
+ // Filters
91
+ $filter-panel-background: global.$custom-grey-4;
92
+ $filter-panel-heading-button-background: global.$custom-grey-2;
93
+ $filter-group-heading-background: global.$custom-grey-2;
94
+ $filter-group-heading-button-background: global.$custom-grey-2;
95
+ $filter-group-heading-button-background-hover: global.$custom-grey-1;
96
+ $filter-option-background: global.$white;
97
+ $filter-option-border: global.$custom-grey-2;
98
+ $filter-option-hover: global.$custom-grey-4;
99
+ $filter-option-hover-border: global.$custom-grey-1;
100
+ $filter-option-text-before-background: global.$white;
101
+ $filter-option-text-before-border: global.$black-tint-1;
102
+ $filter-input-controls-border: global.$custom-grey-2;
103
+
104
+ // Full bleed
105
+ $full-bleed-background: global.$white;
106
+ $full-bleed-light-background: global.$nice-teal;
107
+ $full-bleed-light-text: global.$white;
108
+
109
+ // Hero
110
+ $hero-background: global.$nice-blue-tint-1;
111
+ $hero-border: global.$nice-blue-tint-2;
112
+
113
+ // Horizontal nav
114
+ $horizontal-nav-list-border: global.$nice-black;
115
+ $horizontal-nav-current-link-background: global.$custom-grey-4;
116
+ $horizontal-nav-current-link-border: global.$nice-black;
117
+ $horizontal-nav-current-link: global.$nice-black;
118
+ $horizontal-nav-active-link-mobile: global.$white;
119
+ $horizontal-nav-active-link-mobile-background: global.$nice-teal;
120
+
121
+ // Icons
122
+ $icons: global.$nice-teal;
123
+
124
+ // Panels
125
+ $panel-default-background: global.$nice-cream;
126
+ $panel-default-border: global.$custom-grey-2;
127
+ $panel-impact-background: global.$nice-blue;
128
+ $panel-impact-border: global.$nice-blue;
129
+ $panel-impact-alt-background-1: global.$nice-blue;
130
+ $panel-impact-alt-background-2: global.$nice-blue-tint-1;
131
+ $panel-primary-background: global.$white;
132
+ $panel-primary-border: global.$nice-teal-tint-2;
133
+ $panel-inverse-background: global.$black-tint-1;
134
+
135
+ // Quote
136
+ $quote-left-border: global.$nice-teal;
137
+
138
+ // Stacked nav
139
+ $stacked-nav-background: global.$white;
140
+ $stacked-nav-active-hint: global.$white;
141
+ $stacked-nav-current-link: global.$custom-grey-4;
142
+ $stacked-nav-current-link-background: global.$nice-teal;
143
+ $stacked-nav-current-link-active: global.$white;
144
+ $stacked-nav-link-hover: global.$custom-grey-2;
145
+
146
+ // Tables
147
+ $table-heading: global.$white;
148
+ $table-row-odd: global.$nice-cream-tint-1;
149
+ $table-row-even: global.$nice-cream-3;
150
+
151
+ // Tabs
152
+ $tab-btn-selected: global.$custom-grey-4;
153
+ $tab-pane: global.$custom-grey-4;
154
+ $tab-content: global.$custom-grey-4;
155
+
156
+ // Tags
157
+ $tag-background: global.$black-tint-1;
158
+ $tag-outline: global.$black-tint-1;
159
+ $tag-outline-background: global.$custom-grey-4;
160
+ $tag-remove: global.$nice-teal;
161
+ $tag-remove-hover-after: global.$nice-black;
162
+ $tag-anchor: global.$white;
163
+ $tag-print: global.$black;
@@ -0,0 +1,47 @@
1
+ // Global tokens - do not reference these directly, use alias tokens instead!
2
+
3
+ // Primary palette
4
+ $nice-teal: #228096;
5
+ $nice-cream: #f7f4f1;
6
+ $nice-blue: #00436c;
7
+ $white: #fff;
8
+ $black: #000;
9
+ $nice-black: #0e0e0e;
10
+
11
+ // Secondary palette
12
+ $yellow: #ead054;
13
+
14
+ // Tertiary palette
15
+ $nice-teal-tint-1: #59a0b0;
16
+ $nice-teal-tint-2: #91c0cb;
17
+ $nice-teal-tint-3: #c8e0e6;
18
+ $nice-blue-tint-1: #407291;
19
+ $nice-blue-tint-2: #80a1b5;
20
+ $nice-blue-tint-3: #bfd0da;
21
+ $nice-cream-1: #ded5ca;
22
+ $nice-cream-2: #e6e0d7;
23
+ $nice-cream-3: #eeeae4;
24
+ $nice-cream-tint-1: #fbfaf8;
25
+ $black-tint-1: #404040;
26
+ $black-tint-2: #808080;
27
+ $black-tint-3: #bfbfbf;
28
+
29
+ // Custom palette
30
+ $custom-grey-1: #adadad;
31
+ $custom-grey-2: #d6d6d6;
32
+ $custom-grey-3: #666;
33
+ $custom-grey-4: #e9e9e9;
34
+ $custom-blue-1: #005ea5;
35
+ $custom-blue-2: #003761;
36
+ $custom-blue-3: #3479d0;
37
+ $custom-blue-3-tint: #eff4fc;
38
+ $custom-purple-1: #4c2c92;
39
+ $custom-red-1: #b50f23;
40
+ $custom-red-1-tint: #f9eced;
41
+ $custom-orange-1: #dc8a07;
42
+ $custom-orange-1-tint: #fbf7f1;
43
+ $custom-green-1: #68c103;
44
+ $custom-green-1-tint: #f3faeb;
45
+ $custom-yellow-shade: #d6ba32;
46
+ $custom-yellow-highlight: #fff999;
47
+ $custom-teal: #0092a6;
@@ -1,6 +1,6 @@
1
- @use "../spacing";
2
- @use "../colours";
3
- @use "../utils";
1
+ @use '../spacing';
2
+ @use '../colours';
3
+ @use '../utils';
4
4
 
5
5
  ////
6
6
  /// @group helpers
@@ -1,3 +1,5 @@
1
+ @use 'sass:map';
2
+
1
3
  ////
2
4
  /// @group helpers
3
5
  ////
@@ -10,6 +12,7 @@
10
12
  /// @prop {String} bullet [2022] Bullet (•)
11
13
  /// @prop {String} copyright [00a9] Copyright symbol (©)
12
14
  /// @prop {String} greater-than [003e] Greater than symbol (>)
15
+ /// @prop {String} heavy-multiplication-x [2716] Heavy multiplication x (✖)
13
16
  /// @prop {String} hyphen-minus [002d] Hyphen minus (-)
14
17
  /// @prop {String} left-double-quotation-mark [201C] Left double quotation mark (“)
15
18
  /// @prop {String} less-than [003c] Less than symbol (<)
@@ -21,6 +24,7 @@ $glyphs: (
21
24
  bullet: '2022',
22
25
  copyright: '00a9',
23
26
  greater-than: '003e',
27
+ heavy-multiplication-x: '2716',
24
28
  hyphen-minus: '002d',
25
29
  left-double-quotation-mark: '201C',
26
30
  less-than: '003c',
@@ -49,8 +53,8 @@ $glyphs: (
49
53
  $codes: '';
50
54
 
51
55
  @each $name in $names {
52
- @if map-has-key($glyphs, $name) {
53
- $code: map-get($glyphs, $name);
56
+ @if map.has-key($glyphs, $name) {
57
+ $code: map.get($glyphs, $name);
54
58
  $codes: $codes + '\\#{$code}';
55
59
  } @else {
56
60
  @error 'Glyph with name #{$name} could not be found in the $glyphs map';
@@ -1,5 +1,5 @@
1
- @use "../spacing";
2
- @use "../utils";
1
+ @use '../spacing';
2
+ @use '../utils';
3
3
 
4
4
  /// The maximum width of the default container, in pixels
5
5
  /// @since 0.5.2
@@ -19,7 +19,7 @@ $readable-width: 66ch;
19
19
  margin: auto;
20
20
  max-width: utils.rem($container-max-width);
21
21
  width: 96%; // IE11 support for calc not consistent https://caniuse.com/calc (See "Known issues")
22
- width: calc(100% - #{rem($container-gutter * 2)});
22
+ width: calc(100% - #{utils.rem($container-gutter * 2)});
23
23
  }
24
24
 
25
25
  /// Make an element adapt its height to fit floated children, and clear floats in both directions.
@@ -38,6 +38,6 @@ $readable-width: 66ch;
38
38
 
39
39
  /// Placeholder for clearfix
40
40
  /// @since 0.1.0
41
- %nds-clearfix {
41
+ %clearfix {
42
42
  @include clearfix;
43
43
  }
@@ -1,4 +1,6 @@
1
- @use "sass:math";
1
+ @use 'sass:math';
2
+
3
+ // stylelint-disable number-max-precision
2
4
 
3
5
  /// Modular scale values
4
6
  /// @link http://www.modularscale.com/
@@ -1,4 +1,4 @@
1
- @use "helpers";
1
+ @use 'helpers';
2
2
 
3
3
  ////
4
4
  /// @group Typography
@@ -12,10 +12,7 @@
12
12
  clear: both;
13
13
  font-family: helpers.get-font-family(serif);
14
14
  font-weight: 600;
15
- // Letter spacing and text shadow to mimic 900 weight, see https://github.com/nice-digital/nice-design-system/issues/240
16
- letter-spacing: 0.5px;
17
15
  max-width: 66ch;
18
- text-shadow: 1.5px 0 0 currentColor;
19
16
  }
20
17
 
21
18
  /// Secondary heading. Used for h2 tag but can be used directly
@@ -57,6 +54,7 @@
57
54
  @mixin h5 {
58
55
  @include helpers.font(h5);
59
56
  clear: both;
57
+ font-family: helpers.get-font-family(sans);
60
58
  font-weight: 700;
61
59
  max-width: 66ch;
62
60
  }
@@ -67,6 +65,7 @@
67
65
  @mixin h6 {
68
66
  @include helpers.font(h6);
69
67
  clear: both;
68
+ font-family: helpers.get-font-family(sans);
70
69
  font-weight: 700;
71
70
  max-width: 66ch;
72
71
  }
@@ -1,7 +1,8 @@
1
- @use "settings" as typography-settings;
2
- @use "../spacing";
3
- @use "../colours";
4
- @use "../utils";
1
+ @use 'sass:map';
2
+ @use 'settings' as typography-settings;
3
+ @use '../spacing';
4
+ @use '../colours';
5
+ @use '../utils';
5
6
 
6
7
  ////
7
8
  /// @group Typography
@@ -11,7 +12,7 @@
11
12
  /// @param {String} $stack The stack name e.g. sans, serif or mono
12
13
  /// @since 0.1.0
13
14
  @function get-font-family($stack) {
14
- $result: map-get(typography-settings.$font-families, $stack);
15
+ $result: map.get(typography-settings.$font-families, $stack);
15
16
  @return unquote($result);
16
17
  }
17
18
 
@@ -20,7 +21,7 @@
20
21
  /// @since 0.1.0
21
22
  @function get-scale-integer($scale) {
22
23
  @if map-has-key(typography-settings.$named-font-sizes, $scale) {
23
- @return map-get(typography-settings.$named-font-sizes, $scale);
24
+ @return map.get(typography-settings.$named-font-sizes, $scale);
24
25
  } @else if is-integer($scale) {
25
26
  @return $scale;
26
27
  }
@@ -39,8 +40,8 @@
39
40
  /// @since 0.1.0
40
41
  @function get-font-size($scale) {
41
42
  $scale-integer: get-scale-integer($scale);
42
- $font-map: map-get(typography-settings.$font-sizes, $scale-integer);
43
- @return map-get($font-map, fs);
43
+ $font-map: map.get(typography-settings.$font-sizes, $scale-integer);
44
+ @return map.get($font-map, fs);
44
45
  }
45
46
 
46
47
  /// Gets a numeric line height (in px) from a given scale multiplier.
@@ -54,8 +55,8 @@
54
55
  /// @since 0.1.0
55
56
  @function get-line-height($scale) {
56
57
  $scale-integer: get-scale-integer($scale);
57
- $font-map: map-get(typography-settings.$font-sizes, $scale-integer);
58
- @return map-get($font-map, lh);
58
+ $font-map: map.get(typography-settings.$font-sizes, $scale-integer);
59
+ @return map.get($font-map, lh);
59
60
  }
60
61
 
61
62
  /// Applies font size and line-height for the given scale.
@@ -97,15 +98,15 @@
97
98
  /// @since 0.1.0
98
99
  @mixin font($scale, $important: false) {
99
100
  $scale-integer: get-scale-integer($scale);
100
- $font-map: map-get(typography-settings.$font-sizes, $scale-integer);
101
+ $font-map: map.get(typography-settings.$font-sizes, $scale-integer);
101
102
  @include font-size($scale, $important);
102
103
 
103
104
  @if $important {
104
- margin-bottom: utils.rem(map-get($font-map, mb)) !important;
105
- margin-top: utils.rem(map-get($font-map, mt)) !important;
105
+ margin-bottom: utils.rem(map.get($font-map, mb)) !important;
106
+ margin-top: utils.rem(map.get($font-map, mt)) !important;
106
107
  } @else {
107
- margin-bottom: utils.rem(map-get($font-map, mb));
108
- margin-top: utils.rem(map-get($font-map, mt));
108
+ margin-bottom: utils.rem(map.get($font-map, mb));
109
+ margin-top: utils.rem(map.get($font-map, mt));
109
110
  }
110
111
  }
111
112
 
@@ -1,5 +1,6 @@
1
- @use "../colours";
2
- @use "../focus";
1
+ @use 'sass:color';
2
+ @use '../colours';
3
+ @use '../focus';
3
4
 
4
5
  ////
5
6
  /// @group Typography
@@ -9,7 +10,7 @@
9
10
  /// @since 0.3.1
10
11
  @mixin link-default {
11
12
  color: colours.$link;
12
- -webkit-tap-highlight-color: rgba(colours.$focus, 0.333);
13
+ -webkit-tap-highlight-color: color.adjust(colours.$focus, $alpha: -0.666);
13
14
  text-decoration: underline;
14
15
  text-decoration-skip-ink: auto;
15
16
 
@@ -24,13 +25,14 @@
24
25
 
25
26
  &:focus {
26
27
  @include focus.default-focus-style;
27
- color: colours.$link-focus-text;
28
+ color: colours.$link-focus;
28
29
  }
29
30
 
30
31
  &:active {
31
32
  color: colours.$link-active;
32
33
  }
33
34
  }
35
+
34
36
  /// Default links for use on a light background
35
37
  /// @require {mixin} link-default
36
38
  /// @since 0.5.0
@@ -44,7 +46,7 @@
44
46
  /// @since 0.3.1
45
47
  @mixin link-inverse {
46
48
  color: colours.$link-inverse;
47
- -webkit-tap-highlight-color: rgba(colours.$focus, 0.333);
49
+ -webkit-tap-highlight-color: color.adjust(colours.$focus, $alpha: -0.666);
48
50
  text-decoration: underline;
49
51
  text-decoration-skip-ink: auto;
50
52
 
@@ -58,7 +60,7 @@
58
60
 
59
61
  &:focus {
60
62
  @include focus.inverse-focus-style;
61
- color: colours.$link-inverse-focus-text;
63
+ color: colours.$link-inverse-focus;
62
64
  }
63
65
 
64
66
  &:active {
@@ -1,8 +1,8 @@
1
- @use "sass:math";
2
- @use "../typography/settings" as typography-settings;
1
+ @use 'sass:list';
2
+ @use 'sass:math';
3
+ @use '../typography/settings' as typography-settings;
3
4
 
4
- @forward "vendor/is";
5
- @forward "vendor/math";
5
+ @forward 'vendor/is';
6
6
 
7
7
  ////
8
8
  /// @group helpers
@@ -25,14 +25,13 @@
25
25
  // $base could be in em or px (no unit = px).
26
26
  // Adjust accordingly to create a $divisor that
27
27
  // serves as context for $pixels.
28
- $multiplier: if(unit($base) == em, 16, 1);
28
+ $multiplier: if(math.unit($base) == em, 16, 1);
29
29
  $divisor: strip-unit($base) * $multiplier;
30
-
31
30
  $em-vals: ();
32
31
 
33
32
  @each $val in $pixels {
34
33
  $val-in-ems: math.div(strip-unit($val), $divisor) * 1em;
35
- $em-vals: append($em-vals, $val-in-ems);
34
+ $em-vals: list.append($em-vals, $val-in-ems);
36
35
  }
37
36
 
38
37
  @if length($em-vals) == 1 {
@@ -53,13 +52,13 @@
53
52
  $rem-vals: ();
54
53
  @each $val in $pixels {
55
54
  $val-in-rems: math.div(strip-unit($val), $base) * 1rem;
56
- $rem-vals: append($rem-vals, $val-in-rems);
55
+ $rem-vals: list.append($rem-vals, $val-in-rems);
57
56
  }
58
57
 
59
58
  @if length($rem-vals) == 1 {
60
59
  // return a single value instead of a list,
61
60
  // so it can be used in calculations
62
- @return nth($rem-vals, 1);
61
+ @return list.nth($rem-vals, 1);
63
62
  } @else {
64
63
  @return $rem-vals;
65
64
  }
@@ -82,10 +81,10 @@
82
81
  @mixin when-is($element-selectors...) {
83
82
  $selectors: ();
84
83
  @each $element-selector in $element-selectors {
85
- $selectors: append($selectors, $element-selector + &);
84
+ $selectors: list.append($selectors, $element-selector + &);
86
85
  }
87
86
 
88
- @at-root #{zip($selectors)} {
87
+ @at-root #{list.zip($selectors)} {
89
88
  @content;
90
89
  }
91
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) {
@@ -1,80 +0,0 @@
1
- ////
2
- /// @group colors
3
- ////
4
-
5
- // PRIMARY PALETTE
6
-
7
- /// NICE Black. Part of the primary palette.
8
- /// @since 0.2.0
9
- $nice-black: #222;
10
-
11
- /// NICE White. Part of the primary palette
12
- /// @since 0.2.0
13
- $nice-white: #fff;
14
-
15
- /// NICE Teal. Part of the primary palette.
16
- /// First choice of colour for supporting
17
- /// @since 0.2.0
18
- $nice-teal: #004650;
19
-
20
- // SECONDARY PALETTE
21
-
22
- /// Purple. Part of the secondary palette. Purple should be used sparingly and only used as a
23
- /// panel background to highlight a particular section of content,
24
- /// in which case font colour must be pure white (NICE White) to make text legible.
25
- /// @since 0.2.0
26
- $nice-purple: #451551;
27
-
28
- /// Cool Teal. Part of the secondary palette.
29
- /// @since 0.2.0
30
- $nice-cool-teal: #00506a;
31
-
32
- /// Rich Black. Part of the secondary palette.
33
- /// @since 0.2.0
34
- $nice-rich-black: #0e0e0e;
35
-
36
- /// Dark Grey. Part of the secondary palette.
37
- /// @since 0.2.0
38
- $nice-dark-grey: #393939;
39
-
40
- /// Grey 1. Part of the secondary palette.
41
- /// @since 0.2.0
42
- $nice-grey-1: #adadad;
43
-
44
- /// Grey 2. Part of the secondary palette.
45
- /// @since 0.2.0
46
- $nice-grey-2: #d6d6d6;
47
-
48
- /// Grey 3. Part of the secondary palette.
49
- /// @since 0.2.0
50
- $nice-grey-3: #e9e9e9;
51
-
52
- // TERTIARY PALETTE
53
-
54
- /// Blue 1. Part of the tertiary palette.
55
- /// @since 0.2.0
56
- $nice-blue-1: #233746;
57
-
58
- /// Blue 2. Part of the tertiary palette.
59
- /// @since 0.2.0
60
- $nice-blue-2: #314c60;
61
-
62
- /// Blue 3. Part of the tertiary palette.
63
- /// @since 0.2.0
64
- $nice-blue-3: #517489;
65
-
66
- /// Ice Teal. Part of the tertiary palette.
67
- /// @since 0.2.0
68
- $nice-ice-teal: #a2bdc1;
69
-
70
- /// Teal 1. Part of the tertiary palette.
71
- /// @since 0.2.0
72
- $nice-teal-1: #4f7d83;
73
-
74
- /// Teal 2. Part of the tertiary palette.
75
- /// @since 0.2.0
76
- $nice-teal-2: #18646e;
77
-
78
- /// Teal 3. Part of the tertiary palette.
79
- /// @since 0.2.0
80
- $nice-teal-3: #15434a;
@@ -1,247 +0,0 @@
1
- ////
2
- /// @group colors
3
- ////
4
-
5
- @use 'nice-brand';
6
-
7
- /// True black, used for print styles
8
- /// @since 0.2.0
9
- $true-black: #000;
10
-
11
- /// True white, used for print styles
12
- /// @since 0.2.0
13
- $true-white: #fff;
14
-
15
- // GLOBAL
16
-
17
- /// Page background colour. It's off-white in an attempt to make
18
- /// text easier to read for those with 'visual stress', 50% of
19
- /// which happen to be dyslexic (British Dyslexia association), by
20
- /// reducing contrast. See https://ux.stackexchange.com/a/73918/92081
21
- /// for a more detailed explanation.
22
- /// @since 0.2.0
23
- $body: #f4f4f4;
24
-
25
- /// Standard, primary body text colour. Off-black, to slightly reduce
26
- /// contrast in an attempt to make text easier to read for those with
27
- /// 'visual stress', see also $body.
28
- /// @since 0.2.0
29
- $text: nice-brand.$nice-black;
30
-
31
- /// Subtle text colour
32
- /// @since 0.2.0
33
- $text-subtle: nice-brand.$nice-grey-1;
34
-
35
- /// Inverse body text colour for use on dark background
36
- /// @since 0.2.2
37
- $text-inverse: nice-brand.$nice-white;
38
-
39
- /// Icons colour
40
- /// @since 0.2.0
41
- $icons: nice-brand.$nice-teal;
42
-
43
- // LINKS
44
-
45
- /// Link text colour
46
- /// @since 0.2.0
47
- $link: #005ea5;
48
-
49
- /// Link hover colour
50
- /// @since 0.2.0
51
- $link-hover: #003761;
52
-
53
- /// Link visited colour
54
- /// @since 0.2.0
55
- $link-visited: #4c2c92;
56
-
57
- /// Link active colour
58
- /// @since 0.2.0
59
- $link-active: $text;
60
-
61
- /// Link focus text colour
62
- /// @since 0.2.11
63
- $link-focus-text: $link;
64
-
65
- // INVERSE LINKS
66
-
67
- /// Inverse link text colour
68
- /// @since 0.2.9
69
- $link-inverse: $text-inverse;
70
-
71
- /// Inverse link hover text colour
72
- /// @since 0.2.9
73
- $link-inverse-hover: nice-brand.$nice-grey-2;
74
-
75
- /// Inverse link visited text colour. Same as normal inverse link colour to ensure minimum 4.5:1 colour contrast across various dark backgrounds.
76
- /// @since 0.2.9
77
- $link-inverse-visited: $link-inverse;
78
-
79
- /// Inverse link active text colour
80
- /// @since 0.2.9
81
- $link-inverse-active: $link-inverse-hover;
82
-
83
- /// Inverse link focus text colour
84
- /// @since 0.2.9
85
- $link-inverse-focus-text: $link-inverse;
86
-
87
- // FOCUS
88
-
89
- /// Focus colour
90
- /// @since 0.2.0
91
- $focus: #0092a6;
92
-
93
- /// Focus colour
94
- /// @since 0.3.1
95
- $focus-inverse: $link-inverse;
96
-
97
- // CTA BUTTONS
98
-
99
- /// CTA button background colour
100
- /// @since 0.2.2
101
- $btn-cta: nice-brand.$nice-purple;
102
-
103
- /// CTA button hover colour
104
- /// @since 0.2.2
105
- $btn-cta-hover: #260b2d;
106
-
107
- /// CTA button text colour
108
- /// @since 0.2.2
109
- $btn-cta-text: nice-brand.$nice-white;
110
-
111
- // PRIMARY BUTTONS
112
-
113
- /// Primary button background colour
114
- /// @since 0.2.2
115
- $btn-primary: nice-brand.$nice-dark-grey;
116
-
117
- /// Primary button hover colour
118
- /// @since 0.2.2
119
- $btn-primary-hover: nice-brand.$nice-rich-black;
120
-
121
- /// Primary button text colour
122
- /// @since 0.2.2
123
- $btn-primary-text: nice-brand.$nice-white;
124
-
125
- // SECONDARY BUTTONS
126
-
127
- /// Secondary button background colour
128
- /// @since 0.2.2
129
- $btn-secondary: #666;
130
-
131
- /// Secondary button hover colour
132
- /// @since 0.2.2
133
- $btn-secondary-hover: #333;
134
-
135
- /// Primary button text colour
136
- /// @since 0.2.2
137
- $btn-secondary-text: nice-brand.$nice-white;
138
-
139
- // LIGHT BUTTONS
140
-
141
- /// Inverse (light) button background colour
142
- /// @since 0.2.2
143
- $btn-inverse: nice-brand.$nice-white;
144
-
145
- /// Inverse (light) button hover colour
146
- /// @since 0.2.2
147
- $btn-inverse-hover: nice-brand.$nice-grey-3;
148
-
149
- /// Inverse (light) button text colour
150
- /// @since 0.2.2
151
- $btn-inverse-text: nice-brand.$nice-rich-black;
152
-
153
- // BACKGROUNDS/BORDERS
154
-
155
- /// Borders, separators, rules, keylines etc.
156
- /// @since 0.2.0
157
- $border: nice-brand.$nice-grey-1;
158
-
159
- /// Focused Borders, separators, rules, keylines etc.
160
- /// @since 0.4.2
161
- $border-focus: nice-brand.$nice-blue-3;
162
-
163
- // NOTIFICATIONS/BANNERS
164
-
165
- /// Agile lifecycle phase banner
166
- /// @since 0.2.2
167
- $agile-phase: #009ae9;
168
-
169
- /// Discovery agile lifecycle phase
170
- /// @since 0.2.0
171
- /// @deprecated Use $agile-phase instead
172
- $discovery: #b8008e;
173
-
174
- /// Alpha badges and banners
175
- /// @since 0.2.0
176
- /// @deprecated Use $agile-phase instead
177
- $alpha: #d5367f;
178
-
179
- /// Beta badges and banners
180
- /// @since 0.2.0
181
- /// @deprecated Use $agile-phase instead
182
- $beta: #bd5826;
183
-
184
- /// Live badges and banners
185
- /// @since 0.2.0
186
- /// @deprecated Use $agile-phase instead
187
- $live: #578137;
188
-
189
- /// Error text and border colour
190
- /// @since 1.7.0
191
- $error: #b50f23;
192
-
193
- /// Error background colour
194
- /// @since 1.7.0
195
- $error-background: #f9eced;
196
-
197
- /// Caution text and border colour
198
- /// @since 1.7.0
199
- $caution: #dc8a07;
200
-
201
- /// Caution background colour
202
- /// @since 1.7.0
203
- $caution-background: #fbf7f1;
204
-
205
- /// Info text and border colour
206
- /// @since 1.7.0
207
- $info: #3479d0;
208
-
209
- /// Info background colour
210
- /// @since 1.7.0
211
- $info-background: #eff4fc;
212
-
213
- /// Success text and border colour
214
- /// @since 1.7.0
215
- $success: #68c103;
216
-
217
- /// Success background colour
218
- /// @since 1.7.0
219
- $success-background: #f3faeb;
220
-
221
- /// <mark> tag highlighter colour
222
- /// @since 1.2.4
223
- $mark: #fff999;
224
-
225
- // GUIDANCE TYPES
226
-
227
- /// New guidance colour
228
- /// @since 0.3.0
229
- $guidance-new: nice-brand.$nice-purple;
230
-
231
- /// Updated guidance colour
232
- /// @since 0.3.0
233
- $guidance-updated: nice-brand.$nice-blue-3;
234
-
235
- /// In consultation guidance colour
236
- /// @since 0.3.0
237
- $guidance-consultation: #557021;
238
-
239
- // HERO
240
-
241
- /// Background colour for the hero component
242
- /// @since 0.5.2
243
- $hero-background: nice-brand.$nice-teal-2;
244
-
245
- /// Colour for the border in the hero component
246
- /// @since 0.5.2
247
- $hero-border: nice-brand.$nice-teal-3;
@@ -1,53 +0,0 @@
1
- // Text, links
2
- $nds-colour-text: $global-nice-black;
3
- $nds-colour-text-inverse: $global-white;
4
- $nds-colour-link: $global-custom-blue-1;
5
- $nds-colour-link-hover: $global-custom-blue-2;
6
- $nds-colour-link-visited: $global-custom-purple-1;
7
- $nds-colour-link-active: $global-nice-black;
8
- $nds-colour-link-inverse: $global-white;
9
- $nds-colour-link-inverse-hover: $global-custom-grey-2;
10
- $nds-colour-link-inverse-visited: $global-white;
11
- $nds-colour-link-inverse-active: $global-custom-grey-2;
12
- $nds-colour-link-focus: $global-custom-blue-1;
13
- $nds-colour-link-focus-inverse: $global-white;
14
-
15
- // Buttons
16
- $nds-colour-btn-cta: $global-yellow;
17
- $nds-colour-btn-cta-hover: $global-custom-yellow-shade;
18
- $nds-colour-btn-cta-text: $global-nice-black;
19
- $nds-colour-btn-primary: $global-black-tint-1;
20
- $nds-colour-btn-primary-hover: $global-nice-black;
21
- $nds-colour-btn-primary-text: $global-white;
22
- $nds-colour-btn-secondary: $global-custom-grey-3;
23
- $nds-colour-btn-secondary-hover: $global-black-tint-1;
24
- $nds-colour-btn-secondary-text: $global-white;
25
- $nds-colour-btn-inverse: $global-white;
26
- $nds-colour-btn-inverse-hover: $global-custom-grey-2;
27
- $nds-colour-btn-inverse-text: $global-nice-black;
28
-
29
- // Borders
30
- $nds-colour-border: $global-custom-grey-1;
31
- $nds-colour-border-selected: $global-nice-teal;
32
-
33
- // Status
34
- $nds-colour-status-error: $global-custom-red-1;
35
- $nds-colour-status-error-background: $global-custom-red-1-tint;
36
- $nds-colour-status-info: $global-custom-blue-3;
37
- $nds-colour-status-info-background: $global-custom-blue-3-tint;
38
- $nds-colour-status-caution: $global-custom-orange-1;
39
- $nds-colour-status-caution-background: $global-custom-orange-1-tint;
40
- $nds-colour-status-success: $global-custom-green-1;
41
- $nds-colour-status-success-background: $global-custom-green-1-tint;
42
-
43
- // Forms
44
- // $nds-colour-input: ;
45
- // $nds-colour-textarea: ;
46
- // $nds-colour-checkbox: ;
47
- // $nds-colour-checkbox-active: ;
48
- // $nds-colour-radio: ;
49
- // $nds-colour-radio-active: ;
50
- // $nds-colour-nav-bar-background: ;
51
- // $nds-colour-nav-bar-selected-background: ;
52
-
53
- // Components...
@@ -1,44 +0,0 @@
1
- // Global tokens - do not reference these directly, use alias tokens instead!
2
-
3
- // Primary palette
4
- $global-nice-teal: #228096;
5
- $global-nice-cream: #f7f4f1;
6
- $global-nice-blue: #00436c;
7
- $global-white: #fff;
8
- $global-black: #000;
9
- $global-nice-black: #0e0e0e;
10
-
11
- // Secondary palette
12
- $global-yellow: #ead054;
13
-
14
- // Tertiary palette
15
- $global-nice-teal-tint-1: #59a0b0;
16
- $global-nice-teal-tint-2: #91c0cb;
17
- $global-nice-teal-tint-3: #c8e0e6;
18
- $global-nice-blue-tint-1: #407291;
19
- $global-nice-blue-tint-2: #80a1b5;
20
- $global-nice-blue-tint-3: #bfd0da;
21
- $global-nice-cream-1: #ded5ca;
22
- $global-nice-cream-2: #e6e0d7;
23
- $global-nice-cream-3: #eeeae4;
24
- $global-nice-cream-tint-1: #fbfaf8;
25
- $global-black-tint-1: #404040;
26
- $global-black-tint-2: #808080;
27
- $global-black-tint-3: #bfbfbf;
28
-
29
- // Custom palette
30
- $global-custom-grey-1: #adadad;
31
- $global-custom-grey-2: #d6d6d6;
32
- $global-custom-grey-3: #666;
33
- $global-custom-blue-1: #005ea5;
34
- $global-custom-blue-2: #003761;
35
- $global-custom-blue-3: #3479d0;
36
- $global-custom-blue-3-tint: #eff4fc;
37
- $global-custom-purple-1: #4c2c92;
38
- $global-custom-red-1: #b50f23;
39
- $global-custom-red-1-tint: #f9eced;
40
- $global-custom-orange-1: #dc8a07;
41
- $global-custom-orange-1-tint: #fbf7f1;
42
- $global-custom-green-1: #68c103;
43
- $global-custom-green-1-tint: #f3faeb;
44
- $global-custom-yellow-shade: #d6ba32;
@@ -1,79 +0,0 @@
1
- @use "sass:math";
2
-
3
- @function power ($x, $n) {
4
- $ret: 1;
5
-
6
- @if $n > 0 {
7
- @for $i from 1 through $n {
8
- $ret: $ret * $x;
9
- }
10
- } @else {
11
- @for $i from $n to 0 {
12
- $ret: math.div($ret, $x);
13
- }
14
- }
15
-
16
- @return $ret;
17
- }
18
-
19
- @function factorial ($x) {
20
- $ret: 1;
21
-
22
- @if $x > 0 {
23
- @while $x > 0 {
24
- $ret: $ret * $x;
25
-
26
- $x: $x - 1;
27
- }
28
- }
29
-
30
- @return $ret;
31
- }
32
-
33
- @function sin ($x) {
34
- $ret: 0;
35
-
36
- @for $n from 0 to 25 {
37
- $ret: $ret + math.div(power(-1, $n) * power($x, 2 * $n + 1), factorial(2 * $n + 1));
38
- }
39
-
40
- @return $ret;
41
- }
42
-
43
- @function cos ($x) {
44
- $ret: 0;
45
-
46
- @for $n from 0 to 25 {
47
- $ret: $ret + math.div(power(-1, $n) * power($x, 2 * $n), factorial(2 * $n));
48
- }
49
-
50
- @return $ret;
51
- }
52
-
53
- @function exp ($x) {
54
- $ret: 0;
55
-
56
- @for $n from 0 to 25 {
57
- $ret: $ret + math.div(power($x, $n), factorial($n));
58
- }
59
-
60
- @return $ret;
61
- }
62
-
63
- @function ln($x) {
64
- $ret: 0;
65
- $n: 1;
66
- $dx: .001;
67
-
68
- @while $n <= $x {
69
- $ret: $ret + math.div($dx, $n);
70
-
71
- $n: $n + $dx;
72
- }
73
-
74
- @return $ret;
75
- }
76
-
77
- @function sqrt($x) {
78
- @return exp(0.5 * ln($x));
79
- }