@qld-gov-au/qgds-bootstrap5 2.0.12 → 2.1.1
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/.esbuild/plugins/qgds-plugin-generate-icon-assets.js +31 -24
- package/.storybook/preview.js +15 -6
- package/dist/assets/components/bs5/button/button.hbs +1 -1
- package/dist/assets/components/bs5/callToAction/callToAction.hbs +3 -3
- package/dist/assets/components/bs5/dateinput/dateinput.hbs +21 -27
- package/dist/assets/components/bs5/footer/customLinks.hbs +1 -1
- package/dist/assets/components/bs5/footer/followLinks.hbs +1 -1
- package/dist/assets/components/bs5/globalAlert/globalAlert.hbs +8 -1
- package/dist/assets/components/bs5/head/head.hbs +1 -1
- package/dist/assets/components/bs5/inpageAlert/inpageAlert.hbs +10 -2
- package/dist/assets/components/bs5/pagination/pagination.hbs +7 -2
- package/dist/assets/components/bs5/promotionalPanel/promotionalPanel.hbs +1 -1
- package/dist/assets/components/bs5/searchInput/searchInput.hbs +11 -9
- package/dist/assets/css/qld.bootstrap.css +2 -2
- package/dist/assets/css/qld.bootstrap.css.map +3 -3
- package/dist/assets/css/qld.bootstrap.legacy.css +2 -2
- package/dist/assets/css/qld.bootstrap.legacy.css.map +3 -3
- package/dist/assets/img/icons-sprite.svg +24 -24
- package/dist/assets/js/handlebars.helpers.bundle.js +1 -1
- package/dist/assets/js/handlebars.init.min.js +80 -64
- package/dist/assets/js/handlebars.init.min.js.map +2 -2
- package/dist/assets/js/handlebars.partials.js +80 -64
- package/dist/assets/js/handlebars.partials.js.map +2 -2
- package/dist/assets/js/qld.bootstrap.min.js +6 -6
- package/dist/assets/js/qld.bootstrap.min.js.map +4 -4
- package/dist/assets/node/handlebars.init.min.js +28 -19
- package/dist/assets/node/handlebars.init.min.js.map +2 -2
- package/dist/components/bs5/button/button.hbs +1 -1
- package/dist/components/bs5/callToAction/callToAction.hbs +3 -3
- package/dist/components/bs5/dateinput/dateinput.hbs +21 -27
- package/dist/components/bs5/footer/customLinks.hbs +1 -1
- package/dist/components/bs5/footer/followLinks.hbs +1 -1
- package/dist/components/bs5/globalAlert/globalAlert.hbs +8 -1
- package/dist/components/bs5/head/head.hbs +1 -1
- package/dist/components/bs5/inpageAlert/inpageAlert.hbs +10 -2
- package/dist/components/bs5/pagination/pagination.hbs +7 -2
- package/dist/components/bs5/promotionalPanel/promotionalPanel.hbs +1 -1
- package/dist/components/bs5/searchInput/searchInput.hbs +11 -9
- package/dist/package.json +33 -32
- package/dist/sample-data/callToAction/callToAction.data.json +2 -1
- package/dist/sample-data/dateinput/dateinput.data.json +3 -1
- package/dist/sample-data/footer/footer.data.json +3 -0
- package/dist/sample-data/inpageAlert/inpageAlert.data.json +1 -1
- package/dist/sample-data/pagination/pagination.data.json +4 -4
- package/dist/sample-data/promotionalPanel/promotionalPanel.data.json +45 -47
- package/dist/sample-data/searchInput/searchInput.data.json +1 -0
- package/package.json +33 -32
- package/src/components/bs5/breadcrumbs/breadcrumbs.scss +4 -4
- package/src/components/bs5/button/Button.js +32 -6
- package/src/components/bs5/button/button.hbs +1 -1
- package/src/components/bs5/button/button.scss +1 -5
- package/src/components/bs5/button/button.stories.js +16 -4
- package/src/components/bs5/callToAction/callToAction.data.json +2 -1
- package/src/components/bs5/callToAction/callToAction.hbs +3 -3
- package/src/components/bs5/callToAction/callToAction.stories.js +2 -2
- package/src/components/bs5/card/card.scss +4 -2
- package/src/components/bs5/dateinput/Dateinput.js +1 -38
- package/src/components/bs5/dateinput/Dateinput.mdx +27 -0
- package/src/components/bs5/dateinput/Dateinput.stories.js +48 -4
- package/src/components/bs5/dateinput/dateinput.data.json +3 -1
- package/src/components/bs5/dateinput/dateinput.functions.js +91 -0
- package/src/components/bs5/dateinput/dateinput.hbs +21 -27
- package/src/components/bs5/footer/customLinks.hbs +1 -1
- package/src/components/bs5/footer/followLinks.hbs +1 -1
- package/src/components/bs5/footer/footer.data.json +3 -0
- package/src/components/bs5/formcheck/_form-variables.scss +36 -0
- package/src/components/bs5/formcheck/formcheck.scss +59 -14
- package/src/components/bs5/globalAlert/globalAlert.hbs +8 -1
- package/src/components/bs5/globalAlert/globalAlert.scss +14 -19
- package/src/components/bs5/globalAlert/globalAlert.stories.js +1 -0
- package/src/components/bs5/globalAlert/globalAlert.test.js +10 -5
- package/src/components/bs5/header/header.scss +1 -2
- package/src/components/bs5/icons/_icons.list.js +7 -7
- package/src/components/bs5/icons/_icons.list.scss +113 -112
- package/src/components/bs5/icons/_icons.variables.scss +7 -6
- package/src/components/bs5/icons/icons.scss +2 -1
- package/src/components/bs5/inpageAlert/inpageAlert.data.json +1 -1
- package/src/components/bs5/inpageAlert/inpageAlert.hbs +10 -2
- package/src/components/bs5/inpageAlert/inpageAlert.scss +52 -55
- package/src/components/bs5/inpageAlert/inpageAlert.stories.js +54 -3
- package/src/components/bs5/inpagenav/inpagenav.scss +9 -1
- package/src/components/bs5/modal/modal.scss +1 -1
- package/src/components/bs5/navbar/navbar.functions.js +39 -28
- package/src/components/bs5/navbar/navbar.scss +43 -28
- package/src/components/bs5/navbar/navbar.stories.js +4 -3
- package/src/components/bs5/pageLayout/PaletteShowcase.stories.js +4 -3
- package/src/components/bs5/pagination/pagination.data.json +4 -4
- package/src/components/bs5/pagination/pagination.hbs +7 -2
- package/src/components/bs5/pagination/pagination.scss +1 -1
- package/src/components/bs5/promotionalPanel/promotionalPanel.data.json +45 -47
- package/src/components/bs5/promotionalPanel/promotionalPanel.hbs +1 -1
- package/src/components/bs5/quickexit/quickexit.scss +1 -1
- package/src/components/bs5/searchInput/__snapshots__/searchInput.test.js.snap +16 -16
- package/src/components/bs5/searchInput/search.functions.js +70 -71
- package/src/components/bs5/searchInput/searchInput.data.json +1 -0
- package/src/components/bs5/searchInput/searchInput.hbs +11 -9
- package/src/components/bs5/searchInput/searchInput.scss +92 -38
- package/src/components/bs5/searchInput/searchInput.test.js +91 -119
- package/src/components/bs5/sidenav/sidenav.scss +17 -19
- package/src/components/bs5/skiplinks/skipLinks.scss +12 -4
- package/src/components/bs5/table/table.scss +93 -83
- package/src/components/common/focus-styles/focusStyles.mdx +20 -0
- package/src/components/common/focus-styles/focusStyles.stories.js +58 -0
- package/src/css/functions/_index.scss +3 -0
- package/src/css/functions/color-icon.scss +31 -0
- package/src/css/functions/string-replace.scss +49 -0
- package/src/css/functions/svg-encode.scss +22 -0
- package/src/css/main.scss +3 -0
- package/src/css/mixins/focusable.scss +1 -1
- package/src/css/mixins/make-icon.scss +1 -1
- package/src/css/mixins/make-link.scss +13 -10
- package/src/css/qld-palettes.scss +20 -12
- package/src/css/qld-reduced-motion.scss +51 -0
- package/src/css/qld-tokens.scss +3 -3
- package/src/css/qld-type.scss +11 -13
- package/src/css/qld-utilities.scss +9 -1
- package/src/css/qld-variables.scss +1 -1
- package/src/img/icons-sprite.svg +24 -24
- package/src/js/constants.js +10 -0
- package/src/js/qld.bootstrap.js +99 -151
- package/src/js/utils.js +3 -1
|
@@ -1,93 +1,103 @@
|
|
|
1
1
|
.qld-table {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
border: 1px solid var(--qld-neutral-lighter);
|
|
3
|
+
border-radius: 0.75rem;
|
|
4
|
+
margin-bottom: 1rem;
|
|
5
|
+
|
|
6
|
+
// DS includes a version of the table without borders ("quiet table").
|
|
7
|
+
// This is achieved by setting the border on a wrapping .qld-table--borderless class
|
|
8
|
+
&--borderless {
|
|
9
|
+
border: 1px solid transparent;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.table {
|
|
13
|
+
--qld-table-border-color: var(--qld-neutral-lighter);
|
|
14
|
+
--qld-table-header-color: var(--qld-light-text-heading);
|
|
15
|
+
--qld-table-cell-color: var(--qld-light-text-text);
|
|
16
|
+
--qld-table-striped-bg: var(--qld-neutral-lightest);
|
|
17
|
+
|
|
18
|
+
margin-bottom: 0;
|
|
4
19
|
border-radius: 0.75rem;
|
|
5
|
-
margin-bottom: 1rem;
|
|
6
20
|
|
|
7
|
-
//
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
21
|
+
//required to maintain effective border-radius on the table
|
|
22
|
+
overflow: hidden;
|
|
23
|
+
|
|
24
|
+
// Override Bootstrap's default odd-row striping to use even rows
|
|
25
|
+
&.table-striped {
|
|
26
|
+
> tbody > tr:nth-of-type(odd) > * {
|
|
27
|
+
--qld-table-accent-bg: transparent;
|
|
28
|
+
--qld-table-bg-type: transparent;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
> tbody > tr:nth-of-type(even) > * {
|
|
32
|
+
--qld-table-accent-bg: var(--qld-table-striped-bg);
|
|
33
|
+
--qld-table-bg-type: var(--qld-table-striped-bg);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
caption {
|
|
38
|
+
caption-side: top;
|
|
39
|
+
color: var(--qld-headings-color);
|
|
40
|
+
padding: 0.75rem;
|
|
41
|
+
line-height: 2rem;
|
|
42
|
+
font-weight: 600;
|
|
43
|
+
font-size: 1.25rem;
|
|
44
|
+
border-bottom: 1px solid var(--qld-table-border-color);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.sub-caption {
|
|
48
|
+
color: var(--qld-light-text-lighter);
|
|
49
|
+
font-size: 0.875rem;
|
|
50
|
+
font-weight: 400;
|
|
51
|
+
line-height: 1.25rem;
|
|
52
|
+
display: table-row;
|
|
11
53
|
}
|
|
12
54
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
//required to maintain effective border-radius on the table
|
|
23
|
-
overflow: hidden;
|
|
24
|
-
|
|
25
|
-
caption {
|
|
26
|
-
caption-side: top;
|
|
27
|
-
color: var(--qld-headings-color);
|
|
28
|
-
padding: 0.75rem;
|
|
29
|
-
line-height: 2rem;
|
|
30
|
-
font-weight: 600;
|
|
31
|
-
font-size: 1.25rem;
|
|
32
|
-
border-bottom: 1px solid var(--qld-table-border-color);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.sub-caption {
|
|
36
|
-
color: var(--qld-dark-grey-muted);
|
|
37
|
-
font-size: 0.875rem;
|
|
38
|
-
font-weight: 400;
|
|
39
|
-
line-height: 1.25rem;
|
|
40
|
-
display: table-row;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
thead th,
|
|
44
|
-
thead td {
|
|
45
|
-
border-bottom: 2px solid var(--qld-brand-secondary);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
th {
|
|
49
|
-
color: var(--qld-table-header-color);
|
|
50
|
-
padding: 1.25rem 0.75rem;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
td {
|
|
54
|
-
color: var(--qld-table-cell-color);
|
|
55
|
-
padding: 0.75rem;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
tbody tr {
|
|
59
|
-
border-bottom: 1px solid var(--qld-table-border-color);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
tfoot th,
|
|
63
|
-
tfoot td {
|
|
64
|
-
border-top: 2px solid $qld-brand-secondary;
|
|
65
|
-
border-bottom: 0;
|
|
66
|
-
font-weight: 600;
|
|
67
|
-
padding: 0.75rem;
|
|
68
|
-
}
|
|
55
|
+
thead th,
|
|
56
|
+
thead td {
|
|
57
|
+
border-bottom: 2px solid var(--qld-light-accent);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
th {
|
|
61
|
+
color: var(--qld-table-header-color);
|
|
62
|
+
padding: 1.25rem 0.75rem;
|
|
63
|
+
}
|
|
69
64
|
|
|
65
|
+
td {
|
|
66
|
+
color: var(--qld-table-cell-color);
|
|
67
|
+
padding: 0.75rem;
|
|
70
68
|
}
|
|
71
69
|
|
|
70
|
+
tbody tr {
|
|
71
|
+
border-bottom: 1px solid var(--qld-table-border-color);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
tfoot th,
|
|
75
|
+
tfoot td {
|
|
76
|
+
border-top: 2px solid var(--qld-light-accent);
|
|
77
|
+
border-bottom: 0;
|
|
78
|
+
font-weight: 600;
|
|
79
|
+
padding: 0.75rem;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
//Build a bootstrap ".table-dark" class dynamically, passing in a background colour
|
|
84
|
+
@include table-variant("dark", $color-default-color-dark-background-default);
|
|
85
|
+
|
|
86
|
+
//Then, we extend .table-dark with some additional rules
|
|
87
|
+
.table-dark {
|
|
88
|
+
--qld-table-border-color: var(--qld-dark-border);
|
|
89
|
+
--qld-table-header-color: var(--qld-dark-text-heading);
|
|
90
|
+
--qld-table-cell-color: var(--qld-dark-text-text);
|
|
91
|
+
--qld-table-striped-bg: var(--qld-dark-background-shade);
|
|
92
|
+
|
|
93
|
+
caption,
|
|
94
|
+
.sub-caption {
|
|
95
|
+
background-color: var(--qld-dark-background);
|
|
96
|
+
color: var(--qld-dark-text-text);
|
|
97
|
+
}
|
|
72
98
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
//Then, we extend .table-dark with some additional rules
|
|
77
|
-
.table-dark {
|
|
78
|
-
--qld-table-border-color: var(--qld-dark-border);
|
|
79
|
-
--qld-table-header-color: var(--qld-white);
|
|
80
|
-
--qld-table-cell-color: var(--qld-white);
|
|
81
|
-
--qld-table-striped-bg: var(--qld-extra-light-grey);
|
|
82
|
-
|
|
83
|
-
caption,
|
|
84
|
-
.sub-caption {
|
|
85
|
-
background-color: #09549F;
|
|
86
|
-
color: #FFF;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
thead th {
|
|
90
|
-
background-color: #04498F;
|
|
91
|
-
}
|
|
99
|
+
thead th {
|
|
100
|
+
background-color: var(--qld-dark-background-shade);
|
|
92
101
|
}
|
|
93
|
-
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Meta, Canvas, Controls } from "@storybook/addon-docs/blocks";
|
|
2
|
+
import * as Stories from "./focusStyles.stories";
|
|
3
|
+
|
|
4
|
+
<Meta of={Stories} />
|
|
5
|
+
|
|
6
|
+
# Focus Styles
|
|
7
|
+
|
|
8
|
+
Use the mixin `focusable()` to keep focus styles consistent across all elements including links, buttons, and single-action cards.
|
|
9
|
+
|
|
10
|
+
## Focus ring color and palette context
|
|
11
|
+
|
|
12
|
+
Focus ring color is palette context-aware via CSS custom property `--qld-focus-color`. This means it changes color based on the classes `default`, `alt`, `light`, `dark`, and `dark-alt`.
|
|
13
|
+
Because a focus ring is offset beyond an element's boundaries, when a themable component such as a Card is also focusable, it must retain the palette color of its parent.
|
|
14
|
+
For this reason `--qld-focus-color` is set on children of elements with palette classes, not the element itself. Change the values of `paletteClass` and `cardPaletteClass` to see this in effect.
|
|
15
|
+
|
|
16
|
+
To otherwise force a focus-ring's palette context, you may also use utility classes `qld-focus-light` and `qld-focus-dark`. This should only be done as a final resort however.
|
|
17
|
+
|
|
18
|
+
<Canvas of={Stories.Default} />
|
|
19
|
+
|
|
20
|
+
<Controls />
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Button, defaultArgs as buttonArgs } from "../../bs5/button/Button";
|
|
2
|
+
import { Card } from "../../bs5/card/Card";
|
|
3
|
+
import cardData from "../../bs5/card/card.data.json";
|
|
4
|
+
const cardArgs = cardData.singleAction;
|
|
5
|
+
/**
|
|
6
|
+
* @import { Meta, StoryObj } from "@storybook/html";
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* @typedef {Object} Args
|
|
11
|
+
* @prop {"focus-light" | "focus-dark" | ""} [utilityClass] - Manually force a light or dark palette context on the focus color. This can be used as escape hatch for when the focus color must be inverted for accessibility reasons.
|
|
12
|
+
* @prop {"default" | "light" | "alt" | "dark" | "dark-alt" | ""} [paletteClass]
|
|
13
|
+
* @prop {"default" | "light" | "alt" | "dark" | "dark-alt" | ""} [cardPaletteClass]
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @type { Meta<Args> }
|
|
18
|
+
*/
|
|
19
|
+
export default {
|
|
20
|
+
title: "1. Core Styles/Focus Styles",
|
|
21
|
+
tags: ["autodocs"],
|
|
22
|
+
argTypes: {
|
|
23
|
+
utilityClass: {
|
|
24
|
+
description:
|
|
25
|
+
"Manually force a light or dark palette context on the focus color. This can be used as escape hatch for when the focus color must be inverted for accessibility reasons.",
|
|
26
|
+
control: "radio",
|
|
27
|
+
options: ["qld-focus-light", "qld-focus-dark", null],
|
|
28
|
+
},
|
|
29
|
+
paletteClass: {
|
|
30
|
+
control: "select",
|
|
31
|
+
options: ["default", "light", "alt", "dark", "dark-alt", null],
|
|
32
|
+
},
|
|
33
|
+
cardPaletteClass: {
|
|
34
|
+
control: "select",
|
|
35
|
+
options: ["default", "light", "alt", "dark", "dark-alt"],
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
parameters: { layout: "fullscreen" },
|
|
39
|
+
|
|
40
|
+
render: (args) => {
|
|
41
|
+
return `<div class="p-24 ${args.paletteClass || ""}" style="display: flex; gap: 48px; align-items: flex-start">
|
|
42
|
+
<a href=javascript:void()" class="${args.utilityClass || ""}">Here is a link</a>
|
|
43
|
+
${new Button({ ...buttonArgs, variantClass: `${buttonArgs.variantClass} ${args.utilityClass || ""}` }).html}
|
|
44
|
+
${new Card({ ...cardArgs, variantClass: `${args.cardPaletteClass} ${args.utilityClass || ""}` }).html}
|
|
45
|
+
</div>
|
|
46
|
+
`;
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
/** @type {StoryObj<Args>} */
|
|
51
|
+
export const Default = {
|
|
52
|
+
/**@type Args */
|
|
53
|
+
args: {
|
|
54
|
+
utilityClass: "",
|
|
55
|
+
paletteClass: "",
|
|
56
|
+
cardPaletteClass: "default",
|
|
57
|
+
},
|
|
58
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
@use "../../components/bs5/icons/icons.list" as icons;
|
|
2
|
+
@use "../functions/string-replace" as *;
|
|
3
|
+
@use "../functions/in-list" as *;
|
|
4
|
+
@use "../functions/svg-encode" as *;
|
|
5
|
+
@use "bootstrap/scss/functions" as bs;
|
|
6
|
+
@use "sass:map";
|
|
7
|
+
@use "sass:meta";
|
|
8
|
+
@use "sass:string";
|
|
9
|
+
|
|
10
|
+
///
|
|
11
|
+
/// This function can create an svg string with a customised fill color by replacing all instances of the string "currentColor" with the chosen color.
|
|
12
|
+
/// This is useful when creating svg data urls for use in background property, where currentColor does not work.
|
|
13
|
+
/// Use it together with svg-encode for fun and profit.
|
|
14
|
+
/// @param {string} $name - The name of the QGDS icon
|
|
15
|
+
/// @param {color} $color -The desired new color. Must be of type color (eg hex or rgb notation) not a CSS custom property.
|
|
16
|
+
/// @return {string} - the new svg string with "currentColor" replaced with chosen color
|
|
17
|
+
@function color-icon($name, $color) {
|
|
18
|
+
$_validNames: map.keys(icons.$icon-names);
|
|
19
|
+
// validate $name
|
|
20
|
+
@if ($name and not in-list($name, $_validNames)) {
|
|
21
|
+
@error "Invalid parameter $name: " + $name;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// validate color is valid.
|
|
25
|
+
@if (meta.type-of($color) != "color") {
|
|
26
|
+
@error "Invalid parameter $color: " + $name;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
$svg: map.get(icons.$icon-names, $name);
|
|
30
|
+
@return string-replace($svg, "currentColor", "#{$color}");
|
|
31
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
@use "sass:string";
|
|
2
|
+
@use "sass:meta";
|
|
3
|
+
|
|
4
|
+
///
|
|
5
|
+
/// Adapted from Kitty Giraudel https://kittygiraudel.com/2014/01/13/string-replacement-function-in-sass/
|
|
6
|
+
/// @param {type} $string - The string to be searched, with substring $replace replaced with $replaceWith
|
|
7
|
+
/// @param {type} $replace - The substring to be replaced by $replaceWith
|
|
8
|
+
/// @param {type} $replaceWith - The string to replace $replace
|
|
9
|
+
/// @return {string} - A new string with $replace replaced by $replaceWith
|
|
10
|
+
@function string-replace($string, $replace, $replaceWith) {
|
|
11
|
+
// validate strings
|
|
12
|
+
@if meta.type-of($string) !=
|
|
13
|
+
string or
|
|
14
|
+
meta.type-of($replace) !=
|
|
15
|
+
string or
|
|
16
|
+
meta.type-of($replaceWith) !=
|
|
17
|
+
string
|
|
18
|
+
{
|
|
19
|
+
@warn "One of the 3 arguments is not a string.";
|
|
20
|
+
@return $string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// avoid infinite recursion
|
|
24
|
+
@if string.index($replaceWith, $replace) {
|
|
25
|
+
@warn "The string to be replaced is contained in the new string. Infinite recursion avoided.";
|
|
26
|
+
@return $string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// Find the index of the string to replace
|
|
30
|
+
$index: string.index($string, $replace);
|
|
31
|
+
|
|
32
|
+
// If $replace string is found
|
|
33
|
+
@if ($index) and ($replaceWith != $replace) {
|
|
34
|
+
// Create a new string. Then we loop through each character in the string, and append them to the new string only if they are not part of the $replace string.
|
|
35
|
+
$newString: string.quote(string.slice($string, 1, $index - 1));
|
|
36
|
+
|
|
37
|
+
@for $i from $index through string.length($string) {
|
|
38
|
+
@if $i < $index or $i >= $index + string.length($replace) {
|
|
39
|
+
$newString: $newString + string.slice($string, $i, $i);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
$newString: string.insert($newString, $replaceWith, $index);
|
|
44
|
+
@return string-replace($newString, $replace, $replaceWith);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// else nothing to do - return original $string
|
|
48
|
+
@return $string;
|
|
49
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
@use "../functions/string-replace" as *;
|
|
2
|
+
|
|
3
|
+
///
|
|
4
|
+
/// A simpler version of bootstrap's escape-svg, which cannot be used with sass module system.
|
|
5
|
+
/// Unlike bootstraps' version, this function cannot be used to wrap `url()` function.
|
|
6
|
+
/// It only works on strings!
|
|
7
|
+
/// Based on the same original source at https://codepen.io/kevinweber/pen/dXWoRw
|
|
8
|
+
/// @param {type} $svg -
|
|
9
|
+
/// @return {string} - the encoded svg prefixed with "data:image/svg+xml,", ready to be used within `url()` for background images.
|
|
10
|
+
@function svg-encode($svg) {
|
|
11
|
+
$encoding-reference: (
|
|
12
|
+
("<", "%3c"),
|
|
13
|
+
(">", "%3e"),
|
|
14
|
+
("#", "%23"),
|
|
15
|
+
("(", "%28"),
|
|
16
|
+
(")", "%29")
|
|
17
|
+
);
|
|
18
|
+
@each $char, $encoded in $encoding-reference {
|
|
19
|
+
$svg: string-replace($svg, $char, $encoded);
|
|
20
|
+
}
|
|
21
|
+
@return "data:image/svg+xml," + $svg;
|
|
22
|
+
}
|
package/src/css/main.scss
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
///
|
|
2
2
|
/// Default focus styles for use in buttons etc. Resets :focus and uses :focus-visible instead which only appears on keyboard interaction.
|
|
3
|
-
/// @param {Boolean} $offsetOutline [true] - Offset the focus ring by 2px.
|
|
3
|
+
/// @param {Boolean|number} $offsetOutline [true] - Offset the focus ring by 2px.
|
|
4
4
|
/// @param {Boolean} $isFocusWithin [false] - Optionally apply styles via :focus-within rather than :focus-visible
|
|
5
5
|
/// @param {String} $outlineWidth: [3px] The width of the outline.
|
|
6
6
|
/// @param {String} $customSelector [null] - If passed, will override $isFocusWithin and apply focus styles instead to a custom selector string. @see SearchInput
|
|
@@ -22,7 +22,7 @@ $prefix: "qld-" !default;
|
|
|
22
22
|
$include-base: true
|
|
23
23
|
) {
|
|
24
24
|
// validate $name
|
|
25
|
-
@if ($name and not f.in-list($name, $icon-names)) {
|
|
25
|
+
@if ($name and not f.in-list($name, map.keys($icon-names))) {
|
|
26
26
|
@error "Invalid parameter $name: " + $name;
|
|
27
27
|
}
|
|
28
28
|
// validate $include-base
|
|
@@ -1,24 +1,27 @@
|
|
|
1
1
|
@use "focusable" as *;
|
|
2
|
-
@use "../
|
|
2
|
+
@use "../functions" as f;
|
|
3
|
+
// @use "../variables/animation";
|
|
3
4
|
|
|
4
5
|
///
|
|
5
6
|
/// Apply generic links styles. Ensures consistent styles including transition effects.
|
|
6
7
|
@mixin make-link() {
|
|
7
8
|
color: var(--qld-link-color);
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
border-radius: 0.25rem;
|
|
10
|
+
transition: none; // remove transitions until decisions at design system level.
|
|
11
|
+
// {
|
|
12
|
+
// property:
|
|
13
|
+
// color, background-color, border-color, outline-color, outline-offset,
|
|
14
|
+
// outline-width, text-decoration-color, text-decoration-line,
|
|
15
|
+
// text-decoration-thickness, text-underline-offset, opacity;
|
|
16
|
+
// duration: animation.$duration-fast;
|
|
17
|
+
// timing-function: animation.$timing-function;
|
|
18
|
+
// }
|
|
16
19
|
|
|
17
20
|
text-underline-offset: var(--qld-link-underline-offset);
|
|
18
21
|
text-decoration-thickness: var(--qld-link-underline-thickness);
|
|
19
22
|
text-decoration-color: var(--qld-link-underline);
|
|
20
23
|
|
|
21
|
-
@include focusable(
|
|
24
|
+
@include focusable();
|
|
22
25
|
|
|
23
26
|
&:hover {
|
|
24
27
|
text-decoration-thickness: var(--qld-link-underline-thickness-hover);
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
// QLD
|
|
1
|
+
// QLD Palette Classes
|
|
2
2
|
// Provides complete theme styling including color, background-color, and CSS variables
|
|
3
3
|
|
|
4
|
-
// Theme properties mixins to avoid duplication
|
|
5
4
|
%qld-palette-default {
|
|
6
5
|
background-color: var(--qld-body-bg);
|
|
7
6
|
color: var(--qld-body-color);
|
|
@@ -11,7 +10,6 @@
|
|
|
11
10
|
--qld-body-color: #{$body-color};
|
|
12
11
|
--qld-body-font-weight: #{$body-font-weight};
|
|
13
12
|
--qld-border-color: var(--qld-light-border);
|
|
14
|
-
--qld-focus-color: var(--qld-light-focus);
|
|
15
13
|
--qld-headings-color: #{$headings-color};
|
|
16
14
|
--qld-link-color: #{$link-color};
|
|
17
15
|
--qld-link-color-rgb: #{to-rgb($link-color)};
|
|
@@ -22,11 +20,20 @@
|
|
|
22
20
|
--qld-link-underline-hover: #{$color-default-color-light-underline-default-hover};
|
|
23
21
|
--qld-link-underline-visited: #{$color-default-color-light-underline-visited};
|
|
24
22
|
--qld-link-underline-visited-hover: #{$color-default-color-light-underline-visited-hover};
|
|
25
|
-
--qld-link-underline-offset: 0.
|
|
23
|
+
--qld-link-underline-offset: 0.3em;
|
|
26
24
|
--qld-link-underline-thickness: 0.5px;
|
|
27
25
|
--qld-link-underline-thickness-hover: 2px;
|
|
28
|
-
--qld-selection-bg: var(--qld-
|
|
29
|
-
--qld-selection-color: var(--qld-white);
|
|
26
|
+
--qld-selection-bg: var(--qld-dark-background);
|
|
27
|
+
--qld-selection-color: var(--qld-neutral-white);
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
// Because a focus ring generally is offset outside of an element, at the boundary between palette themes,
|
|
31
|
+
// its color should inherit the parent's palette, not the focussed element's palette, so defer setting
|
|
32
|
+
// focus color until first descendant, unless this is :root
|
|
33
|
+
&:root,
|
|
34
|
+
> :where(*) {
|
|
35
|
+
--qld-focus-color: var(--qld-light-focus);
|
|
36
|
+
}
|
|
30
37
|
}
|
|
31
38
|
|
|
32
39
|
%qld-palette-light {
|
|
@@ -49,22 +56,23 @@
|
|
|
49
56
|
--qld-body-bg: var(--qld-dark-background);
|
|
50
57
|
--qld-body-color: #fff;
|
|
51
58
|
--qld-border-color: var(--qld-dark-border);
|
|
52
|
-
--qld-focus-color: var(--qld-dark-focus);
|
|
53
59
|
--qld-headings-color: #{$color-default-color-dark-text-heading};
|
|
54
60
|
--qld-link-color: #{$color-default-color-dark-link-default};
|
|
55
61
|
--qld-link-color-rgb: 255, 255, 255;
|
|
56
62
|
--qld-link-hover-color: #{$color-default-color-dark-link-default};
|
|
57
63
|
--qld-link-hover-color-rgb: 255, 255, 255;
|
|
58
64
|
--qld-link-visited-color: #{$color-default-color-dark-link-visited};
|
|
59
|
-
--qld-link-visited: var(
|
|
60
|
-
--qld-link-visited-dark
|
|
61
|
-
); // TODO tidy up these variables, we should only use --qld-link-visited-color
|
|
62
65
|
--qld-link-underline: #{$qld-link-underline-dark};
|
|
63
66
|
--qld-link-underline-hover: #{$qld-link-underline-hover-dark};
|
|
64
67
|
--qld-link-underline-visited: #{$qld-link-underline-visited-dark};
|
|
65
68
|
--qld-link-underline-visited-hover: #{$qld-link-underline-hover-dark};
|
|
66
|
-
--qld-selection-bg: var(--qld-white);
|
|
67
|
-
--qld-selection-color: var(--qld-
|
|
69
|
+
--qld-selection-bg: var(--qld-neutral-white);
|
|
70
|
+
--qld-selection-color: var(--qld-dark-background);
|
|
71
|
+
|
|
72
|
+
&:root,
|
|
73
|
+
> :where(*) {
|
|
74
|
+
--qld-focus-color: var(--qld-dark-focus);
|
|
75
|
+
}
|
|
68
76
|
}
|
|
69
77
|
|
|
70
78
|
%qld-palette-dark-alt {
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
@media (prefers-reduced-motion: reduce) {
|
|
2
|
+
.show,
|
|
3
|
+
.show:after,
|
|
4
|
+
.show:before,
|
|
5
|
+
a::after,
|
|
6
|
+
a::before,
|
|
7
|
+
a.dropdown-item,
|
|
8
|
+
.collapsed,
|
|
9
|
+
.accordion-toggle-btn--closed::after,
|
|
10
|
+
.accordion-toggle-btn--open::after,
|
|
11
|
+
.video-thumbnail .video-thumbnail-image:before,
|
|
12
|
+
* {
|
|
13
|
+
transition-duration: 0.001ms !important;
|
|
14
|
+
animation-duration: 0.001ms !important;
|
|
15
|
+
transition: none !important;
|
|
16
|
+
animation: none !important;
|
|
17
|
+
}
|
|
18
|
+
a.dropdown-item,
|
|
19
|
+
a.dropdown-item:hover {
|
|
20
|
+
gap: 1rem !important;
|
|
21
|
+
}
|
|
22
|
+
a.dropdown-item,
|
|
23
|
+
a.dropdown-item:hover,
|
|
24
|
+
a.dropdown-item:hover::after {
|
|
25
|
+
padding-inline-end: 0.5rem !important;
|
|
26
|
+
transform: none !important;
|
|
27
|
+
top: unset;
|
|
28
|
+
}
|
|
29
|
+
.qld-cta-link:hover {
|
|
30
|
+
gap: 0.5rem !important;
|
|
31
|
+
}
|
|
32
|
+
.link-column .nav-item .nav-link::after,
|
|
33
|
+
.link-column .nav-item .nav-link:hover::after {
|
|
34
|
+
margin-inline-end: 0.5rem;
|
|
35
|
+
}
|
|
36
|
+
.link-column .all-link .qld-cta-link:hover {
|
|
37
|
+
padding-inline-end: 0.5rem;
|
|
38
|
+
}
|
|
39
|
+
.qld-tabs .nav-tabs {
|
|
40
|
+
scroll-behavior: unset !important;
|
|
41
|
+
}
|
|
42
|
+
.card.card-arrow:hover .qld-icon {
|
|
43
|
+
transform: translateX(0rem);
|
|
44
|
+
}
|
|
45
|
+
@media (max-width: 991.98px) {
|
|
46
|
+
.navbar.show > .container,
|
|
47
|
+
.navbar.vertical.show > .container {
|
|
48
|
+
transform: translateX(0);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
package/src/css/qld-tokens.scss
CHANGED
|
@@ -16,15 +16,15 @@ $color-default-color-dark-crest-fill: #ffffff !default;
|
|
|
16
16
|
$color-default-color-dark-focus-default: #c6ffff !default;
|
|
17
17
|
$color-default-color-dark-link-default: #ffffff !default;
|
|
18
18
|
$color-default-color-dark-link-on-action: #001c37 !default;
|
|
19
|
-
$color-default-color-dark-link-visited: #
|
|
19
|
+
$color-default-color-dark-link-visited: #F2CDFF !default;
|
|
20
20
|
$color-default-color-dark-site-title: #ffffff !default;
|
|
21
21
|
$color-default-color-dark-text-default: #ffffff !default;
|
|
22
22
|
$color-default-color-dark-text-heading: #ffffff !default;
|
|
23
23
|
$color-default-color-dark-text-lighter: #deebf9 !default;
|
|
24
24
|
$color-default-color-dark-underline-default-hover: #ffffff !default;
|
|
25
25
|
$color-default-color-dark-underline-default: #b5cce2 !default;
|
|
26
|
-
$color-default-color-dark-underline-visited-hover: #
|
|
27
|
-
$color-default-color-dark-underline-visited: #
|
|
26
|
+
$color-default-color-dark-underline-visited-hover: #F2CDFF !default;
|
|
27
|
+
$color-default-color-dark-underline-visited: #C6AED9 !default;
|
|
28
28
|
|
|
29
29
|
/* Light palettes */
|
|
30
30
|
$color-default-color-light-accent-design-accent: #84d3ff !default;
|
package/src/css/qld-type.scss
CHANGED
|
@@ -6,12 +6,11 @@ body {
|
|
|
6
6
|
|
|
7
7
|
.qld-content-body {
|
|
8
8
|
p {
|
|
9
|
-
margin-bottom:
|
|
9
|
+
margin-bottom: 1rem;
|
|
10
|
+
line-height: 1.5;
|
|
10
11
|
}
|
|
11
|
-
|
|
12
12
|
ul,
|
|
13
|
-
ol
|
|
14
|
-
p {
|
|
13
|
+
ol{
|
|
15
14
|
line-height: 1.75;
|
|
16
15
|
}
|
|
17
16
|
|
|
@@ -68,15 +67,13 @@ h6 {
|
|
|
68
67
|
color: var(--qld-headings-color);
|
|
69
68
|
}
|
|
70
69
|
|
|
71
|
-
a
|
|
72
|
-
a.nav-link {
|
|
70
|
+
a {
|
|
73
71
|
@include mixins.make-link();
|
|
74
72
|
}
|
|
75
73
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
line-height: 20px;
|
|
74
|
+
a.nav-link {
|
|
75
|
+
@include mixins.make-link();
|
|
76
|
+
border-radius: 0;
|
|
80
77
|
}
|
|
81
78
|
|
|
82
79
|
a.nostyle {
|
|
@@ -89,9 +86,10 @@ a.nostyle {
|
|
|
89
86
|
}
|
|
90
87
|
}
|
|
91
88
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
89
|
+
figure > figcaption {
|
|
90
|
+
font-size: 14px;
|
|
91
|
+
font-weight: 400;
|
|
92
|
+
line-height: 20px;
|
|
95
93
|
}
|
|
96
94
|
|
|
97
95
|
::selection {
|
|
@@ -30,6 +30,14 @@ $utilities: map-merge(
|
|
|
30
30
|
"dark-alt": var(--qld-dark-alt-background),
|
|
31
31
|
"dark-alt-shade": var(--qld-dark-alt-background-shade),
|
|
32
32
|
),
|
|
33
|
-
)
|
|
33
|
+
),
|
|
34
|
+
"focus": (
|
|
35
|
+
class: "qld-focus",
|
|
36
|
+
property: --qld-focus-color,
|
|
37
|
+
values: (
|
|
38
|
+
"light": var(--#{$prefix}light-focus),
|
|
39
|
+
"dark": var(--#{$prefix}dark-focus),
|
|
40
|
+
),
|
|
41
|
+
)
|
|
34
42
|
)
|
|
35
43
|
);
|
|
@@ -21,7 +21,7 @@ $qld-red-border: $core-default-color-status-error-darker;
|
|
|
21
21
|
$qld-blue-border: $color-default-color-light-border-light;
|
|
22
22
|
$qld-yellow-border: $core-default-color-status-caution-darker;
|
|
23
23
|
$qld-dark-blue-shade: $color-default-color-dark-background-alt-shade;
|
|
24
|
-
$qld-light-background: $
|
|
24
|
+
$qld-light-background: $color-default-color-light-background-light;
|
|
25
25
|
$qld-light-background-shade: $color-default-color-light-background-light-shade;
|
|
26
26
|
$qld-light-border: $color-default-color-light-border-default;
|
|
27
27
|
$qld-light-border-alt: $color-default-color-light-border-alt;
|