@qld-gov-au/qgds-bootstrap5 2.0.0 → 2.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.
Files changed (86) hide show
  1. package/dist/assets/components/bs5/accordion/accordion.hbs +3 -3
  2. package/dist/assets/components/bs5/banner/banner.hbs +0 -7
  3. package/dist/assets/components/bs5/head/head.hbs +1 -1
  4. package/dist/assets/components/bs5/quickexit/quickexit.hbs +1 -1
  5. package/dist/assets/css/qld.bootstrap.css +1 -1
  6. package/dist/assets/css/qld.bootstrap.css.map +3 -3
  7. package/dist/assets/js/handlebars.init.min.js +5 -12
  8. package/dist/assets/js/handlebars.init.min.js.map +2 -2
  9. package/dist/assets/node/handlebars.init.min.js +32 -4
  10. package/dist/assets/node/handlebars.init.min.js.map +2 -2
  11. package/dist/components/bs5/accordion/accordion.hbs +3 -3
  12. package/dist/components/bs5/banner/banner.hbs +0 -7
  13. package/dist/components/bs5/head/head.hbs +1 -1
  14. package/dist/components/bs5/quickexit/quickexit.hbs +1 -1
  15. package/dist/package.json +1 -1
  16. package/dist/sample-data/accordion/accordion.data.json +24 -23
  17. package/package.json +1 -1
  18. package/src/components/bs5/accordion/Accordion.mdx +1 -3
  19. package/src/components/bs5/accordion/__snapshots__/accordion.test.js.snap +3 -3
  20. package/src/components/bs5/accordion/accordion.data.json +24 -23
  21. package/src/components/bs5/accordion/accordion.hbs +3 -3
  22. package/src/components/bs5/accordion/accordion.scss +19 -9
  23. package/src/components/bs5/accordion/accordion.stories.js +8 -0
  24. package/src/components/bs5/accordion/accordion.test.js +5 -0
  25. package/src/components/bs5/backToTop/backToTop.mdx +4 -5
  26. package/src/components/bs5/banner/Banner.mdx +1 -3
  27. package/src/components/bs5/banner/banner.hbs +0 -7
  28. package/src/components/bs5/blockquote/Blockquote.mdx +4 -5
  29. package/src/components/bs5/breadcrumbs/Breadcrumbs.mdx +1 -3
  30. package/src/components/bs5/button/Button.mdx +4 -5
  31. package/src/components/bs5/button/button.scss +9 -1
  32. package/src/components/bs5/callToAction/callToAction.mdx +1 -3
  33. package/src/components/bs5/callout/Callout.mdx +4 -5
  34. package/src/components/bs5/card/Card.mdx +1 -3
  35. package/src/components/bs5/card/card.scss +1 -25
  36. package/src/components/bs5/directionLinks/DirectionLinks.mdx +4 -5
  37. package/src/components/bs5/footer/Footer.mdx +1 -3
  38. package/src/components/bs5/footer/footer.scss +4 -11
  39. package/src/components/bs5/formcheck/stories/checkbox/Checkbox.mdx +7 -6
  40. package/src/components/bs5/formcheck/stories/radio/Radio.mdx +7 -6
  41. package/src/components/bs5/globalAlert/GlobalAlert.mdx +1 -3
  42. package/src/components/bs5/globalAlert/globalAlert.scss +6 -0
  43. package/src/components/bs5/header/Header.mdx +1 -3
  44. package/src/components/bs5/header/header.scss +6 -2
  45. package/src/components/bs5/icons/Icons.mdx +167 -7
  46. package/src/components/bs5/icons/_icons.sizes.scss +9 -0
  47. package/src/components/bs5/icons/icons.scss +23 -71
  48. package/src/components/bs5/icons/icons.stories.js +34 -57
  49. package/src/components/bs5/icons/mdx/_IconsSizes.mdx +112 -0
  50. package/src/components/bs5/icons/stories/storyFlexContainer.html +18 -0
  51. package/src/components/bs5/icons/stories/storyInlineWithText.html +18 -0
  52. package/src/components/bs5/icons/stories/storySizes.html +89 -0
  53. package/src/components/bs5/image/Image.mdx +1 -4
  54. package/src/components/bs5/inpageAlert/InpageAlert.mdx +1 -3
  55. package/src/components/bs5/inpagenav/Inpagenav.mdx +4 -5
  56. package/src/components/bs5/link/link.mdx +1 -3
  57. package/src/components/bs5/link/link.scss +2 -15
  58. package/src/components/bs5/linkColumns/linkColumns.mdx +1 -3
  59. package/src/components/bs5/logo/Logo.mdx +1 -3
  60. package/src/components/bs5/pageLayout/ThemeShowcase.stories.js +249 -0
  61. package/src/components/bs5/pagination/Pagination.mdx +4 -5
  62. package/src/components/bs5/promotionalPanel/PromotionalPanel.mdx +1 -3
  63. package/src/components/bs5/quickexit/quickexit.hbs +1 -1
  64. package/src/components/bs5/quickexit/quickexit.scss +23 -10
  65. package/src/components/bs5/searchInput/SearchInput.mdx +5 -5
  66. package/src/components/bs5/sidenav/Sidenav.mdx +4 -5
  67. package/src/components/bs5/skiplinks/SkipLinks.mdx +1 -3
  68. package/src/components/bs5/table/Table.mdx +4 -5
  69. package/src/components/bs5/tabs/Tabs.mdx +4 -5
  70. package/src/components/bs5/tabs/tabs.scss +22 -1
  71. package/src/components/bs5/tag/Tag.mdx +4 -5
  72. package/src/components/bs5/typography/Typography.mdx +4 -5
  73. package/src/components/bs5/video/Video.mdx +4 -5
  74. package/src/css/functions/_index.scss +1 -0
  75. package/src/css/functions/in-list.scss +5 -0
  76. package/src/css/main.scss +4 -3
  77. package/src/css/mixins/_index.scss +3 -0
  78. package/src/css/mixins/make-icon.scss +87 -0
  79. package/src/css/qld-theme.scss +73 -31
  80. package/src/css/qld-type.scss +26 -140
  81. package/src/css/qld-utilities.scss +29 -14
  82. package/src/css/qld-variables.scss +4 -4
  83. package/src/css/variables/_index.scss +1 -0
  84. package/src/css/variables/type.scss +58 -0
  85. package/src/components/bs5/icons/story-icon-sizing.html +0 -131
  86. package/src/components/bs5/icons/story-icon-usage.html +0 -89
@@ -1,3 +1,4 @@
1
+ @use "../../../css/mixins" as m;
1
2
  // ----------------------------------------------------------------------------------------------------------------------
2
3
  // Header - palettes and second hand variables:
3
4
  @import "./colours";
@@ -58,8 +59,10 @@
58
59
  position: absolute;
59
60
  }
60
61
  .qld-tooltip-wrapper:after {
61
- border-block-end: var(--#{$prefix}tooltip-arrow) solid var(--#{$prefix}quick-exit-tooltip-bg);
62
- border-inline-start: var(--#{$prefix}tooltip-arrow) solid var(--#{$prefix}quick-exit-tooltip-bg);
62
+ border-block-end: var(--#{$prefix}tooltip-arrow) solid
63
+ var(--#{$prefix}quick-exit-tooltip-bg);
64
+ border-inline-start: var(--#{$prefix}tooltip-arrow) solid
65
+ var(--#{$prefix}quick-exit-tooltip-bg);
63
66
  border-inline-end: var(--#{$prefix}tooltip-arrow) solid transparent;
64
67
  border-block-start: var(--#{$prefix}tooltip-arrow) solid transparent;
65
68
  inset-block-end: calc(var(--#{$prefix}tooltip-arrow) * -1);
@@ -75,7 +78,8 @@
75
78
  &:focus-within {
76
79
  outline-offset: var(--#{$prefix}quick-exit-text-outline-offset);
77
80
  box-shadow: none;
78
- outline: var(--#{$prefix}quick-exit-text-outline) solid var(--#{$prefix}quick-exit-tooltip-btn-focus);
81
+ outline: var(--#{$prefix}quick-exit-text-outline) solid
82
+ var(--#{$prefix}quick-exit-tooltip-btn-focus);
79
83
  border-radius: 0;
80
84
  }
81
85
  }
@@ -84,9 +88,13 @@
84
88
  font-weight: 500;
85
89
  text-decoration-line: underline;
86
90
  text-decoration-style: solid;
87
- text-underline-offset: calc(var(--#{$prefix}quick-exit-text-outline-offset) * 2);
91
+ text-underline-offset: calc(
92
+ var(--#{$prefix}quick-exit-text-outline-offset) * 2
93
+ );
88
94
  &:hover {
89
- text-decoration-thickness: var(--#{$prefix}link-underline-thickness-hover);
95
+ text-decoration-thickness: var(
96
+ --#{$prefix}link-underline-thickness-hover
97
+ );
90
98
  }
91
99
  }
92
100
  .qld-tooltip-prompt {
@@ -117,6 +125,7 @@
117
125
  border-color: var(--#{$prefix}quick-exit-button-bg-colour);
118
126
  background-color: var(--#{$prefix}quick-exit-button-bg-colour);
119
127
  color: var(--#{$prefix}quick-exit-button-text-colour);
128
+ display: inline-block;
120
129
  &:hover {
121
130
  border-color: var(--#{$prefix}quick-exit-button-bg-colour-hover);
122
131
  background-color: var(--#{$prefix}quick-exit-button-bg-colour-hover);
@@ -129,7 +138,9 @@
129
138
  }
130
139
  &:hover,
131
140
  &:focus {
132
- text-decoration-thickness: var(--#{$prefix}link-underline-thickness-hover);
141
+ text-decoration-thickness: var(
142
+ --#{$prefix}link-underline-thickness-hover
143
+ );
133
144
  }
134
145
  }
135
146
  .qg-quick-exit__tips {
@@ -143,9 +154,9 @@
143
154
  .icon-info {
144
155
  position: absolute;
145
156
  inset-inline-start: 0;
146
- background-repeat: no-repeat;
147
157
  margin-block-start: 4px;
148
- background-image: url("data:image/svg+xml,<svg width='18' height='19' viewBox='0 0 18 19' fill='none' xmlns='http://www.w3.org/2000/svg'><path d='M9 0.25C4.00781 0.25 0 4.29297 0 9.25C0 14.2422 4.00781 18.25 9 18.25C13.957 18.25 18 14.2422 18 9.25C18 4.29297 13.957 0.25 9 0.25ZM9 17.125C4.64062 17.125 1.125 13.6094 1.125 9.25C1.125 4.92578 4.64062 1.375 9 1.375C13.3242 1.375 16.875 4.92578 16.875 9.25C16.875 13.6094 13.3242 17.125 9 17.125ZM9 6.71875C9.45703 6.71875 9.84375 6.36719 9.84375 5.875C9.84375 5.41797 9.45703 5.03125 9 5.03125C8.50781 5.03125 8.15625 5.41797 8.15625 5.875C8.15625 6.36719 8.50781 6.71875 9 6.71875ZM10.6875 12.625H9.5625V8.6875C9.5625 8.40625 9.28125 8.125 9 8.125H7.875C7.55859 8.125 7.3125 8.40625 7.3125 8.6875C7.3125 9.00391 7.55859 9.25 7.875 9.25H8.4375V12.625H7.3125C6.99609 12.625 6.75 12.9062 6.75 13.1875C6.75 13.5039 6.99609 13.75 7.3125 13.75H10.6875C10.9688 13.75 11.25 13.5039 11.25 13.1875C11.25 12.9062 10.9688 12.625 10.6875 12.625Z' fill='white'/></svg>");
158
+ @include m.make-icon("alert-information");
159
+ --#{$prefix}icon-color: #{$qld-dark-action-secondary};
149
160
  }
150
161
  @include media-breakpoint-up(lg) {
151
162
  -webkit-box-pack: justify;
@@ -188,8 +199,10 @@
188
199
  .qld-tooltip-wrapper:after {
189
200
  border-block-end: var(--#{$prefix}tooltip-arrow) solid transparent;
190
201
  border-inline-start: var(--#{$prefix}tooltip-arrow) solid transparent;
191
- border-inline-end: var(--#{$prefix}tooltip-arrow) solid var(--#{$prefix}quick-exit-tooltip-bg);
192
- border-block-start: var(--#{$prefix}tooltip-arrow) solid var(--#{$prefix}quick-exit-tooltip-bg);
202
+ border-inline-end: var(--#{$prefix}tooltip-arrow) solid
203
+ var(--#{$prefix}quick-exit-tooltip-bg);
204
+ border-block-start: var(--#{$prefix}tooltip-arrow) solid
205
+ var(--#{$prefix}quick-exit-tooltip-bg);
193
206
  inset-block-end: auto;
194
207
  inset-inline-start: 25px;
195
208
  inset-block-start: calc(var(--#{$prefix}tooltip-arrow) * -1);
@@ -1,12 +1,12 @@
1
- import { Canvas, Meta, Story } from "@storybook/blocks"
2
- import * as SearchInputStories from "./searchInput.stories"
1
+ import { Canvas, Meta, Story } from "@storybook/blocks";
2
+ import * as SearchInputStories from "./searchInput.stories";
3
3
 
4
4
  <Meta of={SearchInputStories} />
5
5
 
6
6
  # Search Input
7
- <Canvas>
8
- <Story of={SearchInputStories.Default} />
9
- </Canvas>
7
+
8
+ <Canvas of={SearchInputStories.Default} />
10
9
 
11
10
  ## Design resources
11
+
12
12
  - [Component library (Figma)]https://www.figma.com/design/qKsxl3ogIlBp7dafgxXuCA/QLD-GOV-DDS?node-id=11017-307599&t=NGmPmPhkUQMN7qQw-0)./searchInput.stories
@@ -1,12 +1,11 @@
1
- import { Canvas, Meta, Story } from "@storybook/blocks"
2
- import * as SidenavStories from "./sidenav.stories"
1
+ import { Canvas, Meta, Story } from "@storybook/blocks";
2
+ import * as SidenavStories from "./sidenav.stories";
3
3
 
4
4
  <Meta of={SidenavStories} />
5
5
 
6
6
  # Side navigation
7
- <Canvas>
8
- <Story of={SidenavStories.Default} />
9
- </Canvas>
7
+
8
+ <Canvas of={SidenavStories.Default} />
10
9
 
11
10
  ## Design resources
12
11
 
@@ -23,9 +23,7 @@ Each skip link's `href` attribute must reference an `id` of an element on the pa
23
23
  <main id="content" tabindex="-1">Main content</main>
24
24
  ```
25
25
 
26
- <Canvas>
27
- <Story of={Stories.Default} />
28
- </Canvas>
26
+ <Canvas of={Stories.Default} />
29
27
 
30
28
  ## See also
31
29
 
@@ -1,12 +1,11 @@
1
- import { Canvas, Meta, Story } from "@storybook/blocks"
2
- import * as TableStories from "./table.stories"
1
+ import { Canvas, Meta, Story } from "@storybook/blocks";
2
+ import * as TableStories from "./table.stories";
3
3
 
4
4
  <Meta of={TableStories} />
5
5
 
6
6
  # Table
7
- <Canvas>
8
- <Story of={TableStories.Default} />
9
- </Canvas>
7
+
8
+ <Canvas of={TableStories.Default} />
10
9
 
11
10
  ## Design resources
12
11
 
@@ -1,12 +1,11 @@
1
- import { Canvas, Meta, Story } from "@storybook/blocks"
2
- import * as TabsStories from "./tabs.stories"
1
+ import { Canvas, Meta, Story } from "@storybook/blocks";
2
+ import * as TabsStories from "./tabs.stories";
3
3
 
4
4
  <Meta of={TabsStories} />
5
5
 
6
6
  # Tabs
7
- <Canvas>
8
- <Story of={TabsStories.Default} />
9
- </Canvas>
7
+
8
+ <Canvas of={TabsStories.SectionTabsDefaultDark} />
10
9
 
11
10
  ## Design resources
12
11
 
@@ -111,12 +111,17 @@
111
111
  }
112
112
  .tabs-area {
113
113
  --qld-gutter-x: 0;
114
+ padding-inline: 0;
114
115
  .nav-tabs {
115
116
  margin-block-end: -1px;
116
117
  }
117
118
  }
118
119
  .tab-content {
119
120
  padding: 1.25rem;
121
+
122
+ .tab-pane p:last-of-type {
123
+ margin-block-end: 0;
124
+ }
120
125
  }
121
126
  }
122
127
  &.section-tabs {
@@ -135,6 +140,7 @@
135
140
  @include media-breakpoint-down(sm) {
136
141
  padding-inline: 1rem;
137
142
  }
143
+ margin-inline: auto;
138
144
  border-block-end: 1px solid;
139
145
  .nav-tabs {
140
146
  max-width: fit-content;
@@ -154,10 +160,25 @@
154
160
  }
155
161
  }
156
162
  .tab-content {
163
+ padding-inline: 4rem;
164
+
165
+ @include media-breakpoint-down(xl) {
166
+ padding-inline: 3rem;
167
+ }
168
+ @include media-breakpoint-down(lg) {
169
+ padding-inline: 2rem;
170
+ }
171
+ @include media-breakpoint-down(sm) {
172
+ padding-inline: 1rem;
173
+ }
174
+ margin-inline: auto;
157
175
  background-color: var(--qld-body-bg);
158
176
  border: 0;
159
177
  border-block-start: 0;
160
178
  margin-block-start: -1px;
179
+ .tab-pane p:last-of-type {
180
+ margin-block-end: 0;
181
+ }
161
182
  > article {
162
183
  max-width: var(--max-width);
163
184
  margin-inline: auto;
@@ -396,7 +417,7 @@
396
417
  display: flex;
397
418
  gap: 0.5rem;
398
419
  white-space: nowrap;
399
- color: var(--qld-link-color);
420
+ color: var(--qld-nav-link-color);
400
421
  align-items: anchor-center;
401
422
  i {
402
423
  font-size: 1.125rem;
@@ -1,12 +1,11 @@
1
- import { Canvas, Meta, Story } from "@storybook/blocks"
2
- import * as TagStories from "./tag.stories"
1
+ import { Canvas, Meta, Story } from "@storybook/blocks";
2
+ import * as TagStories from "./tag.stories";
3
3
 
4
4
  <Meta of={TagStories} />
5
5
 
6
6
  # Tag
7
- <Canvas>
8
- <Story of={TagStories.Default} />
9
- </Canvas>
7
+
8
+ <Canvas of={TagStories.Default} />
10
9
 
11
10
  ## Design resources
12
11
 
@@ -1,12 +1,11 @@
1
- import { Canvas, Meta, Story } from "@storybook/blocks"
2
- import * as TypographyStories from "./typography.stories"
1
+ import { Canvas, Meta, Story } from "@storybook/blocks";
2
+ import * as TypographyStories from "./typography.stories";
3
3
 
4
4
  <Meta of={TypographyStories} />
5
5
 
6
6
  # Typography
7
- <Canvas>
8
- <Story of={TypographyStories.Default} />
9
- </Canvas>
7
+
8
+ <Canvas of={TypographyStories.Default} />
10
9
 
11
10
  ## Design resources
12
11
 
@@ -1,12 +1,11 @@
1
- import { Canvas, Meta, Story } from "@storybook/blocks"
2
- import * as VideoStories from "./video.stories"
1
+ import { Canvas, Meta, Story } from "@storybook/blocks";
2
+ import * as VideoStories from "./video.stories";
3
3
 
4
4
  <Meta of={VideoStories} />
5
5
 
6
6
  # Video
7
- <Canvas>
8
- <Story of={VideoStories.Default} />
9
- </Canvas>
7
+
8
+ <Canvas of={VideoStories.Default} />
10
9
 
11
10
  ## Design resources
12
11
 
@@ -0,0 +1 @@
1
+ @forward "in-list";
@@ -0,0 +1,5 @@
1
+ @use "sass:list";
2
+
3
+ @function in-list($value, $list) {
4
+ @return list.index($list, $value) != null;
5
+ }
package/src/css/main.scss CHANGED
@@ -37,6 +37,7 @@ $enable-dark-mode: true;
37
37
 
38
38
  // 2. QLD Design System variables (Bootstrap overrides)
39
39
  @import "./qld-variables";
40
+ @import "variables";
40
41
 
41
42
  // @import "./scss/qld-variables-dark"; //future state
42
43
 
@@ -88,6 +89,9 @@ $enable-dark-mode: true;
88
89
  // 7. Optionally include utilities API last to generate classes based on the Sass map in `_utilities.scss`
89
90
  @import "../../node_modules/bootstrap/scss/utilities/api";
90
91
 
92
+ // Themes
93
+ @import "qld-theme";
94
+
91
95
  //8. QLD Design System typography (bootstrap overrides and custom). Please maintain naming consistency.
92
96
  @import "./qld-type";
93
97
 
@@ -136,8 +140,5 @@ $enable-dark-mode: true;
136
140
  // Custom utility classes
137
141
  @import "utilities";
138
142
 
139
- // Themes
140
- @import "qld-theme";
141
-
142
143
  // Print
143
144
  @import "qld-print";
@@ -1,4 +1,7 @@
1
1
  @forward "focusable";
2
2
  @forward "generate-color-vars";
3
+ @forward "make-icon" with (
4
+ $prefix: "qld-"
5
+ );
3
6
  @forward "register-vars";
4
7
  @forward "unset-button-styles";
@@ -0,0 +1,87 @@
1
+ @use "sass:list";
2
+ @use "sass:map";
3
+ @use "../../components/bs5/icons/icons.list" as *;
4
+ @use "../../components/bs5/icons/icons-multicolours.list" as *;
5
+ @use "../../components/bs5/icons/icons.sizes" as *;
6
+ @use "../functions" as f;
7
+
8
+ $prefix: "qld-" !default;
9
+
10
+ ///
11
+ /// @param {String} $name [null] - The name of icon
12
+ /// @param {String} $size ["sm"] - The icon size, valid values are "xs" | "sm" | "md" | "lg" | "xl" | "xxl"
13
+ /// @param {String | null} $pseudo [null] - Whether the mixin applies styles as a pseudo-element. Valid string values are "before" | "after"
14
+ /// @param {false} $is-inline - Applies extra styles to assist with vertical alignent when used inline with text.
15
+ /// @param {Boolean} $include-base [true] - Apply all base styles. Set to false when reusing this mixin to create modifier classes where base styles are already applied (For instance qld-icon-{name})
16
+ @mixin make-icon(
17
+ $name: null,
18
+ $size: "sm",
19
+ $pseudo: null,
20
+ $is-inline: false,
21
+ $include-base: true
22
+ ) {
23
+ // validate $name
24
+ @if ($name and not f.in-list($name, $icon-names)) {
25
+ @error "Invalid parameter $name: " + $name;
26
+ }
27
+ // validate $include-base
28
+ @if (not $name and not $include-base and not $is-inline) {
29
+ @error "Must include either $name or $include-base or $is-inline";
30
+ }
31
+
32
+ //validate size
33
+ @if (not map.get($icon-sizes, $size)) {
34
+ @error "Invalid parameter $size. Use one of " + map.keys($icon-sizes);
35
+ }
36
+
37
+ // validate $pseudo
38
+ @if (not list.index(("before", "after", null), $pseudo)) {
39
+ @error 'Invalid $pseudo value, can only be "before", "after" or null';
40
+ }
41
+
42
+ @if $pseudo {
43
+ &::#{$pseudo} {
44
+ content: "";
45
+ // recursively call this mixin with $pseudo set to null
46
+ @include make-icon($name, $size, null, $is-inline, $include-base);
47
+ }
48
+ } @else {
49
+ @if $include-base {
50
+ --_icon-size: var(--icon-size, #{map.get($icon-sizes, $size)});
51
+ display: inline-block;
52
+ width: var(--_icon-size);
53
+ height: var(--_icon-size);
54
+ background-position: center center;
55
+ background-repeat: no-repeat;
56
+ mask-position: center center;
57
+ mask-repeat: no-repeat;
58
+ mask-size: contain;
59
+ background-size: contain;
60
+ vertical-align: middle;
61
+
62
+ // What's going on here?
63
+ // These styles unify svg and mask-image implementations
64
+ // Color is the property we can share across both, since we can apply currentColor to backgroundColor.
65
+ // Preferred API to set color on icons is via --qld-icon-color property.
66
+ // This is not set intentionally by default, so we can inherit --qld-action-icon-color from palette context.
67
+ // Final fallback to inherit in case these go wrong.
68
+ color: var(--#{$prefix}icon-color, var(--qld-action-icon-color, inherit));
69
+ background-color: currentColor;
70
+ }
71
+ @if $is-inline {
72
+ vertical-align: baseline;
73
+ position: relative;
74
+ top: calc(calc(var(--_icon-size) / 2) - 0.5cap);
75
+ }
76
+ @if $name {
77
+ @if f.in-list($name, $icons-multicolour) {
78
+ background-image: var(--qgds-icon-#{$name});
79
+ -webkit-background-image: var(--qgds-icon-#{$name});
80
+ background-color: transparent;
81
+ } @else {
82
+ mask-image: var(--qgds-icon-#{$name});
83
+ -webkit-mask-image: var(--qgds-icon-#{$name});
84
+ }
85
+ }
86
+ }
87
+ }
@@ -1,44 +1,86 @@
1
- // Dark mode.
2
- // Note that you can't read custom variables into media queries (as at Sep 2023).
3
- // Example: "background: var(--theme-background);"
1
+ // QLD Theme Palette Classes
2
+ // Provides complete theme styling including color, background-color, and CSS variables
4
3
 
5
- // However, you can set them, however:
6
- // example: --theme-background: #000;
7
-
8
- //You can also fall back to SASS variable to set at compile time.
9
-
10
- @include color-mode(dark) {
11
- :root {
12
- --#{$prefix}body-bg: var(--qld-brand-primary-dark);
13
- --#{$prefix}body-color: #FFF;
14
- --#{$prefix}heading-color: #FFF;
15
- --#{$prefix}link-color: #FFF;
16
- --#{$prefix}link-hover-color: var(--qld-brand-accent);
17
- }
4
+ // Theme properties mixins to avoid duplication
5
+ @mixin light-theme-properties {
6
+ background-color: var(--qld-body-bg);
7
+ color: var(--qld-body-color);
8
+ --qld-action-icon-color: var(--qld-light-action-secondary);
9
+ --qld-action-icon-hover-color: var(--qld-light-action-secondary-hover);
10
+ --qld-body-color: #{$body-color};
11
+ --qld-body-font-weight: #{$body-font-weight};
12
+ --qld-focus-color: var(--qld-light-focus);
13
+ --qld-headings-color: #{$headings-color};
14
+ --qld-link-color: #{$link-color};
15
+ --qld-link-color-rgb: #{to-rgb($link-color)};
16
+ --qld-link-font-weight: 400;
17
+ --qld-link-hover-color: var(--qld-link-color);
18
+ --qld-link-hover-color-rgb: var(--qld-link-color-rgb);
19
+ --qld-link-underline: #{$color-default-color-light-underline-default};
20
+ --qld-link-underline-hover: #{$color-default-color-light-underline-default-hover};
21
+ --qld-link-underline-offset: 0.3rem;
22
+ --qld-link-underline-thickness: 0.5px;
23
+ --qld-link-underline-thickness-hover: 2px;
24
+ --qld-link-underline-visited: #{$color-default-color-light-underline-visited};
25
+ --qld-link-underline-visited-hover: #{$color-default-color-light-underline-visited-hover};
26
+ --qld-selection-bg: var(--qld-brand-primary);
27
+ --qld-selection-color: var(--qld-white);
28
+ }
18
29
 
19
- //...etc
30
+ @mixin dark-theme-properties {
31
+ background-color: var(--qld-body-bg);
32
+ color: var(--qld-body-color);
33
+ --qld-action-icon-color: var(--qld-dark-action-secondary);
34
+ --qld-action-icon-hover-color: var(--qld-dark-action-secondary-hover);
35
+ --qld-body-color: #fff;
36
+ --qld-focus-color: var(--qld-dark-focus);
37
+ --qld-headings-color: #fff;
38
+ --qld-link-color: #fff;
39
+ --qld-link-color-rgb: 255, 255, 255;
40
+ --qld-link-hover-color: #fff;
41
+ --qld-link-hover-color-rgb: 255, 255, 255;
42
+ --qld-link-visited: var(--qld-link-visited-dark);
43
+ --qld-selection-bg: var(--qld-white);
44
+ --qld-selection-color: var(--qld-brand-primary);
20
45
  }
21
46
 
47
+ // Default theme (inherits :root variables) and root variables
48
+ :root,
49
+ .default {
50
+ @include light-theme-properties;
51
+ --qld-body-bg: var(--qld-default-background);
52
+ --qld-border-color: var(--qld-light-border);
53
+ }
22
54
 
55
+ // Light theme
23
56
  .light {
24
- background: var(--#{$prefix}light-background);
57
+ @include light-theme-properties;
58
+ --qld-border-color: var(--#{$prefix}color-default-color-light-border-light);
25
59
  }
26
60
 
61
+ // Alt theme (light alternative)
27
62
  .alt {
28
- background: var(--#{$prefix}light-alt-background);
63
+ @include light-theme-properties;
64
+ --qld-body-bg: var(--qld-light-alt-background);
65
+ --qld-border-color: var(--qld-soft-grey);
29
66
  }
30
67
 
31
- .bg-default { background-color: var(--qld-default-background); }
32
- .bg-default-shade { background-color: var(--qld-default-background-shade); }
33
-
34
- .bg-light { background-color: var(--qld-light-background); }
35
- .bg-light-shade { background-color: var(--qld-light-background-shade); }
36
-
37
- .bg-light-alt { background-color: var(--qld-light-alt-background); }
38
- .bg-light-alt-shade { background-color: var(--qld-light-alt-background-shade); }
68
+ // Dark theme
69
+ .dark {
70
+ @include dark-theme-properties;
71
+ --qld-body-bg: var(--qld-dark-background);
72
+ --qld-border-color: var(--qld-dark-border);
73
+ }
39
74
 
40
- .bg-dark { background-color: var(--qld-dark-background); }
41
- .bg-dark-shade { background-color: var(--qld-dark-background-shade); }
75
+ // Dark alt theme
76
+ .dark-alt {
77
+ @include dark-theme-properties;
78
+ --qld-body-bg: var(--qld-dark-alt-background);
79
+ --qld-border-color: var(--qld-dark-alt-border);
80
+ }
42
81
 
43
- .bg-dark-alt { background-color: var(--qld-dark-alt-background); }
44
- .bg-dark-alt-shade { background-color: var(--qld-dark-alt-background-shade); }
82
+ // Bootstrap dark mode support
83
+ :root[data-bs-theme="dark"] {
84
+ @include dark-theme-properties;
85
+ --qld-body-bg: var(--qld-brand-primary);
86
+ }