nsw-design-system 2.13.0 → 3.0.2
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/CHANGELOG.md +79 -0
- package/README.md +50 -20
- package/dist/css/core.css +2 -0
- package/dist/css/main.css +1 -1
- package/dist/js/main.js +208 -124
- package/package.json +4 -2
- package/src/components/_all.scss +27 -0
- package/src/components/accordion/_accordion.scss +68 -30
- package/src/components/accordion/accordion.js +61 -14
- package/src/components/breadcrumbs/_breadcrumbs.scss +34 -43
- package/src/components/button/_button.scss +171 -27
- package/src/components/callout/_callout.scss +13 -57
- package/src/components/card/_card.scss +222 -71
- package/src/components/content-block/_content-block.scss +16 -45
- package/src/components/filters/_filters.scss +25 -85
- package/src/components/filters/filters.js +0 -5
- package/src/components/footer/_footer.scss +80 -132
- package/src/components/{forms/_forms.scss → form/_form.scss} +122 -75
- package/src/components/global-alert/_global-alert.scss +68 -0
- package/src/components/{site-wide-message/site-wide-message.js → global-alert/global-alert.js} +3 -3
- package/src/components/header/_header.scss +196 -227
- package/src/components/hero-banner/_hero-banner.scss +152 -86
- package/src/components/hero-search/_hero-search.scss +26 -38
- package/src/components/in-page-alert/_in-page-alert.scss +54 -0
- package/src/components/in-page-nav/_in-page-nav.scss +22 -0
- package/src/components/link-list/_link-list.scss +28 -47
- package/src/components/list-item/_list-item.scss +31 -43
- package/src/components/main-nav/_main-nav.scss +272 -0
- package/src/components/{main-navigation/main-navigation.js → main-nav/main-nav.js} +40 -39
- package/src/components/masthead/_masthead.scss +61 -0
- package/src/components/media/_media.scss +14 -2
- package/src/components/pagination/_pagination.scss +37 -41
- package/src/components/progress-indicator/_progress-indicator.scss +11 -11
- package/src/components/side-nav/_side-nav.scss +73 -0
- package/src/components/table/_table.scss +56 -0
- package/src/components/tables/_tables.scss +0 -71
- package/src/components/tabs/_tabs.scss +79 -0
- package/src/components/{tab-navigation/tab-navigation.js → tabs/tabs.js} +9 -9
- package/src/components/tag/_tag.scss +60 -0
- package/src/core/_all.scss +6 -0
- package/src/core/grid/_grid.scss +117 -0
- package/src/core/iconography/_icon.scss +83 -0
- package/src/core/layout/_layout.scss +42 -0
- package/src/core/section/_section.scss +95 -0
- package/src/{global/scss/helpers → core/spacing}/_spacing.scss +27 -4
- package/src/core/typography/_typography.scss +266 -0
- package/src/global/scss/base/_all.scss +4 -0
- package/src/global/scss/base/_functions.scss +44 -0
- package/src/global/scss/{style/_base.scss → base/_global.scss} +1 -2
- package/src/global/scss/base/_mixins.scss +241 -0
- package/src/global/scss/{tools → base}/_print.scss +3 -3
- package/src/global/scss/helpers/_all.scss +4 -3
- package/src/global/scss/helpers/_colour.scss +86 -0
- package/src/global/scss/helpers/_list.scss +21 -0
- package/src/global/scss/helpers/_text.scss +9 -0
- package/src/global/scss/helpers/_visibility.scss +31 -0
- package/src/global/scss/settings/_palette.scss +69 -0
- package/src/global/scss/settings/_settings.scss +12 -296
- package/src/global/scss/settings/_theme.scss +82 -0
- package/src/main.js +8 -11
- package/src/main.scss +17 -21
- package/dist/assets/svg/sprite.svg +0 -1
- package/src/components/banner/_banner.scss +0 -170
- package/src/components/direction-links/_direction-links.scss +0 -62
- package/src/components/feature-tile/_feature-tile.scss +0 -175
- package/src/components/forms/_forms-prev.scss +0 -357
- package/src/components/in-page-navigation/_in-page-navigation.scss +0 -26
- package/src/components/main-navigation/_main-navigation.scss +0 -405
- package/src/components/notification/_notification.scss +0 -69
- package/src/components/side-navigation/_side-navigation.scss +0 -85
- package/src/components/site-wide-message/_site-wide-message.scss +0 -148
- package/src/components/social-bar/_social-bar.scss +0 -27
- package/src/components/social-bar/social-bar.js +0 -24
- package/src/components/tab-navigation/_tab-navigation.scss +0 -69
- package/src/components/tags/_tags.scss +0 -65
- package/src/global/scss/helpers/_section.scss +0 -50
- package/src/global/scss/helpers/_sr-only.scss +0 -8
- package/src/global/scss/style/_all.scss +0 -4
- package/src/global/scss/style/_docs.scss +0 -538
- package/src/global/scss/style/_grid.scss +0 -171
- package/src/global/scss/style/_icons.scss +0 -68
- package/src/global/scss/tools/_all.scss +0 -10
- package/src/global/scss/tools/_breakpoint.scss +0 -16
- package/src/global/scss/tools/_buttons.scss +0 -15
- package/src/global/scss/tools/_focus.scss +0 -26
- package/src/global/scss/tools/_general.scss +0 -189
- package/src/global/scss/tools/_grid.scss +0 -129
- package/src/global/scss/tools/_links.scss +0 -18
- package/src/global/scss/tools/_spacing.scss +0 -37
- package/src/global/scss/tools/_sr-only.scss +0 -21
- package/src/global/scss/tools/_typography.scss +0 -90
- package/src/styles/grid/_grid.scss +0 -0
- package/src/styles/iconography/_iconography.scss +0 -0
- package/src/styles/layout/_layout.scss +0 -0
- package/src/styles/typography/_typography.scss +0 -219
|
@@ -3,60 +3,98 @@
|
|
|
3
3
|
|
|
4
4
|
&__title,
|
|
5
5
|
&__button {
|
|
6
|
-
@include font-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
background-color: $light10;
|
|
6
|
+
@include font-size('md');
|
|
7
|
+
font-weight: var(--nsw-font-bold);
|
|
8
|
+
padding: rem(16px) rem(48px) rem(16px) rem(16px);
|
|
9
|
+
margin-top: rem(8px);
|
|
10
|
+
background-color: var(--nsw-off-white);
|
|
12
11
|
display: block;
|
|
13
12
|
width: 100%;
|
|
14
13
|
text-align: left;
|
|
15
14
|
position: relative;
|
|
15
|
+
transition: background $nsw-transition-duration, color $nsw-transition-duration;
|
|
16
|
+
|
|
17
|
+
.active,
|
|
18
|
+
&:hover & {
|
|
19
|
+
background-color: var(--nsw-brand-dark);
|
|
20
|
+
color: var(--nsw-text-light);
|
|
21
|
+
|
|
22
|
+
.nsw-material-icons {
|
|
23
|
+
color: var(--nsw-text-light);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
&__toggle {
|
|
29
|
+
display: flex;
|
|
30
|
+
justify-content: flex-end;
|
|
31
|
+
margin-bottom: rem(16px);
|
|
32
|
+
|
|
33
|
+
button {
|
|
34
|
+
@include font-size('sm');
|
|
35
|
+
color: var(--nsw-brand-dark);
|
|
36
|
+
text-decoration: underline;
|
|
37
|
+
text-decoration-skip-ink: auto;
|
|
38
|
+
font-weight: var(--nsw-font-bold);
|
|
39
|
+
border: 0;
|
|
40
|
+
padding: 0;
|
|
41
|
+
background: none;
|
|
42
|
+
|
|
43
|
+
&:hover:enabled {
|
|
44
|
+
@include nsw-hover;
|
|
45
|
+
outline: 2px solid var(--nsw-text-hover);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
&:focus {
|
|
49
|
+
@include nsw-focus($offset: false);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
&:first-child {
|
|
53
|
+
margin-right: rem(24px);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
&:disabled {
|
|
57
|
+
opacity: 0.4;
|
|
58
|
+
cursor: not-allowed;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
16
61
|
}
|
|
17
62
|
|
|
18
63
|
&__title {
|
|
19
|
-
.
|
|
20
|
-
border-left: 0;
|
|
64
|
+
.ready & {
|
|
21
65
|
padding: 0;
|
|
22
66
|
margin-top: 0;
|
|
23
67
|
}
|
|
68
|
+
|
|
69
|
+
.nsw-material-icons {
|
|
70
|
+
font-size: rem(map-get($nsw-icon-sizes, 30));
|
|
71
|
+
color: var(--nsw-brand-dark);
|
|
72
|
+
transform: translateY(-50%);
|
|
73
|
+
position: absolute;
|
|
74
|
+
top: 50%;
|
|
75
|
+
right: rem(8px);
|
|
76
|
+
transition: transform $nsw-transition-duration, color $nsw-transition-duration;
|
|
77
|
+
}
|
|
24
78
|
}
|
|
25
79
|
|
|
26
80
|
&__button {
|
|
27
81
|
border: 0;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
&:hover {
|
|
31
|
-
@include nsw-hover;
|
|
32
|
-
}
|
|
82
|
+
color: var(--nsw-text-dark);
|
|
33
83
|
|
|
34
84
|
&:focus {
|
|
35
85
|
@include nsw-focus;
|
|
36
86
|
@include z-index;
|
|
37
87
|
position: relative;
|
|
38
88
|
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
&__icon {
|
|
42
|
-
transform: translateY(-50%) rotate(90deg);
|
|
43
|
-
position: absolute;
|
|
44
|
-
top: 50%;
|
|
45
|
-
right: rem(9px);
|
|
46
|
-
|
|
47
|
-
.is-open & {
|
|
48
|
-
transform: translateY(-50%) rotate(270deg);
|
|
49
|
-
}
|
|
50
89
|
|
|
51
|
-
&.
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
90
|
+
&.active {
|
|
91
|
+
.nsw-material-icons {
|
|
92
|
+
transform: translateY(-50%) rotate(180deg);
|
|
93
|
+
}
|
|
55
94
|
}
|
|
56
95
|
}
|
|
57
96
|
|
|
58
97
|
&__content {
|
|
59
|
-
|
|
60
|
-
border-left: solid 4px $nsw-primary-blue;
|
|
98
|
+
padding: rem(16px);
|
|
61
99
|
}
|
|
62
100
|
}
|
|
@@ -10,7 +10,7 @@ function createButtons({ textContent }) {
|
|
|
10
10
|
button.setAttribute('aria-controls', uID)
|
|
11
11
|
button.classList.add('nsw-accordion__button')
|
|
12
12
|
button.insertAdjacentHTML('beforeend', `
|
|
13
|
-
<
|
|
13
|
+
<span class="material-icons nsw-material-icons" focusable="false" aria-hidden="true">keyboard_arrow_down</span>
|
|
14
14
|
`)
|
|
15
15
|
|
|
16
16
|
fragment.appendChild(button)
|
|
@@ -20,12 +20,17 @@ function createButtons({ textContent }) {
|
|
|
20
20
|
|
|
21
21
|
class Accordion {
|
|
22
22
|
constructor(element) {
|
|
23
|
+
const [expandAll, collapseAll] = Array.from(element.querySelectorAll('.nsw-accordion__toggle button'))
|
|
23
24
|
this.accordionHeadingClass = '.nsw-accordion__title'
|
|
24
25
|
this.accordion = element
|
|
25
26
|
this.headings = element.querySelectorAll(this.accordionHeadingClass)
|
|
27
|
+
this.expandAllBtn = expandAll
|
|
28
|
+
this.collapseAllBtn = collapseAll
|
|
26
29
|
this.buttons = []
|
|
27
30
|
this.content = []
|
|
28
|
-
this.
|
|
31
|
+
this.toggleEvent = (e) => this.toggle(e)
|
|
32
|
+
this.expandAllEvent = (e) => this.expandAll(e)
|
|
33
|
+
this.collapseAllEvent = (e) => this.collapseAll(e)
|
|
29
34
|
}
|
|
30
35
|
|
|
31
36
|
init() {
|
|
@@ -34,7 +39,10 @@ class Accordion {
|
|
|
34
39
|
}
|
|
35
40
|
|
|
36
41
|
setUpDom() {
|
|
37
|
-
this.accordion.classList.add('
|
|
42
|
+
this.accordion.classList.add('ready')
|
|
43
|
+
if (this.collapseAllBtn) {
|
|
44
|
+
this.collapseAllBtn.disabled = true
|
|
45
|
+
}
|
|
38
46
|
this.headings.forEach((heading) => {
|
|
39
47
|
const headingElem = heading
|
|
40
48
|
const contentElem = heading.nextElementSibling
|
|
@@ -54,26 +62,65 @@ class Accordion {
|
|
|
54
62
|
|
|
55
63
|
controls() {
|
|
56
64
|
this.buttons.forEach((element) => {
|
|
57
|
-
element.addEventListener('click', this.
|
|
65
|
+
element.addEventListener('click', this.toggleEvent, false)
|
|
58
66
|
})
|
|
67
|
+
if (this.expandAllBtn && this.collapseAllBtn) {
|
|
68
|
+
this.expandAllBtn.addEventListener('click', this.expandAllEvent, false)
|
|
69
|
+
this.collapseAllBtn.addEventListener('click', this.collapseAllEvent, false)
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
getTargetContent(element) {
|
|
74
|
+
const currentIndex = this.buttons.indexOf(element)
|
|
75
|
+
return this.content[currentIndex]
|
|
59
76
|
}
|
|
60
77
|
|
|
61
|
-
|
|
78
|
+
setAccordionState(element, state) {
|
|
79
|
+
const targetContent = this.getTargetContent(element)
|
|
80
|
+
|
|
81
|
+
if (state === 'open') {
|
|
82
|
+
element.classList.add('active')
|
|
83
|
+
element.setAttribute('aria-expanded', 'true')
|
|
84
|
+
targetContent.hidden = false
|
|
85
|
+
} else if (state === 'close') {
|
|
86
|
+
element.classList.remove('active')
|
|
87
|
+
element.setAttribute('aria-expanded', 'false')
|
|
88
|
+
targetContent.hidden = true
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
toggle(e) {
|
|
62
93
|
const { currentTarget } = e
|
|
63
|
-
const
|
|
64
|
-
const targetContent = this.content[currentIndex]
|
|
94
|
+
const targetContent = this.getTargetContent(currentTarget)
|
|
65
95
|
const isHidden = targetContent.hidden
|
|
66
96
|
|
|
67
|
-
if (isHidden) {
|
|
68
|
-
|
|
69
|
-
currentTarget.setAttribute('aria-expanded', 'true')
|
|
70
|
-
targetContent.hidden = false
|
|
97
|
+
if ((isHidden)) {
|
|
98
|
+
this.setAccordionState(currentTarget, 'open')
|
|
71
99
|
} else {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
100
|
+
this.setAccordionState(currentTarget, 'close')
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
if (this.expandAllBtn && this.collapseAllBtn) {
|
|
104
|
+
this.expandAllBtn.disabled = this.content.every((item) => item.hidden === false)
|
|
105
|
+
this.collapseAllBtn.disabled = this.content.every((item) => item.hidden === true)
|
|
75
106
|
}
|
|
76
107
|
}
|
|
108
|
+
|
|
109
|
+
expandAll() {
|
|
110
|
+
this.buttons.forEach((element) => {
|
|
111
|
+
this.setAccordionState(element, 'open')
|
|
112
|
+
})
|
|
113
|
+
this.expandAllBtn.disabled = true
|
|
114
|
+
this.collapseAllBtn.disabled = false
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
collapseAll() {
|
|
118
|
+
this.buttons.forEach((element) => {
|
|
119
|
+
this.setAccordionState(element, 'close')
|
|
120
|
+
})
|
|
121
|
+
this.expandAllBtn.disabled = false
|
|
122
|
+
this.collapseAllBtn.disabled = true
|
|
123
|
+
}
|
|
77
124
|
}
|
|
78
125
|
|
|
79
126
|
export default Accordion
|
|
@@ -1,72 +1,63 @@
|
|
|
1
|
-
.nsw-
|
|
2
|
-
@include font-stack;
|
|
1
|
+
.nsw-breadcrumbs {
|
|
3
2
|
@include font-size('xs');
|
|
4
|
-
|
|
3
|
+
margin-top: rem(24px);
|
|
5
4
|
|
|
6
|
-
|
|
5
|
+
ol {
|
|
7
6
|
margin: 0;
|
|
8
7
|
padding-left: 0;
|
|
9
8
|
list-style: none;
|
|
10
9
|
}
|
|
11
10
|
|
|
12
|
-
|
|
11
|
+
li {
|
|
13
12
|
display: none;
|
|
14
13
|
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
&::before {
|
|
15
|
+
@include material-icons;
|
|
16
|
+
content: 'keyboard_arrow_right';
|
|
17
|
+
font-size: rem(map-get($nsw-icon-sizes, 20));
|
|
18
|
+
line-height: rem(8px);
|
|
17
19
|
display: inline-block;
|
|
18
|
-
border-right: 2px solid currentColor;
|
|
19
|
-
border-bottom: 2px solid currentColor;
|
|
20
|
-
width: rem(6px);
|
|
21
|
-
height: rem(6px);
|
|
22
|
-
transform: rotate(-45deg);
|
|
23
|
-
margin-right: rem(6px);
|
|
24
|
-
margin-left: rem(6px);
|
|
25
|
-
top: -1px;
|
|
26
20
|
position: relative;
|
|
21
|
+
top: rem(6px);
|
|
27
22
|
}
|
|
28
23
|
|
|
29
24
|
@include breakpoint('md') {
|
|
30
25
|
display: inline;
|
|
31
26
|
}
|
|
32
|
-
}
|
|
33
27
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
28
|
+
&:nth-last-child(2),
|
|
29
|
+
&:last-child {
|
|
30
|
+
display: inline;
|
|
31
|
+
}
|
|
38
32
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
33
|
+
&:nth-last-child(2) {
|
|
34
|
+
&::before {
|
|
35
|
+
display: none;
|
|
42
36
|
|
|
43
|
-
|
|
44
|
-
|
|
37
|
+
@include breakpoint('md') {
|
|
38
|
+
display: inline-block;
|
|
39
|
+
}
|
|
45
40
|
}
|
|
46
41
|
}
|
|
47
|
-
}
|
|
48
42
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
text-decoration-skip-ink: auto;
|
|
43
|
+
&:first-child {
|
|
44
|
+
&::before {
|
|
45
|
+
display: none;
|
|
53
46
|
|
|
54
|
-
|
|
55
|
-
|
|
47
|
+
@include breakpoint('md') {
|
|
48
|
+
display: none;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
56
51
|
}
|
|
52
|
+
}
|
|
57
53
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
54
|
+
a {
|
|
55
|
+
font-weight: var(--nsw-font-normal);
|
|
61
56
|
|
|
62
|
-
|
|
63
|
-
|
|
57
|
+
&.current {
|
|
58
|
+
text-decoration: none;
|
|
59
|
+
pointer-events: none;
|
|
60
|
+
color: var(--nsw-text-dark);
|
|
64
61
|
}
|
|
65
62
|
}
|
|
66
|
-
|
|
67
|
-
&--current {
|
|
68
|
-
text-decoration: none;
|
|
69
|
-
pointer-events: none;
|
|
70
|
-
color: $dark80;
|
|
71
|
-
}
|
|
72
63
|
}
|
|
@@ -1,12 +1,81 @@
|
|
|
1
|
+
$nsw-buttons: (
|
|
2
|
+
dark: (
|
|
3
|
+
text-color: var(--nsw-text-light),
|
|
4
|
+
text-color-hover: var(--nsw-text-light),
|
|
5
|
+
background: var(--nsw-brand-dark),
|
|
6
|
+
background-hover: var(--nsw-brand-dark),
|
|
7
|
+
border: transparent,
|
|
8
|
+
border-hover: transparent,
|
|
9
|
+
focus: var(--nsw-focus),
|
|
10
|
+
hover: white
|
|
11
|
+
),
|
|
12
|
+
dark-outline: (
|
|
13
|
+
text-color: var(--nsw-brand-dark),
|
|
14
|
+
text-color-hover: var(--nsw-text-light),
|
|
15
|
+
background: transparent,
|
|
16
|
+
background-hover: var(--nsw-brand-dark),
|
|
17
|
+
border: var(--nsw-brand-dark),
|
|
18
|
+
focus: var(--nsw-focus),
|
|
19
|
+
border-hover: transparent
|
|
20
|
+
),
|
|
21
|
+
dark-outline-solid: (
|
|
22
|
+
text-color: var(--nsw-brand-dark),
|
|
23
|
+
text-color-hover: var(--nsw-text-light),
|
|
24
|
+
background: var(--nsw-white),
|
|
25
|
+
background-hover: var(--nsw-brand-dark),
|
|
26
|
+
border: var(--nsw-brand-dark),
|
|
27
|
+
focus: var(--nsw-focus),
|
|
28
|
+
border-hover: transparent
|
|
29
|
+
),
|
|
30
|
+
light: (
|
|
31
|
+
text-color: var(--nsw-text-dark),
|
|
32
|
+
text-color-hover: var(--nsw-text-dark),
|
|
33
|
+
background: var(--nsw-brand-light),
|
|
34
|
+
background-hover: var(--nsw-brand-light),
|
|
35
|
+
border: transparent,
|
|
36
|
+
border-hover: transparent,
|
|
37
|
+
focus: var(--nsw-focus),
|
|
38
|
+
hover: black
|
|
39
|
+
),
|
|
40
|
+
light-outline: (
|
|
41
|
+
text-color: var(--nsw-brand-light),
|
|
42
|
+
text-color-hover: var(--nsw-text-dark),
|
|
43
|
+
background: transparent,
|
|
44
|
+
background-hover: var(--nsw-brand-light),
|
|
45
|
+
border: var(--nsw-brand-light),
|
|
46
|
+
focus: var(--nsw-focus),
|
|
47
|
+
border-hover: transparent
|
|
48
|
+
),
|
|
49
|
+
white: (
|
|
50
|
+
text-color: var(--nsw-text-dark),
|
|
51
|
+
text-color-hover: var(--nsw-text-dark),
|
|
52
|
+
background: var(--nsw-white),
|
|
53
|
+
background-hover: var(--nsw-white),
|
|
54
|
+
border: transparent,
|
|
55
|
+
border-hover: transparent,
|
|
56
|
+
focus: var(--nsw-white),
|
|
57
|
+
hover: black
|
|
58
|
+
),
|
|
59
|
+
danger: (
|
|
60
|
+
text-color: var(--nsw-text-light),
|
|
61
|
+
text-color-hover: var(--nsw-text-light),
|
|
62
|
+
background: var(--nsw-status-error),
|
|
63
|
+
background-hover: var(--nsw-status-error),
|
|
64
|
+
border: transparent,
|
|
65
|
+
border-hover: transparent,
|
|
66
|
+
focus: var(--nsw-focus),
|
|
67
|
+
hover: white
|
|
68
|
+
)
|
|
69
|
+
);
|
|
70
|
+
|
|
1
71
|
.nsw-button {
|
|
2
|
-
@include font-stack('heading');
|
|
3
72
|
@include font-size('sm');
|
|
4
|
-
|
|
5
|
-
|
|
73
|
+
border-radius: var(--nsw-border-radius);
|
|
74
|
+
font-weight: var(--nsw-font-bold);
|
|
6
75
|
border: solid 2px transparent;
|
|
7
76
|
white-space: normal;
|
|
8
77
|
text-decoration: none;
|
|
9
|
-
padding: rem(
|
|
78
|
+
padding: rem(10px) rem(22px);
|
|
10
79
|
cursor: pointer;
|
|
11
80
|
-webkit-appearance: none; /* stylelint-disable-line property-no-vendor-prefix */
|
|
12
81
|
text-decoration: none;
|
|
@@ -20,45 +89,120 @@
|
|
|
20
89
|
min-width: rem(124px);
|
|
21
90
|
}
|
|
22
91
|
|
|
92
|
+
&:hover {
|
|
93
|
+
outline: none;
|
|
94
|
+
}
|
|
95
|
+
|
|
23
96
|
&:focus {
|
|
24
97
|
@include nsw-focus;
|
|
25
98
|
}
|
|
26
99
|
|
|
27
|
-
@each $color, $
|
|
100
|
+
@each $color, $property-map in $nsw-buttons {
|
|
28
101
|
&--#{"" + $color} {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
102
|
+
color: map-get($property-map, text-color);
|
|
103
|
+
background-color: map-get($property-map, background);
|
|
104
|
+
border-color: map-get($property-map, border);
|
|
105
|
+
|
|
106
|
+
&:visited {
|
|
107
|
+
color: map-get($property-map, text-color);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
&:focus {
|
|
111
|
+
outline-color: map-get($property-map, focus);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
&:hover {
|
|
115
|
+
color: map-get($property-map, text-color-hover);
|
|
116
|
+
background-color: map-get($property-map, background-hover);
|
|
117
|
+
border-color: map-get($property-map, border-hover);
|
|
118
|
+
@if map-get($property-map, hover) == white {
|
|
119
|
+
background-image: linear-gradient(rgba(var(--nsw-white-rgb), 0.15), rgba(var(--nsw-white-rgb), 0.15));
|
|
120
|
+
}
|
|
121
|
+
@if map-get($property-map, hover) == black {
|
|
122
|
+
background-image: linear-gradient(rgba(var(--nsw-black-rgb), 0.07), rgba(var(--nsw-black-rgb), 0.07));
|
|
123
|
+
}
|
|
32
124
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
125
|
+
.nsw-material-icons {
|
|
126
|
+
color: map-get($property-map, text-color-hover);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
&:disabled,
|
|
131
|
+
&.disabled {
|
|
132
|
+
color: map-get($property-map, text-color);
|
|
133
|
+
background-color: map-get($property-map, background);
|
|
134
|
+
border-color: map-get($property-map, border);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.nsw-material-icons {
|
|
138
|
+
color: map-get($property-map, text-color);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
36
141
|
}
|
|
37
142
|
|
|
38
143
|
&:disabled,
|
|
39
144
|
&.disabled {
|
|
40
|
-
|
|
41
|
-
color: $light40;
|
|
42
|
-
border-color: $light10;
|
|
145
|
+
opacity: 0.4;
|
|
43
146
|
cursor: not-allowed;
|
|
44
147
|
}
|
|
45
|
-
}
|
|
46
148
|
|
|
47
|
-
.nsw-
|
|
48
|
-
|
|
49
|
-
|
|
149
|
+
.nsw-material-icons {
|
|
150
|
+
font-size: rem(map-get($nsw-icon-sizes, 24));
|
|
151
|
+
line-height: rem(10px);
|
|
152
|
+
position: relative;
|
|
153
|
+
bottom: rem(-7px);
|
|
154
|
+
|
|
155
|
+
&:first-child {
|
|
156
|
+
margin-right: rem(8px);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
&:last-child {
|
|
160
|
+
margin-left: rem(8px);
|
|
161
|
+
}
|
|
50
162
|
|
|
51
|
-
|
|
52
|
-
|
|
163
|
+
&:only-child {
|
|
164
|
+
margin: 0;
|
|
165
|
+
}
|
|
53
166
|
}
|
|
54
|
-
}
|
|
55
167
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
168
|
+
&--small {
|
|
169
|
+
@include font-size('xs');
|
|
170
|
+
padding: rem(5px);
|
|
171
|
+
|
|
172
|
+
.nsw-material-icons {
|
|
173
|
+
font-size: rem(map-get($nsw-icon-sizes, 20));
|
|
59
174
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
175
|
+
&:first-child {
|
|
176
|
+
margin-right: rem(4px);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
&:last-child {
|
|
180
|
+
margin-left: rem(4px);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
&:only-child {
|
|
184
|
+
margin: 0;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
&--flex {
|
|
190
|
+
display: flex;
|
|
191
|
+
justify-content: center;
|
|
192
|
+
align-items: center;
|
|
193
|
+
|
|
194
|
+
.nsw-material-icons {
|
|
195
|
+
position: static;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
&--full-width {
|
|
200
|
+
display: block;
|
|
201
|
+
width: 100%;
|
|
202
|
+
|
|
203
|
+
@include breakpoint($nsw-desktop-breakpoint) {
|
|
204
|
+
display: inline-block;
|
|
205
|
+
width: auto;
|
|
206
|
+
}
|
|
63
207
|
}
|
|
64
208
|
}
|
|
@@ -1,83 +1,39 @@
|
|
|
1
1
|
.nsw-callout {
|
|
2
|
-
@include nsw-spacing(padding, md);
|
|
3
2
|
@include component-spacing();
|
|
4
|
-
|
|
3
|
+
padding: rem(16px);
|
|
4
|
+
background: var(--nsw-off-white);
|
|
5
5
|
position: relative;
|
|
6
|
-
border-left: solid 6px
|
|
6
|
+
border-left: solid 6px var(--nsw-brand-dark);
|
|
7
7
|
|
|
8
8
|
@include breakpoint('md') {
|
|
9
|
-
@include nsw-spacing(padding, lg lg lg md);
|
|
10
9
|
display: flex;
|
|
11
10
|
flex-direction: row;
|
|
12
11
|
flex-wrap: nowrap;
|
|
12
|
+
padding: rem(24px) rem(24px) rem(24px) rem(16px);
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
.nsw-material-icons {
|
|
16
|
+
font-size: rem(map-get($nsw-icon-sizes, 30));
|
|
17
|
+
color: var(--nsw-brand-dark);
|
|
18
|
+
display: block;
|
|
19
|
+
|
|
16
20
|
+ .nsw-callout__content {
|
|
17
|
-
margin-top:
|
|
21
|
+
margin-top: rem(12px);
|
|
18
22
|
}
|
|
19
23
|
|
|
20
24
|
@include breakpoint('md') {
|
|
21
|
-
margin-right:
|
|
25
|
+
margin-right: rem(16px);
|
|
22
26
|
flex: 0 0 auto;
|
|
23
27
|
|
|
24
28
|
+ .nsw-callout__content {
|
|
25
29
|
margin-top: 0;
|
|
26
30
|
}
|
|
27
|
-
|
|
28
|
-
&.nsw-icon {
|
|
29
|
-
width: rem(32px);
|
|
30
|
-
height: rem(32px);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
&.nsw-material-icons {
|
|
35
|
-
position: relative;
|
|
36
|
-
top: -3px;
|
|
37
|
-
left: -3px;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
&.nsw-icon {
|
|
41
|
-
width: rem(24px);
|
|
42
|
-
height: rem(24px);
|
|
43
|
-
|
|
44
|
-
+ .nsw-callout__content {
|
|
45
|
-
@include nsw-spacing(margin-top, md);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
@include breakpoint('md') {
|
|
49
|
-
@include nsw-spacing(margin-right, md);
|
|
50
|
-
|
|
51
|
-
+ .nsw-callout__content {
|
|
52
|
-
@include nsw-spacing(margin-top, none);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
31
|
}
|
|
56
32
|
}
|
|
57
33
|
|
|
58
34
|
&__content {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
@include breakpoint('md') {
|
|
62
|
-
@include nsw-spacing(margin-top, none);
|
|
35
|
+
*+p {
|
|
36
|
+
margin-top: rem(12px);
|
|
63
37
|
}
|
|
64
|
-
|
|
65
|
-
p:not([class]) {
|
|
66
|
-
@include nsw-spacing(margin, sm none none none);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
a:not([class]) {
|
|
70
|
-
@include text-link;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
.nsw-text-link {
|
|
74
|
-
@include nsw-spacing(margin-top, sm);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
&__title {
|
|
79
|
-
@include font-stack('heading');
|
|
80
|
-
@include font-size('md');
|
|
81
|
-
margin: 0;
|
|
82
38
|
}
|
|
83
39
|
}
|