@digigov/css 2.0.0-2445d5cb → 2.0.0-298cfc51
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/dist/base/index.css +1 -1
- package/dist/base.js +1 -1
- package/dist/components.js +1 -1
- package/dist/digigov.css +3 -3
- package/dist/utilities/index.css +1 -1
- package/dist/utilities.js +1 -1
- package/index.js +99 -69
- package/package.json +12 -12
- package/postcss.config.js +4 -3
- package/src/base/index.css +1 -0
- package/src/base/index.native.css +2 -0
- package/src/base/postcss.config.js +11 -10
- package/src/base/tailwind.config.js +4 -11
- package/src/components/blockquote.common.css +14 -0
- package/src/components/blockquote.css +9 -0
- package/src/components/blockquote.native.css +12 -0
- package/src/components/button.common.css +62 -0
- package/src/components/button.css +13 -28
- package/src/components/button.native.css +55 -0
- package/src/components/card.common.css +33 -0
- package/src/components/card.css +11 -11
- package/src/components/card.native.css +29 -0
- package/src/components/checkboxes.common.css +16 -0
- package/src/components/checkboxes.css +6 -8
- package/src/components/checkboxes.native.css +28 -0
- package/src/components/chip.common.css +19 -0
- package/src/components/chip.css +5 -4
- package/src/components/chip.native.css +18 -0
- package/src/components/code.css +7 -8
- package/src/components/copy-to-clipboard.css +1 -1
- package/src/components/copy-to-clipboard.native.css +28 -0
- package/src/components/details.common.css +26 -0
- package/src/components/details.css +6 -9
- package/src/components/details.native.css +32 -0
- package/src/components/drawer.css +23 -3
- package/src/components/dropdown.common.css +23 -0
- package/src/components/dropdown.css +7 -9
- package/src/components/dropdown.native.css +28 -0
- package/src/components/filter.css +71 -22
- package/src/components/form.common.css +82 -0
- package/src/components/form.css +30 -5
- package/src/components/form.native.css +150 -0
- package/src/components/header.common.css +35 -0
- package/src/components/header.css +11 -19
- package/src/components/header.native.css +29 -0
- package/src/components/index.css +1 -0
- package/src/components/kitchensink.css +2 -2
- package/src/components/layout.common.css +36 -0
- package/src/components/layout.css +12 -11
- package/src/components/layout.native.css +41 -0
- package/src/components/loader.common.css +7 -0
- package/src/components/loader.css +3 -1
- package/src/components/loader.native.css +5 -0
- package/src/components/masthead.css +1 -1
- package/src/components/modal.common.css +17 -0
- package/src/components/modal.css +14 -14
- package/src/components/modal.native.css +18 -0
- package/src/components/nav.common.css +22 -0
- package/src/components/nav.css +6 -8
- package/src/components/nav.native.css +42 -0
- package/src/components/notification-banner.common.css +46 -0
- package/src/components/notification-banner.css +8 -6
- package/src/components/notification-banner.native.css +42 -0
- package/src/components/pagination.css +19 -3
- package/src/components/panel.common.css +30 -0
- package/src/components/panel.css +6 -15
- package/src/components/panel.native.css +22 -0
- package/src/components/phase-banner.common.css +23 -0
- package/src/components/phase-banner.css +7 -6
- package/src/components/phase-banner.native.css +31 -0
- package/src/components/postcss.config.js +7 -6
- package/src/components/radios.common.css +16 -0
- package/src/components/radios.css +5 -11
- package/src/components/radios.native.css +24 -0
- package/src/components/stack.common.css +67 -0
- package/src/components/stack.css +23 -21
- package/src/components/stack.native.css +68 -0
- package/src/components/summary-list.common.css +93 -0
- package/src/components/summary-list.css +76 -18
- package/src/components/summary-list.native.css +97 -0
- package/src/components/svg-icons.common.css +56 -0
- package/src/components/svg-icons.native.css +55 -0
- package/src/components/test.css +7 -0
- package/src/components/typography.common.css +137 -0
- package/src/components/typography.css +32 -80
- package/src/components/typography.native.css +128 -0
- package/src/components/warning-text.common.css +23 -0
- package/src/components/warning-text.css +1 -1
- package/src/components/warning-text.native.css +22 -0
- package/src/index.native.css +24 -0
- package/src/utilities/gap.css +141 -0
- package/src/utilities/index.css +6 -1828
- package/src/utilities/index.native.css +6 -0
- package/src/utilities/layout.css +231 -0
- package/src/utilities/layout.native.css +278 -0
- package/src/utilities/margin.css +4299 -0
- package/src/utilities/padding.css +4299 -0
- package/src/utilities/postcss.config.js +7 -6
- package/src/utilities/print.css +11 -0
- package/src/utilities/utilities.css +3 -2367
- package/tailwind.config.js +102 -106
- package/theming.js +121 -0
- package/defaultTheme/accordion.json +0 -16
- package/defaultTheme/back-to-top.json +0 -27
- package/defaultTheme/brandConfig.json +0 -147
- package/defaultTheme/breadcrumbs.json +0 -8
- package/defaultTheme/button.json +0 -90
- package/defaultTheme/card.json +0 -23
- package/defaultTheme/form.json +0 -30
- package/defaultTheme/globals.json +0 -81
- package/defaultTheme/index.js +0 -27
- package/defaultTheme/layout.json +0 -55
- package/defaultTheme/misc.json +0 -68
- package/defaultTheme/panel.json +0 -48
- package/defaultTheme/phase-banner.json +0 -8
- package/defaultTheme/radios.json +0 -8
- package/defaultTheme/summary-list.json +0 -8
- package/defaultTheme/typography.json +0 -295
- package/themes.plugin.js +0 -148
package/index.js
CHANGED
|
@@ -1,66 +1,92 @@
|
|
|
1
|
-
const path = require(
|
|
1
|
+
const path = require('path');
|
|
2
2
|
|
|
3
|
-
var digigovCssInfo = require(path.join(__dirname,'./package.json'))
|
|
4
|
-
const digigovTailwindConfig = require(
|
|
3
|
+
var digigovCssInfo = require(path.join(__dirname, './package.json'));
|
|
4
|
+
const digigovTailwindConfig = require(
|
|
5
|
+
path.join(__dirname, './tailwind.config.js')
|
|
6
|
+
);
|
|
5
7
|
|
|
6
|
-
const
|
|
7
|
-
const utilities = require(path.join(__dirname,'./dist/utilities'))
|
|
8
|
-
const components = require(path.join(__dirname,'./dist/components'))
|
|
8
|
+
const getThemeBaseStyle = require(path.join(__dirname, './theming.js'));
|
|
9
9
|
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
if (config('digigovCss.logs') != false) {
|
|
14
|
-
logs = true
|
|
15
|
-
}
|
|
16
|
-
if (logs) {
|
|
17
|
-
console.log()
|
|
18
|
-
console.log('\x1b[35m%s\x1b[0m', '🌼 Digigov CSS components ' + digigovCssInfo.version, '\x1b[0m', digigovCssInfo.homepage)
|
|
19
|
-
console.group()
|
|
20
|
-
}
|
|
10
|
+
const base = require(path.join(__dirname, './dist/base'));
|
|
11
|
+
const utilities = require(path.join(__dirname, './dist/utilities'));
|
|
12
|
+
const components = require(path.join(__dirname, './dist/components'));
|
|
21
13
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
14
|
+
/**
|
|
15
|
+
* Load Digigov CSS styles and add them to the base tailwindcss styles.
|
|
16
|
+
*
|
|
17
|
+
* Optionally, you can provide additional options for loading a custom theme.
|
|
18
|
+
*
|
|
19
|
+
* @param {object} [options={}]
|
|
20
|
+
* @param {string} [options.customTheme] - Custom theme package name or file path.
|
|
21
|
+
* @param {boolean} [options.eject] - Whether to ignore the default Digigov CSS base styles.
|
|
22
|
+
*/
|
|
23
|
+
function mainFunction(options = {}) {
|
|
24
|
+
return function ({ addBase, addComponents, addUtilities, config }) {
|
|
25
|
+
let digigovCssIncludedItems = [];
|
|
26
|
+
let logs = false;
|
|
27
|
+
if (config('digigovCss.logs') != false) {
|
|
28
|
+
logs = true;
|
|
29
|
+
}
|
|
30
|
+
if (logs) {
|
|
31
|
+
console.log();
|
|
32
|
+
console.log(
|
|
33
|
+
'\x1b[35m%s\x1b[0m',
|
|
34
|
+
'🌼 Digigov CSS components ' + digigovCssInfo.version,
|
|
35
|
+
'\x1b[0m',
|
|
36
|
+
digigovCssInfo.homepage
|
|
37
|
+
);
|
|
38
|
+
console.group();
|
|
39
|
+
}
|
|
27
40
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
// ... or just regular css rules
|
|
39
|
-
} else {
|
|
40
|
-
classNames.push({[selector]: components[selector]});
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
if (config('digigovCss.components') != false) {
|
|
44
|
-
// this order is important for loading CSS rules and media queries
|
|
45
|
-
// consistently, since the keys in js objects are not ordered and
|
|
46
|
-
// sometimes order can be different. By spreading them in sequence
|
|
47
|
-
// we fix this bug
|
|
48
|
-
addComponents([
|
|
49
|
-
...classNames,
|
|
50
|
-
...mediaQueries,
|
|
51
|
-
])
|
|
52
|
-
digigovCssIncludedItems.push('components')
|
|
53
|
-
}
|
|
41
|
+
// inject @base style
|
|
42
|
+
if (config('digigovCss.base') != false) {
|
|
43
|
+
const themeBaseStyle = getThemeBaseStyle({
|
|
44
|
+
eject: options.eject,
|
|
45
|
+
theme: options.customTheme,
|
|
46
|
+
debug: logs,
|
|
47
|
+
});
|
|
48
|
+
addBase({ ...base, ...themeBaseStyle });
|
|
49
|
+
digigovCssIncludedItems.push('base');
|
|
50
|
+
}
|
|
54
51
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
52
|
+
// inject components
|
|
53
|
+
let classNames = [];
|
|
54
|
+
let mediaQueries = [];
|
|
55
|
+
// split compiled components in two different sectors
|
|
56
|
+
// to load them in the correct order, since media queries
|
|
57
|
+
// should be always after the main CSS rules
|
|
58
|
+
Object.keys(components).forEach((selector) => {
|
|
59
|
+
// checking if selectors are media queries
|
|
60
|
+
if (selector.startsWith('@media')) {
|
|
61
|
+
mediaQueries.push({ [selector]: components[selector] });
|
|
62
|
+
// ... or just regular css rules
|
|
63
|
+
} else {
|
|
64
|
+
classNames.push({ [selector]: components[selector] });
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
if (config('digigovCss.components') != false) {
|
|
68
|
+
// this order is important for loading CSS rules and media queries
|
|
69
|
+
// consistently, since the keys in js objects are not ordered and
|
|
70
|
+
// sometimes order can be different. By spreading them in sequence
|
|
71
|
+
// we fix this bug
|
|
72
|
+
addComponents([...classNames, ...mediaQueries]);
|
|
73
|
+
digigovCssIncludedItems.push('components');
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// inject @utilities style needed by components
|
|
77
|
+
if (config('digigovCss.utils') != false) {
|
|
78
|
+
addUtilities(utilities);
|
|
79
|
+
digigovCssIncludedItems.push('utilities');
|
|
80
|
+
}
|
|
81
|
+
if (logs) {
|
|
82
|
+
console.log(
|
|
83
|
+
'\x1b[32m%s\x1b[0m',
|
|
84
|
+
'🛠️ Including functions:',
|
|
85
|
+
'\x1b[0m',
|
|
86
|
+
'' + digigovCssIncludedItems.join(', ')
|
|
87
|
+
);
|
|
88
|
+
if (isTailwindInstalled === false) {
|
|
89
|
+
console.log(`\n\x1b[33;1m! warning\x1b[0m - unable to require \x1b[36mtailwindcss/plugin\x1b[0m
|
|
64
90
|
Digigov CSS color are now only available for Digigov CSS components.
|
|
65
91
|
If you want to use DigigovCSS color as utility classes (like 'bg-primary')
|
|
66
92
|
you need to add this to your \x1b[36mtailwind.config.js\x1b[0m file:
|
|
@@ -73,25 +99,29 @@ you need to add this to your \x1b[36mtailwind.config.js\x1b[0m file:
|
|
|
73
99
|
},\x1b[0m
|
|
74
100
|
\x1b[36m}\x1b[0m
|
|
75
101
|
───────────────────────────────────────
|
|
76
|
-
`)
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
102
|
+
`);
|
|
103
|
+
}
|
|
104
|
+
console.log();
|
|
105
|
+
console.groupEnd();
|
|
106
|
+
}
|
|
107
|
+
};
|
|
81
108
|
}
|
|
82
109
|
|
|
83
110
|
// check if tailwindcss package exists
|
|
84
111
|
let isTailwindInstalled = false;
|
|
85
112
|
try {
|
|
86
|
-
|
|
87
|
-
|
|
113
|
+
require.resolve('tailwindcss/plugin');
|
|
114
|
+
isTailwindInstalled = true;
|
|
88
115
|
} catch (er) {
|
|
89
|
-
|
|
116
|
+
isTailwindInstalled = false;
|
|
90
117
|
}
|
|
91
118
|
if (isTailwindInstalled !== false) {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
119
|
+
module.exports = require('tailwindcss/plugin').withOptions(
|
|
120
|
+
mainFunction,
|
|
121
|
+
function (options) {
|
|
122
|
+
return { ...digigovTailwindConfig, ...options };
|
|
123
|
+
}
|
|
124
|
+
);
|
|
95
125
|
} else {
|
|
96
|
-
|
|
126
|
+
module.exports = mainFunction;
|
|
97
127
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@digigov/css",
|
|
3
|
-
"version": "2.0.0-
|
|
3
|
+
"version": "2.0.0-298cfc51",
|
|
4
4
|
"description": "Digigov CSS - Tailwind CSS Components",
|
|
5
5
|
"author": "GRNET Devs <devs@lists.grnet.gr>",
|
|
6
6
|
"license": "BSD-2-Clause",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"defaultTheme",
|
|
28
28
|
"src",
|
|
29
29
|
"colors",
|
|
30
|
-
"
|
|
30
|
+
"theming.js",
|
|
31
31
|
"postcss.config.js",
|
|
32
32
|
"tailwind.config.js",
|
|
33
33
|
"screens.json"
|
|
@@ -39,32 +39,32 @@
|
|
|
39
39
|
]
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@digigov/cli": "
|
|
42
|
+
"@digigov/cli": "2.0.0-298cfc51",
|
|
43
43
|
"autoprefixer": "10.4.16",
|
|
44
|
-
"cssnano": "4.1.10",
|
|
45
|
-
"postcss": "8.4.4",
|
|
46
44
|
"postcss-cli": "8.3.0",
|
|
47
45
|
"postcss-import": "13.0.0",
|
|
48
46
|
"prejss-cli": "0.3.3",
|
|
49
47
|
"rtlcss": "3.0.0",
|
|
50
|
-
"tailwindcss": "3.
|
|
48
|
+
"tailwindcss": "3.4.13",
|
|
51
49
|
"nodemon": "2.0.7",
|
|
52
50
|
"next": "13.1.1",
|
|
53
|
-
"@digigov/postcss-banner": "1.0.5-
|
|
54
|
-
"@digigov/cli-build-tailwind": "
|
|
51
|
+
"@digigov/postcss-banner": "1.0.5-298cfc51",
|
|
52
|
+
"@digigov/cli-build-tailwind": "2.0.0-298cfc51",
|
|
55
53
|
"rimraf": "3.0.2",
|
|
56
54
|
"publint": "0.1.8",
|
|
57
55
|
"stylelint": "15.11.0",
|
|
58
|
-
"stylelint-plugin-digigov": "1.1.0-
|
|
56
|
+
"stylelint-plugin-digigov": "1.1.0-298cfc51",
|
|
59
57
|
"prettier": "3.2.5"
|
|
60
58
|
},
|
|
61
59
|
"dependencies": {
|
|
60
|
+
"@digigov/theme-default": "1.0.0-298cfc51",
|
|
62
61
|
"@fontsource/roboto": "4.4.0",
|
|
62
|
+
"cssnano": "4.1.10",
|
|
63
63
|
"publint": "0.1.8",
|
|
64
|
-
"
|
|
65
|
-
"polished": "4.2.2",
|
|
64
|
+
"postcss": "8.4.4",
|
|
66
65
|
"postcss-js": "4.0.0",
|
|
67
|
-
"postcss-load-config": "3.1.4"
|
|
66
|
+
"postcss-load-config": "3.1.4",
|
|
67
|
+
"postcss-sort-media-queries": "5.2.0"
|
|
68
68
|
},
|
|
69
69
|
"scripts": {
|
|
70
70
|
"preutilities": "DIGIGOV_CSS_BUILD=TRUE postcss --config src/utilities src/utilities/index.css --base src --dir dist",
|
package/postcss.config.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
/** @type {import('postcss-load-config').Config} */
|
|
2
2
|
const config = {
|
|
3
3
|
plugins: {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
'postcss-import': {},
|
|
5
|
+
'tailwindcss/nesting': {},
|
|
6
6
|
tailwindcss: {},
|
|
7
7
|
autoprefixer: {},
|
|
8
|
+
'postcss-sort-media-queries': {},
|
|
8
9
|
cssnano: {
|
|
9
10
|
preset: [
|
|
10
|
-
|
|
11
|
+
'default',
|
|
11
12
|
{
|
|
12
13
|
mergeRules: false,
|
|
13
14
|
},
|
package/src/base/index.css
CHANGED
|
@@ -1,27 +1,28 @@
|
|
|
1
|
-
const changeLog = require(
|
|
1
|
+
const changeLog = require('../../CHANGELOG.json');
|
|
2
2
|
const entries = changeLog.entries.sort(
|
|
3
|
-
(a, b) => new Date(b.date) - new Date(a.date)
|
|
3
|
+
(a, b) => new Date(b.date) - new Date(a.date)
|
|
4
4
|
);
|
|
5
5
|
const version = entries[0].version;
|
|
6
6
|
const date = entries[0].date;
|
|
7
|
-
const cssDate = new Date(date).toLocaleDateString(
|
|
7
|
+
const cssDate = new Date(date).toLocaleDateString('si-LK'); //yyyy-MM-dd
|
|
8
8
|
|
|
9
9
|
/** @type {import('postcss-load-config').Config} */
|
|
10
10
|
const config = {
|
|
11
11
|
plugins: [
|
|
12
|
-
require(
|
|
13
|
-
require(
|
|
14
|
-
require(
|
|
15
|
-
require(
|
|
16
|
-
require(
|
|
12
|
+
require('postcss-import'),
|
|
13
|
+
require('tailwindcss/nesting'),
|
|
14
|
+
require('tailwindcss')('./src/base/tailwind.config.js'),
|
|
15
|
+
require('autoprefixer'),
|
|
16
|
+
require('postcss-sort-media-queries'),
|
|
17
|
+
require('cssnano')({
|
|
17
18
|
preset: [
|
|
18
|
-
|
|
19
|
+
'default',
|
|
19
20
|
{
|
|
20
21
|
mergeRules: false,
|
|
21
22
|
},
|
|
22
23
|
],
|
|
23
24
|
}),
|
|
24
|
-
require(
|
|
25
|
+
require('@digigov/postcss-banner')({
|
|
25
26
|
banner: `@digigov/css: ${version}\n\nAuthor: grnet-devs\nDate: ${cssDate}`,
|
|
26
27
|
inline: false,
|
|
27
28
|
important: true,
|
|
@@ -1,21 +1,14 @@
|
|
|
1
|
-
const
|
|
2
|
-
const themesPlugin = require("../../themes.plugin");
|
|
3
|
-
const tailwindConfig = require("../../tailwind.config");
|
|
1
|
+
const tailwindConfig = require('../../tailwind.config');
|
|
4
2
|
|
|
5
3
|
/** @type {import('tailwindcss').Config} */
|
|
6
4
|
module.exports = {
|
|
7
5
|
...tailwindConfig,
|
|
8
6
|
content: {
|
|
9
7
|
files: [
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
'./*.css',
|
|
9
|
+
'../../dist/components/*.css',
|
|
10
|
+
'../../dist/utilities/*.css',
|
|
13
11
|
],
|
|
14
12
|
relative: true,
|
|
15
13
|
},
|
|
16
|
-
themes: {
|
|
17
|
-
light: require.resolve("../../../../themes/govgr-light"),
|
|
18
|
-
dark: require.resolve("../../../../themes/govgr-dark"),
|
|
19
|
-
},
|
|
20
|
-
plugins: [plugin(themesPlugin)],
|
|
21
14
|
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
@tailwind utilities;
|
|
2
|
+
|
|
3
|
+
@layer utilities {
|
|
4
|
+
.util-blockquote {
|
|
5
|
+
@apply mb-4 mt-8 md:mb-8 p-4 border-l-8 border-base-500 text-base-content;
|
|
6
|
+
}
|
|
7
|
+
.util-blockquote-text {
|
|
8
|
+
font-size: var(--blockquote-font-size);
|
|
9
|
+
line-height: var(--blockquote-line-height);
|
|
10
|
+
}
|
|
11
|
+
.util-blockquote--dense {
|
|
12
|
+
@apply mt-3 md:mb-6 p-3 border-l-6;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
@import './blockquote.common.css';
|
|
2
|
+
|
|
3
|
+
.ds-blockquote {
|
|
4
|
+
@apply util-blockquote;
|
|
5
|
+
}
|
|
6
|
+
.ds-blockquote__text {
|
|
7
|
+
@apply util-blockquote-text;
|
|
8
|
+
line-height: calc(var(--blockquote-font-size) * var(--blockquote-line-height));
|
|
9
|
+
}
|
|
10
|
+
.ds-blockquote--dense {
|
|
11
|
+
@apply util-blockquote--dense;
|
|
12
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/* stylelint-disable declaration-block-no-redundant-longhand-properties */
|
|
2
|
+
/* stylelint-disable digigov/nest-related-rules */
|
|
3
|
+
/* stylelint-disable digigov/enforce-class-selector-namespace */
|
|
4
|
+
@tailwind utilities;
|
|
5
|
+
|
|
6
|
+
@layer utilities {
|
|
7
|
+
.util-btn {
|
|
8
|
+
@apply m-0 mb-8 flex items-center;
|
|
9
|
+
border-radius: var(--btn-border-radius);
|
|
10
|
+
padding-right: var(--btn-padding-x);
|
|
11
|
+
padding-left: var(--btn-padding-x);
|
|
12
|
+
padding-top: var(--btn-padding-y);
|
|
13
|
+
padding-bottom: var(--btn-padding-y);
|
|
14
|
+
}
|
|
15
|
+
.util-btn-text {
|
|
16
|
+
@apply text-white font-medium no-underline;
|
|
17
|
+
font-size: var(--btn-font-size);
|
|
18
|
+
letter-spacing: var(--letter-spacing-wide);
|
|
19
|
+
color: var(--color-base-100);
|
|
20
|
+
}
|
|
21
|
+
.util-btn-primary {
|
|
22
|
+
/* @apply print:border-2 print:border-success print:shadow-none; */
|
|
23
|
+
box-shadow: var(--btn-primary-box-shadow);
|
|
24
|
+
background-color: var(--btn-primary-background-color);
|
|
25
|
+
}
|
|
26
|
+
.util-btn-primary-text {
|
|
27
|
+
color: var(--btn-primary-color);
|
|
28
|
+
}
|
|
29
|
+
.util-btn-secondary {
|
|
30
|
+
/* @apply print:border-2 print:border-base-700 print:shadow-none; */
|
|
31
|
+
box-shadow: var(--btn-secondary-box-shadow);
|
|
32
|
+
background-color: var(--btn-secondary-background-color);
|
|
33
|
+
}
|
|
34
|
+
.util-btn-secondary-text {
|
|
35
|
+
color: var(--btn-secondary-color) !important;
|
|
36
|
+
}
|
|
37
|
+
.util-btn-warning {
|
|
38
|
+
/* @apply print:border-2 print:border-error print:shadow-none; */
|
|
39
|
+
box-shadow: var(--btn-warning-box-shadow);
|
|
40
|
+
background-color: var(--btn-warning-background-color);
|
|
41
|
+
}
|
|
42
|
+
.util-btn-warning-text {
|
|
43
|
+
color: var(--btn-warning-color);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.util-btn--dense {
|
|
47
|
+
--btn-padding-y: 0.375rem;
|
|
48
|
+
--btn-padding-x: 0.75rem;
|
|
49
|
+
@apply min-h-6;
|
|
50
|
+
}
|
|
51
|
+
.util-btn--disabled {
|
|
52
|
+
opacity: 0.5;
|
|
53
|
+
}
|
|
54
|
+
.util-btn--disabled-text {
|
|
55
|
+
@apply print:text-base-400;
|
|
56
|
+
}
|
|
57
|
+
.util-btn-cta {
|
|
58
|
+
}
|
|
59
|
+
.util-btn-cta-text {
|
|
60
|
+
font-size: var(--btn-cta-font-size);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -1,14 +1,9 @@
|
|
|
1
|
+
@import './button.common.css';
|
|
1
2
|
.ds-btn,
|
|
2
3
|
.ds-btn[type='submit'],
|
|
3
4
|
.ds-btn[type='button'],
|
|
4
5
|
.ds-btn[type='reset'] {
|
|
5
|
-
@apply
|
|
6
|
-
m-0 mb-8 w-max min-h-10 md:min-h-12
|
|
7
|
-
flex gap-x-3 items-center;
|
|
8
|
-
border-radius: var(--btn-border-radius);
|
|
9
|
-
padding: var(--btn-padding);
|
|
10
|
-
letter-spacing: var(--btn-letter-spacing);
|
|
11
|
-
font-size: var(--btn-font-size);
|
|
6
|
+
@apply util-btn util-btn-text min-h-10 md:min-h-12 w-max cursor-pointer;
|
|
12
7
|
&:focus {
|
|
13
8
|
box-shadow:
|
|
14
9
|
0 0 0 2px var(--color-white),
|
|
@@ -18,10 +13,10 @@
|
|
|
18
13
|
&:focus-within {
|
|
19
14
|
@apply outline-none;
|
|
20
15
|
}
|
|
16
|
+
|
|
21
17
|
&.ds-btn--dense,
|
|
22
18
|
.ds-dense & {
|
|
23
|
-
--
|
|
24
|
-
@apply min-h-8;
|
|
19
|
+
@apply util-btn--dense;
|
|
25
20
|
&:focus {
|
|
26
21
|
box-shadow:
|
|
27
22
|
0 0 0 2px var(--color-white),
|
|
@@ -34,12 +29,9 @@
|
|
|
34
29
|
.ds-btn-primary[type='submit'],
|
|
35
30
|
.ds-btn-primary[type='button'],
|
|
36
31
|
.ds-btn-primary[type='reset'] {
|
|
37
|
-
@apply
|
|
38
|
-
print:border-2 print:border-success print:shadow-none;
|
|
39
|
-
box-shadow: var(--btn-primary-box-shadow);
|
|
40
|
-
background-color: var(--btn-primary-background-color);
|
|
41
|
-
color: var(--btn-primary-color);
|
|
32
|
+
@apply util-btn-primary util-btn-primary-text;
|
|
42
33
|
&:hover {
|
|
34
|
+
@apply no-underline;
|
|
43
35
|
background-color: var(--btn-primary-background-color-hover);
|
|
44
36
|
color: var(--btn-primary-color-hover);
|
|
45
37
|
}
|
|
@@ -48,8 +40,7 @@
|
|
|
48
40
|
}
|
|
49
41
|
}
|
|
50
42
|
.ds-btn-cta {
|
|
51
|
-
@apply py-4 print:pr-2;
|
|
52
|
-
font-size: var(--btn-cta-font-size);
|
|
43
|
+
@apply py-4 print:pr-2 util-btn-cta-text;
|
|
53
44
|
&.ds-btn--dense,
|
|
54
45
|
.ds-dense & {
|
|
55
46
|
@apply py-3 px-4;
|
|
@@ -59,12 +50,9 @@
|
|
|
59
50
|
.ds-btn-secondary[type='submit'],
|
|
60
51
|
.ds-btn-secondary[type='button'],
|
|
61
52
|
.ds-btn-secondary[type='reset'] {
|
|
62
|
-
@apply
|
|
63
|
-
print:border-2 print:border-base-700 print:shadow-none;
|
|
64
|
-
box-shadow: var(--btn-secondary-box-shadow);
|
|
65
|
-
background-color: var(--btn-secondary-background-color);
|
|
66
|
-
color: var(--btn-secondary-color);
|
|
53
|
+
@apply util-btn-secondary util-btn-secondary-text;
|
|
67
54
|
&:hover {
|
|
55
|
+
@apply no-underline;
|
|
68
56
|
background-color: var(--btn-secondary-background-color-hover);
|
|
69
57
|
color: var(--btn-secondary-color-hover);
|
|
70
58
|
}
|
|
@@ -76,12 +64,9 @@
|
|
|
76
64
|
.ds-btn-warning[type='submit'],
|
|
77
65
|
.ds-btn-warning[type='button'],
|
|
78
66
|
.ds-btn-warning[type='reset'] {
|
|
79
|
-
@apply
|
|
80
|
-
print:border-2 print:border-error print:shadow-none;
|
|
81
|
-
box-shadow: var(--btn-warning-box-shadow);
|
|
82
|
-
background-color: var(--btn-warning-background-color);
|
|
83
|
-
color: var(--btn-warning-color);
|
|
67
|
+
@apply util-btn-warning util-btn-warning-text;
|
|
84
68
|
&:hover {
|
|
69
|
+
@apply no-underline;
|
|
85
70
|
background-color: var(--btn-warning-background-color-hover);
|
|
86
71
|
color: var(--btn-warning-color-hover);
|
|
87
72
|
}
|
|
@@ -91,9 +76,8 @@
|
|
|
91
76
|
}
|
|
92
77
|
}
|
|
93
78
|
.ds-btn--disabled {
|
|
94
|
-
@apply opacity-50 hover:bg-opacity-50
|
|
95
|
-
print:text-base-400 print:border-opacity-50;
|
|
96
79
|
@apply cursor-not-allowed !important;
|
|
80
|
+
@apply util-btn--disabled util-btn--disabled-text;
|
|
97
81
|
}
|
|
98
82
|
.ds-close-btn {
|
|
99
83
|
@apply flex flex-nowrap text-right w-max float-right items-center;
|
|
@@ -110,6 +94,7 @@
|
|
|
110
94
|
.ds-svg-icon {
|
|
111
95
|
fill: var(--btn-primary-color);
|
|
112
96
|
}
|
|
97
|
+
/* stylelint-disable-next-line digigov/nest-related-rules */
|
|
113
98
|
.ds-svg-icon--more-vert {
|
|
114
99
|
@apply h-6 w-6 md:h-8 md:w-8;
|
|
115
100
|
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/* stylelint-disable declaration-block-no-redundant-longhand-properties */
|
|
2
|
+
/* stylelint-disable digigov/nest-related-rules */
|
|
3
|
+
@import './button.common.css';
|
|
4
|
+
|
|
5
|
+
.ds-btn {
|
|
6
|
+
@apply util-btn min-h-4 flex-row flex-nowrap justify-center;
|
|
7
|
+
border-bottom-width: var(--btn-border-bottom-width-native);
|
|
8
|
+
border-bottom-color: var(--btn-border-bottom-color-native);
|
|
9
|
+
padding-top: calc( 1.5 * var(--btn-padding-y)) !important;
|
|
10
|
+
padding-bottom: calc( 1.5 * var(--btn-padding-y)) !important;
|
|
11
|
+
}
|
|
12
|
+
.ds-btn__text {
|
|
13
|
+
@apply util-btn-text min-h-4 text-center;
|
|
14
|
+
}
|
|
15
|
+
.ds-btn--dense {
|
|
16
|
+
@apply min-h-6;
|
|
17
|
+
}
|
|
18
|
+
.ds-btn--dense__text {
|
|
19
|
+
@apply min-h-4;
|
|
20
|
+
}
|
|
21
|
+
.ds-btn--disabled {
|
|
22
|
+
@apply util-btn--disabled;
|
|
23
|
+
}
|
|
24
|
+
.ds-btn--disabled__text {
|
|
25
|
+
@apply util-btn--disabled-text;
|
|
26
|
+
}
|
|
27
|
+
.ds-btn-primary {
|
|
28
|
+
@apply util-btn-primary util-btn;
|
|
29
|
+
}
|
|
30
|
+
.ds-btn-primary__text {
|
|
31
|
+
@apply util-btn-primary-text;
|
|
32
|
+
}
|
|
33
|
+
.ds-btn-secondary {
|
|
34
|
+
@apply util-btn-secondary;
|
|
35
|
+
}
|
|
36
|
+
.ds-btn-secondary__text {
|
|
37
|
+
@apply util-btn-secondary-text;
|
|
38
|
+
}
|
|
39
|
+
.ds-btn-warning {
|
|
40
|
+
@apply util-btn-warning;
|
|
41
|
+
}
|
|
42
|
+
.ds-btn-warning__text {
|
|
43
|
+
@apply util-btn-warning-text;
|
|
44
|
+
}
|
|
45
|
+
.ds-btn-cta {
|
|
46
|
+
padding-top: calc( 2.25 * var(--btn-padding-y)) !important;
|
|
47
|
+
padding-bottom: calc( 2.25 * var(--btn-padding-y)) !important;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.ds-btn-cta__text {
|
|
51
|
+
@apply util-btn-cta-text;
|
|
52
|
+
}
|
|
53
|
+
.ds-btn-cta__icon {
|
|
54
|
+
fill: var(--color-white) !important;
|
|
55
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
@tailwind utilities;
|
|
2
|
+
|
|
3
|
+
@layer utilities {
|
|
4
|
+
.util-card {
|
|
5
|
+
@apply mb-7 text-base-content max-w-full bg-base-100;
|
|
6
|
+
border-radius: var(--card-border-radius);
|
|
7
|
+
}
|
|
8
|
+
.util-card--border {
|
|
9
|
+
@apply border-2 border-base-content p-6;
|
|
10
|
+
}
|
|
11
|
+
.util-card--border-top {
|
|
12
|
+
@apply border-t border-base-300 pt-4;
|
|
13
|
+
}
|
|
14
|
+
.util-card--border-light {
|
|
15
|
+
@apply border-base-300;
|
|
16
|
+
}
|
|
17
|
+
.util-card--border-dark {
|
|
18
|
+
@apply border-base-content;
|
|
19
|
+
}
|
|
20
|
+
.util-card--divider {
|
|
21
|
+
--card-border-radius: 0;
|
|
22
|
+
@apply border-b border-base-300 pb-4 mb-4;
|
|
23
|
+
}
|
|
24
|
+
.util-card__heading-text {
|
|
25
|
+
@apply md:text-2xl text-xl font-bold;
|
|
26
|
+
}
|
|
27
|
+
.util-card__body {
|
|
28
|
+
@apply flex flex-col gap-3 md:gap-4;
|
|
29
|
+
}
|
|
30
|
+
.util-card__action {
|
|
31
|
+
@apply flex flex-wrap items-center gap-y-4 mt-auto;
|
|
32
|
+
}
|
|
33
|
+
}
|