cmat 0.0.21 → 0.0.22
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/components/material-color-picker/base-color.d.ts +1 -0
- package/fesm2022/cmat-components-adapter.mjs +9 -9
- package/fesm2022/cmat-components-breadcrumb.mjs +9 -9
- package/fesm2022/cmat-components-card.mjs +4 -4
- package/fesm2022/cmat-components-card.mjs.map +1 -1
- package/fesm2022/cmat-components-carousel.mjs +12 -12
- package/fesm2022/cmat-components-cascade.mjs +9 -9
- package/fesm2022/cmat-components-chip-input.mjs +3 -3
- package/fesm2022/cmat-components-custom-formly.mjs +94 -94
- package/fesm2022/cmat-components-custom-formly.mjs.map +1 -1
- package/fesm2022/cmat-components-date-range.mjs +3 -3
- package/fesm2022/cmat-components-drawer.mjs +6 -6
- package/fesm2022/cmat-components-fullscreen.mjs +3 -3
- package/fesm2022/cmat-components-highlight.mjs +6 -6
- package/fesm2022/cmat-components-image-viewer.mjs +3 -3
- package/fesm2022/cmat-components-json-editor.mjs +3 -3
- package/fesm2022/cmat-components-knob-input.mjs +3 -3
- package/fesm2022/cmat-components-masonry.mjs +3 -3
- package/fesm2022/cmat-components-material-color-picker.mjs +16 -4
- package/fesm2022/cmat-components-material-color-picker.mjs.map +1 -1
- package/fesm2022/cmat-components-material-datetimepicker.mjs +43 -43
- package/fesm2022/cmat-components-material-datetimepicker.mjs.map +1 -1
- package/fesm2022/cmat-components-navigation.mjs +40 -40
- package/fesm2022/cmat-components-navigation.mjs.map +1 -1
- package/fesm2022/cmat-components-opt-input.mjs +3 -3
- package/fesm2022/cmat-components-org-chart.mjs +9 -9
- package/fesm2022/cmat-components-pagination.mjs +15 -13
- package/fesm2022/cmat-components-pagination.mjs.map +1 -1
- package/fesm2022/cmat-components-password-strength.mjs +9 -9
- package/fesm2022/cmat-components-popover.mjs +9 -9
- package/fesm2022/cmat-components-progress-bar.mjs +4 -4
- package/fesm2022/cmat-components-progress-bar.mjs.map +1 -1
- package/fesm2022/cmat-components-rating.mjs +3 -3
- package/fesm2022/cmat-components-select-search.mjs +9 -9
- package/fesm2022/cmat-components-select-table.mjs +4 -4
- package/fesm2022/cmat-components-select-table.mjs.map +1 -1
- package/fesm2022/cmat-components-select-tree.mjs +3 -3
- package/fesm2022/cmat-components-speed-dial.mjs +9 -9
- package/fesm2022/cmat-components-timeline.mjs +13 -13
- package/fesm2022/cmat-components-timeline.mjs.map +1 -1
- package/fesm2022/cmat-components-toast.mjs +9 -9
- package/fesm2022/cmat-components-transfer-picker.mjs +19 -19
- package/fesm2022/cmat-components-transfer-picker.mjs.map +1 -1
- package/fesm2022/cmat-components-treetable.mjs +6 -6
- package/fesm2022/cmat-components-upload.mjs +11 -11
- package/fesm2022/cmat-components-upload.mjs.map +1 -1
- package/fesm2022/cmat-directives-animate-on-scroll.mjs +9 -11
- package/fesm2022/cmat-directives-animate-on-scroll.mjs.map +1 -1
- package/fesm2022/cmat-directives-arrow-cursor.mjs +3 -3
- package/fesm2022/cmat-directives-autofocus.mjs +3 -3
- package/fesm2022/cmat-directives-data-exporter.mjs +21 -21
- package/fesm2022/cmat-directives-debounce.mjs +9 -9
- package/fesm2022/cmat-directives-digit-only.mjs +6 -6
- package/fesm2022/cmat-directives-equal-validator.mjs +3 -3
- package/fesm2022/cmat-lib-mock-api.mjs +6 -6
- package/fesm2022/cmat-pipes-bytes.mjs +3 -3
- package/fesm2022/cmat-pipes-date-format.mjs +3 -3
- package/fesm2022/cmat-pipes-find-by-key.mjs +3 -3
- package/fesm2022/cmat-pipes-group-by.mjs +3 -3
- package/fesm2022/cmat-pipes-keys.mjs +3 -3
- package/fesm2022/cmat-pipes-secure.mjs +3 -3
- package/fesm2022/cmat-pipes-uppercase.mjs +3 -3
- package/fesm2022/cmat-services-alert.mjs +3 -3
- package/fesm2022/cmat-services-config.mjs +6 -6
- package/fesm2022/cmat-services-confirmation.mjs +7 -7
- package/fesm2022/cmat-services-confirmation.mjs.map +1 -1
- package/fesm2022/cmat-services-data.mjs +3 -3
- package/fesm2022/cmat-services-export-as.mjs +3 -3
- package/fesm2022/cmat-services-loading.mjs +6 -6
- package/fesm2022/cmat-services-local-storage.mjs +3 -3
- package/fesm2022/cmat-services-media-watcher.mjs +3 -3
- package/fesm2022/cmat-services-platform.mjs +3 -3
- package/fesm2022/cmat-services-splash-screen.mjs +3 -3
- package/fesm2022/cmat-services-title.mjs +3 -3
- package/fesm2022/cmat-services-translation.mjs +3 -3
- package/fesm2022/cmat-services-utils.mjs +3 -3
- package/package.json +35 -35
- package/styles/components/bundle.scss +23 -25
- package/styles/components/input.scss +2 -0
- package/styles/overrides/angular-material.scss +75 -59
- package/styles/overrides/fullcalendar.scss +3 -1
- package/styles/overrides/quill.scss +8 -6
- package/styles/tailwind.scss +101 -13
- package/styles/user-themes.scss +1 -1
- package/tailwind/plugins/helpers.js +16 -0
- package/tailwind/plugins/scrollbar/index.js +31 -0
- package/tailwind/plugins/scrollbar/typedefs.js +9 -0
- package/tailwind/plugins/scrollbar/utilities.js +201 -0
- package/tailwind/plugins/scrollbar/variants.js +30 -0
- package/tailwind/plugins/theming.js +257 -256
- package/tailwind/plugins/utilities.js +12 -25
- package/tailwind/utils/json-to-sass-map.js +28 -36
|
@@ -1,256 +1,257 @@
|
|
|
1
|
-
const chroma = require('chroma-js');
|
|
2
|
-
const _ = require('lodash');
|
|
3
|
-
const fs = require('fs');
|
|
4
|
-
const path = require('path');
|
|
5
|
-
const colors = require('tailwindcss/colors');
|
|
6
|
-
const plugin = require('tailwindcss/plugin');
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
// -----------------------------------------------------------------------------------------------------
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
// -----------------------------------------------------------------------------------------------------
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
*
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
*
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
*
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
if
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
*
|
|
122
|
-
*
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
const
|
|
147
|
-
const
|
|
148
|
-
const
|
|
149
|
-
const
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
*
|
|
157
|
-
*
|
|
158
|
-
*
|
|
159
|
-
*
|
|
160
|
-
*
|
|
161
|
-
*
|
|
162
|
-
*
|
|
163
|
-
*
|
|
164
|
-
* dark themes
|
|
165
|
-
*
|
|
166
|
-
*
|
|
167
|
-
*
|
|
168
|
-
*
|
|
169
|
-
*
|
|
170
|
-
*
|
|
171
|
-
*
|
|
172
|
-
*
|
|
173
|
-
*
|
|
174
|
-
*
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
..._.fromPairs(_.flatten(_.map(
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
addComponents(
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
*
|
|
200
|
-
*
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
[
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
'bg-
|
|
213
|
-
'bg-
|
|
214
|
-
'bg-
|
|
215
|
-
'bg-
|
|
216
|
-
'bg-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
'bg-
|
|
221
|
-
'bg-
|
|
222
|
-
'bg-
|
|
223
|
-
'bg-
|
|
224
|
-
'bg-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
'text-
|
|
231
|
-
'text-
|
|
232
|
-
'text-
|
|
233
|
-
'
|
|
234
|
-
'
|
|
235
|
-
'
|
|
236
|
-
'
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
'text-
|
|
241
|
-
'text-
|
|
242
|
-
'text-
|
|
243
|
-
'
|
|
244
|
-
'
|
|
245
|
-
'
|
|
246
|
-
'
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
1
|
+
const chroma = require('chroma-js');
|
|
2
|
+
const _ = require('lodash');
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
const colors = require('tailwindcss/colors');
|
|
6
|
+
const plugin = require('tailwindcss/plugin');
|
|
7
|
+
const flattenColorPaletteImport = require('tailwindcss/lib/util/flattenColorPalette');
|
|
8
|
+
const { importDefault } = require(path.resolve(__dirname, ('./helpers')));
|
|
9
|
+
const flattenColorPalette = importDefault(flattenColorPaletteImport);
|
|
10
|
+
const generateContrasts = require(path.resolve(__dirname, ('../utils/generate-contrasts')));
|
|
11
|
+
const jsonToSassMap = require(path.resolve(__dirname, ('../utils/json-to-sass-map')));
|
|
12
|
+
|
|
13
|
+
// -----------------------------------------------------------------------------------------------------
|
|
14
|
+
// @ Utilities
|
|
15
|
+
// -----------------------------------------------------------------------------------------------------
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Normalizes the provided theme by omitting empty values and values that
|
|
19
|
+
* start with "on" from each palette. Also sets the correct DEFAULT value
|
|
20
|
+
* of each palette.
|
|
21
|
+
*
|
|
22
|
+
* @param theme
|
|
23
|
+
*/
|
|
24
|
+
const normalizeTheme = (theme) => {
|
|
25
|
+
return _.fromPairs(_.map(_.omitBy(theme, (palette, paletteName) => paletteName.startsWith('on') || _.isEmpty(palette)),
|
|
26
|
+
(palette, paletteName) => [
|
|
27
|
+
paletteName,
|
|
28
|
+
{
|
|
29
|
+
...palette,
|
|
30
|
+
DEFAULT: palette['DEFAULT'] || palette[500]
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
));
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
// -----------------------------------------------------------------------------------------------------
|
|
37
|
+
// @ cmat TailwindCSS Main Plugin
|
|
38
|
+
// -----------------------------------------------------------------------------------------------------
|
|
39
|
+
const theming = plugin.withOptions((options) => ({
|
|
40
|
+
addComponents,
|
|
41
|
+
theme
|
|
42
|
+
}) => {
|
|
43
|
+
/**
|
|
44
|
+
* Create user themes object by going through the provided themes and
|
|
45
|
+
* merging them with the provided "default" so, we can have a complete
|
|
46
|
+
* set of color palettes for each user theme.
|
|
47
|
+
*/
|
|
48
|
+
const userThemes = _.fromPairs(_.map(options.themes, (theme, themeName) => [
|
|
49
|
+
themeName,
|
|
50
|
+
_.defaults({}, theme, options.themes['default'])
|
|
51
|
+
]));
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Normalize the themes and assign it to the themes object. This will
|
|
55
|
+
* be the final object that we create a SASS map from
|
|
56
|
+
*/
|
|
57
|
+
let themes = _.fromPairs(_.map(userThemes, (theme, themeName) => [
|
|
58
|
+
themeName,
|
|
59
|
+
normalizeTheme(theme)
|
|
60
|
+
]));
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Go through the themes to generate the contrasts and filter the
|
|
64
|
+
* palettes to only have "primary", "accent" and "warn" objects.
|
|
65
|
+
*/
|
|
66
|
+
themes = _.fromPairs(_.map(themes, (theme, themeName) => [
|
|
67
|
+
themeName,
|
|
68
|
+
_.pick(
|
|
69
|
+
_.fromPairs(_.map(theme, (palette, paletteName) => [
|
|
70
|
+
paletteName,
|
|
71
|
+
{
|
|
72
|
+
...palette,
|
|
73
|
+
contrast: _.fromPairs(_.map(generateContrasts(palette), (color, hue) => [
|
|
74
|
+
hue,
|
|
75
|
+
_.get(userThemes[themeName], [`on-${paletteName}`, hue]) || color
|
|
76
|
+
]))
|
|
77
|
+
}
|
|
78
|
+
])),
|
|
79
|
+
['primary', 'accent', 'warn']
|
|
80
|
+
)
|
|
81
|
+
]));
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Go through the themes and attach appropriate class selectors so,
|
|
85
|
+
* we can use them to encapsulate each theme.
|
|
86
|
+
*/
|
|
87
|
+
themes = _.fromPairs(_.map(themes, (theme, themeName) => [
|
|
88
|
+
themeName,
|
|
89
|
+
{
|
|
90
|
+
selector: `".theme-${themeName}"`,
|
|
91
|
+
...theme
|
|
92
|
+
}
|
|
93
|
+
]));
|
|
94
|
+
|
|
95
|
+
/* Generate the SASS map using the themes object */
|
|
96
|
+
const sassMap = jsonToSassMap(JSON.stringify({ 'user-themes': themes }));
|
|
97
|
+
|
|
98
|
+
/* Get the file path */
|
|
99
|
+
const filename = path.resolve(__dirname, ('../../styles/user-themes.scss'));
|
|
100
|
+
|
|
101
|
+
/* Read the file and get its data */
|
|
102
|
+
let data;
|
|
103
|
+
try {
|
|
104
|
+
data = fs.readFileSync(filename, { encoding: 'utf8' });
|
|
105
|
+
}
|
|
106
|
+
catch (err) {
|
|
107
|
+
console.error(err);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/* Write the file if the map has been changed */
|
|
111
|
+
if (data !== sassMap) {
|
|
112
|
+
try {
|
|
113
|
+
fs.writeFileSync(filename, sassMap, { encoding: 'utf8' });
|
|
114
|
+
}
|
|
115
|
+
catch (err) {
|
|
116
|
+
console.error(err);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Iterate through the user's themes and build Tailwind components containing
|
|
122
|
+
* CSS Custom Properties using the colors from them. This allows switching
|
|
123
|
+
* themes by simply replacing a class name as well as nesting them.
|
|
124
|
+
*/
|
|
125
|
+
addComponents(
|
|
126
|
+
_.fromPairs(_.map(options.themes, (theme, themeName) => [
|
|
127
|
+
themeName === 'default' ? '.theme-default' : `.theme-${themeName}`,
|
|
128
|
+
_.fromPairs(_.flatten(_.map(flattenColorPalette(_.fromPairs(_.flatten(_.map(normalizeTheme(theme), (palette, paletteName) => [
|
|
129
|
+
[
|
|
130
|
+
paletteName,
|
|
131
|
+
palette
|
|
132
|
+
],
|
|
133
|
+
[
|
|
134
|
+
`on-${paletteName}`,
|
|
135
|
+
_.fromPairs(_.map(generateContrasts(palette), (color, hue) => [hue, _.get(theme, [`on-${paletteName}`, hue]) || color]))
|
|
136
|
+
]
|
|
137
|
+
])
|
|
138
|
+
))), (value, key) => [[`--cmat-${key}`, value], [`--cmat-${key}-rgb`, chroma(value).rgb().join(',')]])))
|
|
139
|
+
]))
|
|
140
|
+
);
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Generate scheme based css custom properties and utility classes
|
|
144
|
+
*/
|
|
145
|
+
const schemeCustomProps = _.map(['light', 'dark'], (colorScheme) => {
|
|
146
|
+
const isDark = colorScheme === 'dark';
|
|
147
|
+
const background = theme(`cmat.customProps.background.${colorScheme}`);
|
|
148
|
+
const foreground = theme(`cmat.customProps.foreground.${colorScheme}`);
|
|
149
|
+
const lightSchemeSelectors = 'body.light, .light, .dark .light';
|
|
150
|
+
const darkSchemeSelectors = 'body.dark, .dark, .light .dark';
|
|
151
|
+
|
|
152
|
+
return {
|
|
153
|
+
[(isDark ? darkSchemeSelectors : lightSchemeSelectors)]: {
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* If a custom property is not available, browsers will use
|
|
157
|
+
* the fallback value. In this case, we want to use '--is-dark'
|
|
158
|
+
* as the indicator of a dark theme so, we can use it like this:
|
|
159
|
+
* background-color: var(--is-dark, red);
|
|
160
|
+
*
|
|
161
|
+
* If we set '--is-dark' as "true" on dark themes, the above rule
|
|
162
|
+
* won't work because of the said "fallback value" logic. Therefore,
|
|
163
|
+
* we set the '--is-dark' to "false" on light themes and not set it
|
|
164
|
+
* at all on dark themes so that the fallback value can be used on
|
|
165
|
+
* dark themes.
|
|
166
|
+
*
|
|
167
|
+
* On light themes, since '--is-dark' exists, the above rule will be
|
|
168
|
+
* interpolated as:
|
|
169
|
+
* "background-color: false"
|
|
170
|
+
*
|
|
171
|
+
* On dark themes, since '--is-dark' doesn't exist, the fallback value
|
|
172
|
+
* will be used ('red' in this case) and the rule will be interpolated as:
|
|
173
|
+
* "background-color: red"
|
|
174
|
+
*
|
|
175
|
+
* It's easier to understand and remember like this.
|
|
176
|
+
*/
|
|
177
|
+
...(!isDark ? { '--is-dark': 'false' } : {}),
|
|
178
|
+
|
|
179
|
+
/* Generate custom properties from customProps */
|
|
180
|
+
..._.fromPairs(_.flatten(_.map(background, (value, key) => [[`--cmat-${key}`, value], [`--cmat-${key}-rgb`, chroma(value).rgb().join(',')]]))),
|
|
181
|
+
..._.fromPairs(_.flatten(_.map(foreground, (value, key) => [[`--cmat-${key}`, value], [`--cmat-${key}-rgb`, chroma(value).rgb().join(',')]])))
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
});
|
|
185
|
+
|
|
186
|
+
const schemeUtilities = (() => {
|
|
187
|
+
/* Generate general styles & utilities */
|
|
188
|
+
return {};
|
|
189
|
+
})();
|
|
190
|
+
|
|
191
|
+
addComponents(schemeCustomProps);
|
|
192
|
+
addComponents(schemeUtilities);
|
|
193
|
+
},
|
|
194
|
+
(options) => {
|
|
195
|
+
return {
|
|
196
|
+
theme: {
|
|
197
|
+
extend: {
|
|
198
|
+
/**
|
|
199
|
+
* Add 'Primary', 'Accent' and 'Warn' palettes as colors so all color utilities
|
|
200
|
+
* are generated for them; "bg-primary", "text-on-primary", "bg-accent-600" etc.
|
|
201
|
+
* This will also allow using arbitrary values with them such as opacity and such.
|
|
202
|
+
*/
|
|
203
|
+
colors: _.fromPairs(_.flatten(_.map(_.keys(flattenColorPalette(normalizeTheme(options.themes.default))), (name) => [
|
|
204
|
+
[name, `rgba(var(--cmat-${name}-rgb), <alpha-value>)`],
|
|
205
|
+
[`on-${name}`, `rgba(var(--cmat-on-${name}-rgb), <alpha-value>)`]
|
|
206
|
+
])))
|
|
207
|
+
},
|
|
208
|
+
cmat: {
|
|
209
|
+
customProps: {
|
|
210
|
+
background: {
|
|
211
|
+
light: {
|
|
212
|
+
'bg-app-bar': '#FFFFFF',
|
|
213
|
+
'bg-card': '#FFFFFF',
|
|
214
|
+
'bg-default': colors.slate[100],
|
|
215
|
+
'bg-dialog': '#FFFFFF',
|
|
216
|
+
'bg-hover': chroma(colors.slate[400]).alpha(0.12).css(),
|
|
217
|
+
'bg-status-bar': colors.slate[300]
|
|
218
|
+
},
|
|
219
|
+
dark: {
|
|
220
|
+
'bg-app-bar': colors.slate[900],
|
|
221
|
+
'bg-card': colors.slate[800],
|
|
222
|
+
'bg-default': colors.slate[900],
|
|
223
|
+
'bg-dialog': colors.slate[800],
|
|
224
|
+
'bg-hover': 'rgba(255, 255, 255, 0.05)',
|
|
225
|
+
'bg-status-bar': colors.slate[900]
|
|
226
|
+
}
|
|
227
|
+
},
|
|
228
|
+
foreground: {
|
|
229
|
+
light: {
|
|
230
|
+
'text-default': colors.slate[800],
|
|
231
|
+
'text-secondary': colors.slate[500],
|
|
232
|
+
'text-hint': colors.slate[400],
|
|
233
|
+
'text-disabled': colors.slate[400],
|
|
234
|
+
'border': colors.slate[200],
|
|
235
|
+
'divider': colors.slate[200],
|
|
236
|
+
'icon': colors.slate[500],
|
|
237
|
+
'mat-icon': colors.slate[500]
|
|
238
|
+
},
|
|
239
|
+
dark: {
|
|
240
|
+
'text-default': '#FFFFFF',
|
|
241
|
+
'text-secondary': colors.slate[400],
|
|
242
|
+
'text-hint': colors.slate[500],
|
|
243
|
+
'text-disabled': colors.slate[600],
|
|
244
|
+
'border': chroma(colors.slate[100]).alpha(0.12).css(),
|
|
245
|
+
'divider': chroma(colors.slate[100]).alpha(0.12).css(),
|
|
246
|
+
'icon': colors.slate[400],
|
|
247
|
+
'mat-icon': colors.slate[400]
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
);
|
|
256
|
+
|
|
257
|
+
module.exports = theming;
|
|
@@ -9,49 +9,36 @@ module.exports = plugin(({
|
|
|
9
9
|
* be defined before pretty much everything else.
|
|
10
10
|
*/
|
|
11
11
|
addComponents(
|
|
12
|
-
{
|
|
13
|
-
'.mat-icon': {
|
|
14
|
-
'--tw-text-opacity': '1',
|
|
15
|
-
color: 'rgba(var(--cmat-icon-rgb), var(--tw-text-opacity))'
|
|
16
|
-
},
|
|
12
|
+
{
|
|
17
13
|
'.text-default': {
|
|
18
|
-
'--
|
|
19
|
-
color: 'rgba(var(--cmat-text-default-rgb), var(--tw-text-opacity)) !important'
|
|
14
|
+
color: 'rgba(var(--cmat-text-default-rgb), 1)'
|
|
20
15
|
},
|
|
21
16
|
'.text-secondary': {
|
|
22
|
-
'--
|
|
23
|
-
color: 'rgba(var(--cmat-text-secondary-rgb), var(--tw-text-opacity)) !important'
|
|
17
|
+
color: 'rgba(var(--cmat-text-secondary-rgb), 1)'
|
|
24
18
|
},
|
|
25
19
|
'.text-hint': {
|
|
26
|
-
'--
|
|
27
|
-
color: 'rgba(var(--cmat-text-hint-rgb), var(--tw-text-opacity)) !important'
|
|
20
|
+
color: 'rgba(var(--cmat-text-hint-rgb), 1)'
|
|
28
21
|
},
|
|
29
22
|
'.text-disabled': {
|
|
30
|
-
'--
|
|
31
|
-
color: 'rgba(var(--cmat-text-disabled-rgb), var(--tw-text-opacity)) !important'
|
|
23
|
+
color: 'rgba(var(--cmat-text-disabled-rgb), 1)'
|
|
32
24
|
},
|
|
33
25
|
'.divider': {
|
|
34
|
-
color: 'var(--cmat-divider)
|
|
26
|
+
color: 'var(--cmat-divider)'
|
|
35
27
|
},
|
|
36
28
|
'.bg-card': {
|
|
37
|
-
'--
|
|
38
|
-
backgroundColor: 'rgba(var(--cmat-bg-card-rgb), var(--tw-bg-opacity)) !important'
|
|
29
|
+
backgroundColor: 'rgba(var(--cmat-bg-card-rgb), 1)'
|
|
39
30
|
},
|
|
40
31
|
'.bg-default': {
|
|
41
|
-
'--
|
|
42
|
-
backgroundColor: 'rgba(var(--cmat-bg-default-rgb), var(--tw-bg-opacity)) !important'
|
|
32
|
+
backgroundColor: 'rgba(var(--cmat-bg-default-rgb), 1)'
|
|
43
33
|
},
|
|
44
34
|
'.bg-dialog': {
|
|
45
|
-
'--
|
|
46
|
-
backgroundColor: 'rgba(var(--cmat-bg-dialog-rgb), var(--tw-bg-opacity)) !important'
|
|
35
|
+
backgroundColor: 'rgba(var(--cmat-bg-dialog-rgb), 1)'
|
|
47
36
|
},
|
|
48
37
|
'.ring-bg-default': {
|
|
49
|
-
'--tw-ring-
|
|
50
|
-
'--tw-ring-color': 'rgba(var(--cmat-bg-default-rgb), var(--tw-ring-opacity)) !important'
|
|
38
|
+
'--tw-ring-color': 'rgba(var(--cmat-bg-default-rgb), 1)'
|
|
51
39
|
},
|
|
52
40
|
'.ring-bg-card': {
|
|
53
|
-
'--tw-ring-
|
|
54
|
-
'--tw-ring-color': 'rgba(var(--cmat-bg-card-rgb), var(--tw-ring-opacity)) !important'
|
|
41
|
+
'--tw-ring-color': 'rgba(var(--cmat-bg-card-rgb), 1)'
|
|
55
42
|
}
|
|
56
43
|
}
|
|
57
44
|
);
|
|
@@ -59,7 +46,7 @@ module.exports = plugin(({
|
|
|
59
46
|
addComponents(
|
|
60
47
|
{
|
|
61
48
|
'.bg-hover': {
|
|
62
|
-
backgroundColor: 'var(--cmat-bg-hover)
|
|
49
|
+
backgroundColor: 'var(--cmat-bg-hover)'
|
|
63
50
|
}
|
|
64
51
|
}
|
|
65
52
|
);
|