unocss-preset-quasar 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/colors.unocss.js +1 -1
- package/dist/core/index.js +2 -1
- package/dist/core/shape.unocss.js +11 -0
- package/dist/index.js +2 -4
- package/dist/styles/md2/components/QBtn.unocss.js +2 -2
- package/dist/styles/md2/components/QItem.unocss.js +1 -1
- package/dist/styles/md3/components/QBtn.unocss.js +4 -4
- package/dist/styles/md3/components/QCard.unocss.js +1 -1
- package/dist/styles/md3/components/QChip.unocss.js +3 -3
- package/dist/styles/md3/components/QDrawer.unocss.js +1 -2
- package/dist/styles/md3/components/QItem.unocss.js +1 -1
- package/dist/styles/md3/components/QTabs.unocss.js +1 -1
- package/dist/styles/md3/components/QTime.unocss.js +1 -1
- package/dist/theme.js +8 -1
- package/dist/types/core/shape.unocss.d.ts +4 -0
- package/dist/types/theme.d.ts +8 -1
- package/package.json +9 -9
- package/src/core/colors.unocss.ts +1 -1
- package/src/core/index.ts +3 -1
- package/src/core/shape.unocss.ts +15 -0
- package/src/index.ts +2 -5
- package/src/styles/md2/components/QBtn.unocss.ts +2 -2
- package/src/styles/md2/components/QItem.unocss.ts +1 -1
- package/src/styles/md3/components/QBtn.unocss.ts +4 -4
- package/src/styles/md3/components/QCard.unocss.ts +1 -1
- package/src/styles/md3/components/QChip.unocss.ts +3 -3
- package/src/styles/md3/components/QDrawer.unocss.ts +1 -2
- package/src/styles/md3/components/QItem.unocss.ts +1 -1
- package/src/styles/md3/components/QTabs.unocss.ts +1 -1
- package/src/styles/md3/components/QTime.unocss.ts +1 -1
- package/src/theme.ts +15 -1
|
@@ -9,7 +9,7 @@ const preflights = [
|
|
|
9
9
|
--q-negative: ${theme.colors.negative};
|
|
10
10
|
--q-info: ${theme.colors.info};
|
|
11
11
|
--q-warning: ${theme.colors.warning};
|
|
12
|
-
--q-dark: ${theme.colors.dark};
|
|
12
|
+
--q-dark: ${theme.colors.dark.primary};
|
|
13
13
|
--q-dark-page: ${theme.colors['dark-page']};
|
|
14
14
|
--light-primary: ${theme.colors.light.primary};
|
|
15
15
|
--light-on-primary: ${theme.colors.light.onPrimary};
|
package/dist/core/index.js
CHANGED
|
@@ -11,6 +11,7 @@ import { shortcuts as TouchShortcuts } from './touch.unocss.js';
|
|
|
11
11
|
import { preflights as TransitionPreflights, shortcuts as TransitionsShortcuts } from './transitions.unocss.js';
|
|
12
12
|
import { preflights as TypographyPreflights, shortcuts as TypographyShortcuts } from './typography.unocss.js';
|
|
13
13
|
import { rules as VisibilityRules, preflights as VisibilityPreflights, shortcuts as VisibilityShortcuts } from './visibility.unocss.js';
|
|
14
|
+
import { preflights as ShapePreflights } from './shape.unocss.js';
|
|
14
15
|
export const preflights = [
|
|
15
16
|
{
|
|
16
17
|
getCSS: ({ theme }) => `/* beasties:include start */
|
|
@@ -296,6 +297,6 @@ body {
|
|
|
296
297
|
|
|
297
298
|
/* beasties:include end */`
|
|
298
299
|
}
|
|
299
|
-
].concat(ColorPreflights, DarkPreflights, HelperPreflights, MousePreflights, TypographyPreflights, VisibilityPreflights, TransitionPreflights, SizePreflights);
|
|
300
|
+
].concat(ColorPreflights, DarkPreflights, HelperPreflights, MousePreflights, TypographyPreflights, VisibilityPreflights, TransitionPreflights, SizePreflights, ShapePreflights);
|
|
300
301
|
export const rules = [].concat(MouseRules, HelperRules, ElevationRules, VisibilityRules);
|
|
301
302
|
export const shortcuts = [].concat(ColorShortcuts, DarkShortcuts, FlexShortcuts, HelperShortcuts, MouseShortcuts, OrientationShortcuts, PositionShortcuts, SizeShortcuts, TouchShortcuts, TransitionsShortcuts, TypographyShortcuts, VisibilityShortcuts, ElevationShortcuts);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const preflights = [
|
|
2
|
+
{
|
|
3
|
+
getCSS: ({ theme }) => `
|
|
4
|
+
:root {
|
|
5
|
+
--shape-corner-small: ${theme.shape.corner.small};
|
|
6
|
+
--shape-corner-medium: ${theme.shape.corner.medium};
|
|
7
|
+
--shape-corner-large: ${theme.shape.corner.large};
|
|
8
|
+
}`
|
|
9
|
+
}
|
|
10
|
+
];
|
|
11
|
+
export { preflights };
|
package/dist/index.js
CHANGED
|
@@ -841,7 +841,8 @@ const componentsSafelistMap = {
|
|
|
841
841
|
'q-toggle--dark',
|
|
842
842
|
'q-toggle--dense'
|
|
843
843
|
],
|
|
844
|
-
QToolbar: ['q-toolbar', 'q-toolbar--inset'
|
|
844
|
+
QToolbar: ['q-toolbar', 'q-toolbar--inset'],
|
|
845
|
+
QToolbarTitle: ['q-toolbar__title'],
|
|
845
846
|
QTooltip: ['q-tooltip--style', 'q-tooltip'],
|
|
846
847
|
QTree: [
|
|
847
848
|
'q-tree',
|
|
@@ -1500,9 +1501,6 @@ const generateSafelist = ({ plugins, iconSet }) => {
|
|
|
1500
1501
|
return safelist;
|
|
1501
1502
|
};
|
|
1502
1503
|
export const QuasarPreset = definePreset((options) => {
|
|
1503
|
-
if (!options.sourceColor) {
|
|
1504
|
-
options.sourceColor = '#806cb0';
|
|
1505
|
-
}
|
|
1506
1504
|
const style = options.style;
|
|
1507
1505
|
const theme = generateTheme(options.sourceColor);
|
|
1508
1506
|
return [
|
|
@@ -2,12 +2,12 @@ const shortcuts = [
|
|
|
2
2
|
[
|
|
3
3
|
/^q-btn$/,
|
|
4
4
|
([, c], { theme }) => theme.quasar?.components?.['q-btn'] ??
|
|
5
|
-
`inline-flex flex-col font-medium items-stretch relative outline-0 border-0 align-middle text-[14px] leading-[1.715em] no-underline [color:inherit] bg-transparent font-medium text-center w-auto min-h-40px cursor-default px-[16px] py-[4px] min-h-[2.572em] [&_.q-icon]:(text-[1.715em]) [&_.q-spinner]:(text-[1.715em]) [&.disabled]:(!opacity-70) [&:before]:(content-empty block absolute left-[0] right-[0] top-[0] bottom-[0] [border-radius:inherit]
|
|
5
|
+
`inline-flex flex-col font-medium items-stretch relative outline-0 border-0 align-middle text-[14px] leading-[1.715em] no-underline [color:inherit] bg-transparent font-medium text-center w-auto min-h-40px cursor-default px-[16px] py-[4px] min-h-[2.572em] [&_.q-icon]:(text-[1.715em]) [&_.q-spinner]:(text-[1.715em]) [&.disabled]:(!opacity-70) [&:before]:(content-empty block absolute left-[0] right-[0] top-[0] bottom-[0] [border-radius:inherit] shadow-md shadow-gray/14)`
|
|
6
6
|
],
|
|
7
7
|
[
|
|
8
8
|
/^q-btn--actionable$/,
|
|
9
9
|
([, c], { theme }) => theme.quasar?.components?.['q-btn--actionable'] ??
|
|
10
|
-
`cursor-pointer [&.q-btn--standard:before]:([transition:box-shadow_0.3s_cubic-bezier(0.25,_0.8,_0.5,_1)]) [&.q-btn--standard:active:before]:([box-shadow:0_3px_5px_-1px_rgba(0,_0,_0,_0.2),_0_5px_8px_rgba(0,_0,_0,_0.14),_0_1px_14px_rgba(0,_0,_0,_0.12)]) [&.q-btn--standard.q-btn--active:before]:([
|
|
10
|
+
`cursor-pointer [&.q-btn--standard:before]:([transition:box-shadow_0.3s_cubic-bezier(0.25,_0.8,_0.5,_1)]) [&.q-btn--standard:active:before]:([box-shadow:0_3px_5px_-1px_rgba(0,_0,_0,_0.2),_0_5px_8px_rgba(0,_0,_0,_0.14),_0_1px_14px_rgba(0,_0,_0,_0.12)]) [&.q-btn--standard.q-btn--active:before]:([shadow-lg shadow-gray/14)`
|
|
11
11
|
],
|
|
12
12
|
[/^q-btn--no-uppercase$/, ([, c], { theme }) => `normal-case`],
|
|
13
13
|
[/^q-btn--rectangle$/, ([, c], { theme }) => `rounded-[3px]`],
|
|
@@ -8,7 +8,7 @@ const shortcuts = [
|
|
|
8
8
|
[
|
|
9
9
|
/^q-item__section--side$/,
|
|
10
10
|
([, c], { theme }) => theme.quasar?.components?.['q-item__section--side'] ??
|
|
11
|
-
`!flex-initial text-[#757575] items-start pr-[16px] w-auto
|
|
11
|
+
`!flex-initial text-[#757575] items-start pr-[16px] w-auto [&_>_.q-icon]:(text-[24px]) [&_>_.q-avatar]:(text-[40px])`
|
|
12
12
|
],
|
|
13
13
|
[
|
|
14
14
|
/^q-item__section--avatar$/,
|
|
@@ -2,12 +2,12 @@ const shortcuts = [
|
|
|
2
2
|
[
|
|
3
3
|
/^q-btn$/,
|
|
4
4
|
([, c], { theme }) => theme.quasar?.components?.['q-btn'] ??
|
|
5
|
-
`layer-components:bg-$light-primary dark:bg-$dark-primary layer-components:text-$light-on-primary layer-components:dark:text-$dark-on-primary inline-flex flex-col font-medium items-stretch relative outline-0 border-0 align-middle text-[14px] leading-[1.715em] no-underline font-medium text-center w-auto min-h-40px cursor-default px-[16px] py-[4px] min-h-[2.572em] [&_.q-icon]:(text-[1.715em]) [&_.q-spinner]:(text-[1.715em]) [&.disabled]:(!opacity-70) [&:before]:(content-empty block absolute left-[0] right-[0] top-[0] bottom-[0] [border-radius:inherit]
|
|
5
|
+
`layer-components:bg-$light-primary dark:bg-$dark-primary layer-components:text-$light-on-primary layer-components:dark:text-$dark-on-primary inline-flex flex-col font-medium items-stretch relative outline-0 border-0 align-middle text-[14px] leading-[1.715em] no-underline font-medium text-center w-auto min-h-40px cursor-default px-[16px] py-[4px] min-h-[2.572em] [&_.q-icon]:(text-[1.715em]) [&_.q-spinner]:(text-[1.715em]) [&.disabled]:(!opacity-70) [&:before]:(content-empty block absolute left-[0] right-[0] top-[0] bottom-[0] [border-radius:inherit] shadow-md shadow-gray/14)`
|
|
6
6
|
],
|
|
7
7
|
[
|
|
8
8
|
/^q-btn--actionable$/,
|
|
9
9
|
([, c], { theme }) => theme.quasar?.components?.['q-btn--actionable'] ??
|
|
10
|
-
`cursor-pointer [&.q-btn--standard:before]:([transition:box-shadow_0.3s_cubic-bezier(0.25,_0.8,_0.5,_1)]) [&.q-btn--standard:active:before]:([box-shadow:0_3px_5px_-1px_rgba(0,_0,_0,_0.2),_0_5px_8px_rgba(0,_0,_0,_0.14),_0_1px_14px_rgba(0,_0,_0,_0.12)]) [&.q-btn--standard.q-btn--active:before]:(
|
|
10
|
+
`cursor-pointer [&.q-btn--standard:before]:([transition:box-shadow_0.3s_cubic-bezier(0.25,_0.8,_0.5,_1)]) [&.q-btn--standard:active:before]:([box-shadow:0_3px_5px_-1px_rgba(0,_0,_0,_0.2),_0_5px_8px_rgba(0,_0,_0,_0.14),_0_1px_14px_rgba(0,_0,_0,_0.12)]) [&.q-btn--standard.q-btn--active:before]:(shadow-lg shadow-gray/14)`
|
|
11
11
|
],
|
|
12
12
|
[/^q-btn--no-uppercase$/, ([, c], { theme }) => `normal-case`],
|
|
13
13
|
[/^q-btn--rectangle$/, ([, c], { theme }) => `rounded-[3px]`],
|
|
@@ -52,7 +52,7 @@ const shortcuts = [
|
|
|
52
52
|
/^q-btn--fab$/,
|
|
53
53
|
([, c], { theme }) => theme.quasar?.components?.['q-btn--fab'] ??
|
|
54
54
|
`layer-components:bg-$light-primary-container layer-components:dark:bg-$dark-primary-container layer-components:text-$light-on-surface layer-components:dark:text-$dark-on-surface
|
|
55
|
-
w-56px h-56px !rounded-
|
|
55
|
+
w-56px h-56px !rounded-$shape-corner-large
|
|
56
56
|
z-${theme.quasar.z.fab}
|
|
57
57
|
[&_.q-icon]:(text-[24px]) [&_.q-icon]:(m-auto)`
|
|
58
58
|
// min-h-[56px] min-w-[56px] p-[16px] pb-0
|
|
@@ -61,7 +61,7 @@ const shortcuts = [
|
|
|
61
61
|
/^q-btn--fab-mini$/,
|
|
62
62
|
([, c], { theme }) => theme.quasar?.components?.['q-btn--fab-mini'] ??
|
|
63
63
|
`layer-components:bg-$light-primary-container layer-components:dark:bg-$dark-primary-container layer-components:text-$light-on-surface layer-components:dark:text-$dark-on-surface
|
|
64
|
-
w-40px h-40px !rounded-
|
|
64
|
+
w-40px h-40px !rounded-$shape-corner-large
|
|
65
65
|
[&_.q-icon]:(text-[24px])`
|
|
66
66
|
// min-h-[40px] min-w-[40px]
|
|
67
67
|
],
|
|
@@ -2,7 +2,7 @@ const shortcuts = [
|
|
|
2
2
|
[
|
|
3
3
|
/^q-card$/,
|
|
4
4
|
([, c], { theme }) => theme.quasar?.components?.['q-card'] ??
|
|
5
|
-
`p-16px rounded-
|
|
5
|
+
`p-16px rounded-$shape-corner-medium align-top relative bg-$light-surface-container-low dark:bg-$dark-surface-container-low
|
|
6
6
|
[&_>_div:not(.q--avoid-card-border)]:(rounded-tl-none rounded-tr-none rounded-bl-none rounded-br-none)
|
|
7
7
|
[&_>_img:not(.q--avoid-card-border)]:(rounded-tl-none rounded-tr-none rounded-bl-none rounded-br-none)
|
|
8
8
|
[&_>_div:nth-child(1_of_:not(.q--avoid-card-border))]:([border-top:0] [border-top-left-radius:inherit] [border-top-right-radius:inherit])
|
|
@@ -19,7 +19,7 @@ const shortcuts = [
|
|
|
19
19
|
bg-$light-surface-container-low dark:bg-$dark-secondary-container
|
|
20
20
|
text-$light-on-surface-variant dark:text-$dark-on-secondary-container
|
|
21
21
|
text-[14px] px-[1em] py-[0.375em]
|
|
22
|
-
[&_.q-avatar]:(text-[2em] -ml-[0.45em] mr-[0.2em] rounded-
|
|
22
|
+
[&_.q-avatar]:(text-[2em] -ml-[0.45em] mr-[0.2em] rounded-$shape-corner-large)`
|
|
23
23
|
],
|
|
24
24
|
[
|
|
25
25
|
/^q-chip--colored$/,
|
|
@@ -66,12 +66,12 @@ const shortcuts = [
|
|
|
66
66
|
[
|
|
67
67
|
/^q-chip--dense$/,
|
|
68
68
|
([, c], { theme }) => theme.quasar?.components?.['q-chip--dense'] ??
|
|
69
|
-
`rounded-
|
|
69
|
+
`rounded-$shape-corner-medium px-[0.4em] py-[0] h-[1.5em] [&_.q-avatar]:(text-[1.5em] -ml-[0.27em] mr-[0.1em] rounded-$shape-corner-medium) [&_.q-chip\\_\\_icon]:(text-[1.25em]) [&_.q-chip\\_\\_icon--left]:(mr-[0.195em]) [&_.q-chip\\_\\_icon--remove]:(-mr-[0.25em])`
|
|
70
70
|
],
|
|
71
71
|
[
|
|
72
72
|
/^q-chip--square$/,
|
|
73
73
|
([, c], { theme }) => theme.quasar?.components?.['q-chip--square'] ??
|
|
74
|
-
`rounded-
|
|
74
|
+
`rounded-$shape-corner-small [&_.q-avatar]:(rounded-tl-[3px] rounded-br-[0] rounded-tr-[0] rounded-bl-[3px])`
|
|
75
75
|
]
|
|
76
76
|
];
|
|
77
77
|
export { preflights, shortcuts };
|
|
@@ -2,7 +2,7 @@ const shortcuts = [
|
|
|
2
2
|
[
|
|
3
3
|
/^q-drawer$/,
|
|
4
4
|
([, c], { theme }) => theme.quasar?.components?.['q-drawer'] ??
|
|
5
|
-
`
|
|
5
|
+
`rounded-$shape-corner-large absolute top-[0] bottom-[0] bg-$light-surface-container-low dark:bg-$dark-surface-container-low z-${theme.quasar.z['side']}`
|
|
6
6
|
],
|
|
7
7
|
[
|
|
8
8
|
/^q-drawer--on-top$/,
|
|
@@ -71,7 +71,6 @@ const shortcuts = [
|
|
|
71
71
|
[&_>_.q-scrollarea]:(px-0)
|
|
72
72
|
[&_>_.q-list]:(px-12px)
|
|
73
73
|
[&_.q-list_.q-item]:(border-rd-32px)
|
|
74
|
-
[&_.q-list_.q-item:hover]:(bg-$light-on-secondary-container/8 dark:bg-$dark-on-secondary-container/8)
|
|
75
74
|
[&_.q-list_>_.q-router-link--active]:(text-$light-primary dark:text-$dark-primary)
|
|
76
75
|
[&_.q-list_.q-router-link--active]:(bg-$light-secondary-container dark:bg-$dark-secondary-container)
|
|
77
76
|
`
|
|
@@ -8,7 +8,7 @@ const shortcuts = [
|
|
|
8
8
|
[
|
|
9
9
|
/^q-item__section--side$/,
|
|
10
10
|
([, c], { theme }) => theme.quasar?.components?.['q-item__section--side'] ??
|
|
11
|
-
`!flex-initial text-[#757575] items-start pr-[16px] w-auto
|
|
11
|
+
`!flex-initial text-[#757575] items-start pr-[16px] w-auto [&_>_.q-icon]:(text-[24px]) [&_>_.q-avatar]:(text-[40px])`
|
|
12
12
|
],
|
|
13
13
|
[
|
|
14
14
|
/^q-item__section--avatar$/,
|
|
@@ -4,7 +4,7 @@ const shortcuts = [
|
|
|
4
4
|
([, c], { theme }) => theme.quasar?.components?.['q-tab'] ??
|
|
5
5
|
`px-[16px] py-[0] min-h-[48px] [transition:color_0.3s,_background-color_0.3s] whitespace-nowrap [color:inherit] no-underline
|
|
6
6
|
[&_.q-badge]:(top-[3px] -right-[12px])
|
|
7
|
-
[&_>_.q-focus-helper]:(!absolute !h-32px !w-52px !top-[calc(50%-23px)] !left-[calc(50%-26px)] !
|
|
7
|
+
[&_>_.q-focus-helper]:(!absolute !h-32px !w-52px !top-[calc(50%-23px)] !left-[calc(50%-26px)] !rounded-$shape-corner-large)
|
|
8
8
|
`
|
|
9
9
|
],
|
|
10
10
|
[
|
|
@@ -23,7 +23,7 @@ const shortcuts = [
|
|
|
23
23
|
[
|
|
24
24
|
/^q-time__header-label$/,
|
|
25
25
|
([, c], { theme }) => theme.quasar?.components?.['q-time__header-label'] ??
|
|
26
|
-
`text-[48px]
|
|
26
|
+
`text-[48px] rounded-$shape-corner-small
|
|
27
27
|
leading-none tracking-[-0.00833em] [&_>_div_+_div]:(ml-[4px]) !flex-initial`
|
|
28
28
|
],
|
|
29
29
|
[
|
package/dist/theme.js
CHANGED
|
@@ -10,6 +10,13 @@ const defaultTheme = {
|
|
|
10
10
|
lg: '1440px',
|
|
11
11
|
xl: '1920px'
|
|
12
12
|
},
|
|
13
|
+
shape: {
|
|
14
|
+
corner: {
|
|
15
|
+
small: '8px',
|
|
16
|
+
medium: '12px',
|
|
17
|
+
large: '16px'
|
|
18
|
+
}
|
|
19
|
+
},
|
|
13
20
|
colors: {
|
|
14
21
|
light: {
|
|
15
22
|
primary: '#684fa4',
|
|
@@ -409,7 +416,7 @@ const defaultTheme = {
|
|
|
409
416
|
}
|
|
410
417
|
}
|
|
411
418
|
};
|
|
412
|
-
const generateTheme = (sourceColor) => {
|
|
419
|
+
const generateTheme = (sourceColor = '#806cb0') => {
|
|
413
420
|
const materialTheme = themeFromSourceColor(argbFromHex(sourceColor));
|
|
414
421
|
return {
|
|
415
422
|
...defaultTheme,
|
package/dist/types/theme.d.ts
CHANGED
|
@@ -47,6 +47,13 @@ export interface QuasarTheme {
|
|
|
47
47
|
lg: string;
|
|
48
48
|
xl: string;
|
|
49
49
|
};
|
|
50
|
+
shape: {
|
|
51
|
+
corner: {
|
|
52
|
+
small: string;
|
|
53
|
+
medium: string;
|
|
54
|
+
large: string;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
50
57
|
colors: {
|
|
51
58
|
light: MaterialColorScheme;
|
|
52
59
|
dark: MaterialColorScheme;
|
|
@@ -1192,7 +1199,7 @@ export interface QuasarTheme {
|
|
|
1192
1199
|
};
|
|
1193
1200
|
}
|
|
1194
1201
|
declare const defaultTheme: QuasarTheme;
|
|
1195
|
-
declare const generateTheme: (sourceColor
|
|
1202
|
+
declare const generateTheme: (sourceColor?: string) => QuasarTheme;
|
|
1196
1203
|
/**
|
|
1197
1204
|
* Do not use on server.
|
|
1198
1205
|
* @param theme unocss-preset-quasar theme
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "unocss-preset-quasar",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Stefan van Herwijnen",
|
|
6
6
|
"description": "UnoCSS preset for Quasar Framework",
|
|
@@ -34,21 +34,21 @@
|
|
|
34
34
|
"homepage": "https://github.com/simsustech/unocss-preset-quasar/tree/main/#readme",
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@material/material-color-utilities": "^0.3.0",
|
|
37
|
-
"@unocss/core": "^66.
|
|
38
|
-
"@unocss/preset-uno": "^66.
|
|
39
|
-
"@unocss/preset-web-fonts": "66.1.
|
|
40
|
-
"@unocss/preset-wind": "^66.
|
|
37
|
+
"@unocss/core": "^66.1.1",
|
|
38
|
+
"@unocss/preset-uno": "^66.1.1",
|
|
39
|
+
"@unocss/preset-web-fonts": "66.1.1",
|
|
40
|
+
"@unocss/preset-wind": "^66.1.1",
|
|
41
41
|
"animated-unocss": "^0.0.6",
|
|
42
|
-
"unocss": "66.1.
|
|
42
|
+
"unocss": "66.1.1"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@iconify-json/mdi": "^1.2.3",
|
|
46
46
|
"@quasar/extras": "^1.16.17",
|
|
47
47
|
"@quasar/quasar-ui-qmarkdown": "^2.0.5",
|
|
48
48
|
"@quasar/quasar-ui-qmediaplayer": "^2.0.0-beta.0",
|
|
49
|
-
"@types/node": "^22.
|
|
50
|
-
"@unocss/preset-icons": "^66.
|
|
51
|
-
"@unocss/preset-mini": "66.1.
|
|
49
|
+
"@types/node": "^22.15.17",
|
|
50
|
+
"@unocss/preset-icons": "^66.1.1",
|
|
51
|
+
"@unocss/preset-mini": "66.1.1",
|
|
52
52
|
"quasar": "^2.18.1",
|
|
53
53
|
"typescript": "^5.8.3"
|
|
54
54
|
},
|
|
@@ -12,7 +12,7 @@ const preflights: Preflight<QuasarTheme>[] = [
|
|
|
12
12
|
--q-negative: ${theme.colors.negative};
|
|
13
13
|
--q-info: ${theme.colors.info};
|
|
14
14
|
--q-warning: ${theme.colors.warning};
|
|
15
|
-
--q-dark: ${theme.colors.dark};
|
|
15
|
+
--q-dark: ${theme.colors.dark.primary};
|
|
16
16
|
--q-dark-page: ${theme.colors['dark-page']};
|
|
17
17
|
--light-primary: ${theme.colors.light.primary};
|
|
18
18
|
--light-on-primary: ${theme.colors.light.onPrimary};
|
package/src/core/index.ts
CHANGED
|
@@ -43,6 +43,7 @@ import {
|
|
|
43
43
|
preflights as VisibilityPreflights,
|
|
44
44
|
shortcuts as VisibilityShortcuts
|
|
45
45
|
} from './visibility.unocss.js'
|
|
46
|
+
import { preflights as ShapePreflights } from './shape.unocss.js'
|
|
46
47
|
|
|
47
48
|
export const preflights: Preflight<QuasarTheme>[] = (
|
|
48
49
|
[
|
|
@@ -339,7 +340,8 @@ body {
|
|
|
339
340
|
TypographyPreflights,
|
|
340
341
|
VisibilityPreflights,
|
|
341
342
|
TransitionPreflights,
|
|
342
|
-
SizePreflights
|
|
343
|
+
SizePreflights,
|
|
344
|
+
ShapePreflights
|
|
343
345
|
)
|
|
344
346
|
|
|
345
347
|
export const rules = ([] as Rule<QuasarTheme>[]).concat(
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type Preflight } from '@unocss/core'
|
|
2
|
+
import { type QuasarTheme } from '../theme.js'
|
|
3
|
+
|
|
4
|
+
const preflights: Preflight<QuasarTheme>[] = [
|
|
5
|
+
{
|
|
6
|
+
getCSS: ({ theme }) => `
|
|
7
|
+
:root {
|
|
8
|
+
--shape-corner-small: ${theme.shape.corner.small};
|
|
9
|
+
--shape-corner-medium: ${theme.shape.corner.medium};
|
|
10
|
+
--shape-corner-large: ${theme.shape.corner.large};
|
|
11
|
+
}`
|
|
12
|
+
}
|
|
13
|
+
]
|
|
14
|
+
|
|
15
|
+
export { preflights }
|
package/src/index.ts
CHANGED
|
@@ -877,7 +877,8 @@ const componentsSafelistMap: Partial<Record<keyof QuasarComponents, string[]>> =
|
|
|
877
877
|
'q-toggle--dark',
|
|
878
878
|
'q-toggle--dense'
|
|
879
879
|
],
|
|
880
|
-
QToolbar: ['q-toolbar', 'q-toolbar--inset'
|
|
880
|
+
QToolbar: ['q-toolbar', 'q-toolbar--inset'],
|
|
881
|
+
QToolbarTitle: ['q-toolbar__title'],
|
|
881
882
|
QTooltip: ['q-tooltip--style', 'q-tooltip'],
|
|
882
883
|
QTree: [
|
|
883
884
|
'q-tree',
|
|
@@ -1545,10 +1546,6 @@ const generateSafelist = ({
|
|
|
1545
1546
|
}
|
|
1546
1547
|
|
|
1547
1548
|
export const QuasarPreset = definePreset((options: QuasarPresetOptions) => {
|
|
1548
|
-
if (!options.sourceColor) {
|
|
1549
|
-
options.sourceColor = '#806cb0'
|
|
1550
|
-
}
|
|
1551
|
-
|
|
1552
1549
|
const style = options.style
|
|
1553
1550
|
const theme = generateTheme(options.sourceColor)
|
|
1554
1551
|
|
|
@@ -6,13 +6,13 @@ const shortcuts: UserShortcuts<QuasarTheme> = [
|
|
|
6
6
|
/^q-btn$/,
|
|
7
7
|
([, c], { theme }) =>
|
|
8
8
|
theme.quasar?.components?.['q-btn'] ??
|
|
9
|
-
`inline-flex flex-col font-medium items-stretch relative outline-0 border-0 align-middle text-[14px] leading-[1.715em] no-underline [color:inherit] bg-transparent font-medium text-center w-auto min-h-40px cursor-default px-[16px] py-[4px] min-h-[2.572em] [&_.q-icon]:(text-[1.715em]) [&_.q-spinner]:(text-[1.715em]) [&.disabled]:(!opacity-70) [&:before]:(content-empty block absolute left-[0] right-[0] top-[0] bottom-[0] [border-radius:inherit]
|
|
9
|
+
`inline-flex flex-col font-medium items-stretch relative outline-0 border-0 align-middle text-[14px] leading-[1.715em] no-underline [color:inherit] bg-transparent font-medium text-center w-auto min-h-40px cursor-default px-[16px] py-[4px] min-h-[2.572em] [&_.q-icon]:(text-[1.715em]) [&_.q-spinner]:(text-[1.715em]) [&.disabled]:(!opacity-70) [&:before]:(content-empty block absolute left-[0] right-[0] top-[0] bottom-[0] [border-radius:inherit] shadow-md shadow-gray/14)`
|
|
10
10
|
],
|
|
11
11
|
[
|
|
12
12
|
/^q-btn--actionable$/,
|
|
13
13
|
([, c], { theme }) =>
|
|
14
14
|
theme.quasar?.components?.['q-btn--actionable'] ??
|
|
15
|
-
`cursor-pointer [&.q-btn--standard:before]:([transition:box-shadow_0.3s_cubic-bezier(0.25,_0.8,_0.5,_1)]) [&.q-btn--standard:active:before]:([box-shadow:0_3px_5px_-1px_rgba(0,_0,_0,_0.2),_0_5px_8px_rgba(0,_0,_0,_0.14),_0_1px_14px_rgba(0,_0,_0,_0.12)]) [&.q-btn--standard.q-btn--active:before]:([
|
|
15
|
+
`cursor-pointer [&.q-btn--standard:before]:([transition:box-shadow_0.3s_cubic-bezier(0.25,_0.8,_0.5,_1)]) [&.q-btn--standard:active:before]:([box-shadow:0_3px_5px_-1px_rgba(0,_0,_0,_0.2),_0_5px_8px_rgba(0,_0,_0,_0.14),_0_1px_14px_rgba(0,_0,_0,_0.12)]) [&.q-btn--standard.q-btn--active:before]:([shadow-lg shadow-gray/14)`
|
|
16
16
|
],
|
|
17
17
|
|
|
18
18
|
[/^q-btn--no-uppercase$/, ([, c], { theme }) => `normal-case`],
|
|
@@ -14,7 +14,7 @@ const shortcuts: UserShortcuts<QuasarTheme> = [
|
|
|
14
14
|
/^q-item__section--side$/,
|
|
15
15
|
([, c], { theme }) =>
|
|
16
16
|
theme.quasar?.components?.['q-item__section--side'] ??
|
|
17
|
-
`!flex-initial text-[#757575] items-start pr-[16px] w-auto
|
|
17
|
+
`!flex-initial text-[#757575] items-start pr-[16px] w-auto [&_>_.q-icon]:(text-[24px]) [&_>_.q-avatar]:(text-[40px])`
|
|
18
18
|
],
|
|
19
19
|
|
|
20
20
|
[
|
|
@@ -6,13 +6,13 @@ const shortcuts: UserShortcuts<QuasarTheme> = [
|
|
|
6
6
|
/^q-btn$/,
|
|
7
7
|
([, c], { theme }) =>
|
|
8
8
|
theme.quasar?.components?.['q-btn'] ??
|
|
9
|
-
`layer-components:bg-$light-primary dark:bg-$dark-primary layer-components:text-$light-on-primary layer-components:dark:text-$dark-on-primary inline-flex flex-col font-medium items-stretch relative outline-0 border-0 align-middle text-[14px] leading-[1.715em] no-underline font-medium text-center w-auto min-h-40px cursor-default px-[16px] py-[4px] min-h-[2.572em] [&_.q-icon]:(text-[1.715em]) [&_.q-spinner]:(text-[1.715em]) [&.disabled]:(!opacity-70) [&:before]:(content-empty block absolute left-[0] right-[0] top-[0] bottom-[0] [border-radius:inherit]
|
|
9
|
+
`layer-components:bg-$light-primary dark:bg-$dark-primary layer-components:text-$light-on-primary layer-components:dark:text-$dark-on-primary inline-flex flex-col font-medium items-stretch relative outline-0 border-0 align-middle text-[14px] leading-[1.715em] no-underline font-medium text-center w-auto min-h-40px cursor-default px-[16px] py-[4px] min-h-[2.572em] [&_.q-icon]:(text-[1.715em]) [&_.q-spinner]:(text-[1.715em]) [&.disabled]:(!opacity-70) [&:before]:(content-empty block absolute left-[0] right-[0] top-[0] bottom-[0] [border-radius:inherit] shadow-md shadow-gray/14)`
|
|
10
10
|
],
|
|
11
11
|
[
|
|
12
12
|
/^q-btn--actionable$/,
|
|
13
13
|
([, c], { theme }) =>
|
|
14
14
|
theme.quasar?.components?.['q-btn--actionable'] ??
|
|
15
|
-
`cursor-pointer [&.q-btn--standard:before]:([transition:box-shadow_0.3s_cubic-bezier(0.25,_0.8,_0.5,_1)]) [&.q-btn--standard:active:before]:([box-shadow:0_3px_5px_-1px_rgba(0,_0,_0,_0.2),_0_5px_8px_rgba(0,_0,_0,_0.14),_0_1px_14px_rgba(0,_0,_0,_0.12)]) [&.q-btn--standard.q-btn--active:before]:(
|
|
15
|
+
`cursor-pointer [&.q-btn--standard:before]:([transition:box-shadow_0.3s_cubic-bezier(0.25,_0.8,_0.5,_1)]) [&.q-btn--standard:active:before]:([box-shadow:0_3px_5px_-1px_rgba(0,_0,_0,_0.2),_0_5px_8px_rgba(0,_0,_0,_0.14),_0_1px_14px_rgba(0,_0,_0,_0.12)]) [&.q-btn--standard.q-btn--active:before]:(shadow-lg shadow-gray/14)`
|
|
16
16
|
],
|
|
17
17
|
|
|
18
18
|
[/^q-btn--no-uppercase$/, ([, c], { theme }) => `normal-case`],
|
|
@@ -75,7 +75,7 @@ const shortcuts: UserShortcuts<QuasarTheme> = [
|
|
|
75
75
|
([, c], { theme }) =>
|
|
76
76
|
theme.quasar?.components?.['q-btn--fab'] ??
|
|
77
77
|
`layer-components:bg-$light-primary-container layer-components:dark:bg-$dark-primary-container layer-components:text-$light-on-surface layer-components:dark:text-$dark-on-surface
|
|
78
|
-
w-56px h-56px !rounded-
|
|
78
|
+
w-56px h-56px !rounded-$shape-corner-large
|
|
79
79
|
z-${theme.quasar.z.fab}
|
|
80
80
|
[&_.q-icon]:(text-[24px]) [&_.q-icon]:(m-auto)`
|
|
81
81
|
// min-h-[56px] min-w-[56px] p-[16px] pb-0
|
|
@@ -86,7 +86,7 @@ const shortcuts: UserShortcuts<QuasarTheme> = [
|
|
|
86
86
|
([, c], { theme }) =>
|
|
87
87
|
theme.quasar?.components?.['q-btn--fab-mini'] ??
|
|
88
88
|
`layer-components:bg-$light-primary-container layer-components:dark:bg-$dark-primary-container layer-components:text-$light-on-surface layer-components:dark:text-$dark-on-surface
|
|
89
|
-
w-40px h-40px !rounded-
|
|
89
|
+
w-40px h-40px !rounded-$shape-corner-large
|
|
90
90
|
[&_.q-icon]:(text-[24px])`
|
|
91
91
|
// min-h-[40px] min-w-[40px]
|
|
92
92
|
],
|
|
@@ -6,7 +6,7 @@ const shortcuts: UserShortcuts<QuasarTheme> = [
|
|
|
6
6
|
/^q-card$/,
|
|
7
7
|
([, c], { theme }) =>
|
|
8
8
|
theme.quasar?.components?.['q-card'] ??
|
|
9
|
-
`p-16px rounded-
|
|
9
|
+
`p-16px rounded-$shape-corner-medium align-top relative bg-$light-surface-container-low dark:bg-$dark-surface-container-low
|
|
10
10
|
[&_>_div:not(.q--avoid-card-border)]:(rounded-tl-none rounded-tr-none rounded-bl-none rounded-br-none)
|
|
11
11
|
[&_>_img:not(.q--avoid-card-border)]:(rounded-tl-none rounded-tr-none rounded-bl-none rounded-br-none)
|
|
12
12
|
[&_>_div:nth-child(1_of_:not(.q--avoid-card-border))]:([border-top:0] [border-top-left-radius:inherit] [border-top-right-radius:inherit])
|
|
@@ -24,7 +24,7 @@ const shortcuts: UserShortcuts<QuasarTheme> = [
|
|
|
24
24
|
bg-$light-surface-container-low dark:bg-$dark-secondary-container
|
|
25
25
|
text-$light-on-surface-variant dark:text-$dark-on-secondary-container
|
|
26
26
|
text-[14px] px-[1em] py-[0.375em]
|
|
27
|
-
[&_.q-avatar]:(text-[2em] -ml-[0.45em] mr-[0.2em] rounded-
|
|
27
|
+
[&_.q-avatar]:(text-[2em] -ml-[0.45em] mr-[0.2em] rounded-$shape-corner-large)`
|
|
28
28
|
],
|
|
29
29
|
|
|
30
30
|
[
|
|
@@ -91,14 +91,14 @@ const shortcuts: UserShortcuts<QuasarTheme> = [
|
|
|
91
91
|
/^q-chip--dense$/,
|
|
92
92
|
([, c], { theme }) =>
|
|
93
93
|
theme.quasar?.components?.['q-chip--dense'] ??
|
|
94
|
-
`rounded-
|
|
94
|
+
`rounded-$shape-corner-medium px-[0.4em] py-[0] h-[1.5em] [&_.q-avatar]:(text-[1.5em] -ml-[0.27em] mr-[0.1em] rounded-$shape-corner-medium) [&_.q-chip\\_\\_icon]:(text-[1.25em]) [&_.q-chip\\_\\_icon--left]:(mr-[0.195em]) [&_.q-chip\\_\\_icon--remove]:(-mr-[0.25em])`
|
|
95
95
|
],
|
|
96
96
|
|
|
97
97
|
[
|
|
98
98
|
/^q-chip--square$/,
|
|
99
99
|
([, c], { theme }) =>
|
|
100
100
|
theme.quasar?.components?.['q-chip--square'] ??
|
|
101
|
-
`rounded-
|
|
101
|
+
`rounded-$shape-corner-small [&_.q-avatar]:(rounded-tl-[3px] rounded-br-[0] rounded-tr-[0] rounded-bl-[3px])`
|
|
102
102
|
]
|
|
103
103
|
]
|
|
104
104
|
|
|
@@ -6,7 +6,7 @@ const shortcuts: UserShortcuts<QuasarTheme> = [
|
|
|
6
6
|
/^q-drawer$/,
|
|
7
7
|
([, c], { theme }) =>
|
|
8
8
|
theme.quasar?.components?.['q-drawer'] ??
|
|
9
|
-
`
|
|
9
|
+
`rounded-$shape-corner-large absolute top-[0] bottom-[0] bg-$light-surface-container-low dark:bg-$dark-surface-container-low z-${theme.quasar.z['side']}`
|
|
10
10
|
],
|
|
11
11
|
|
|
12
12
|
[
|
|
@@ -97,7 +97,6 @@ const shortcuts: UserShortcuts<QuasarTheme> = [
|
|
|
97
97
|
[&_>_.q-scrollarea]:(px-0)
|
|
98
98
|
[&_>_.q-list]:(px-12px)
|
|
99
99
|
[&_.q-list_.q-item]:(border-rd-32px)
|
|
100
|
-
[&_.q-list_.q-item:hover]:(bg-$light-on-secondary-container/8 dark:bg-$dark-on-secondary-container/8)
|
|
101
100
|
[&_.q-list_>_.q-router-link--active]:(text-$light-primary dark:text-$dark-primary)
|
|
102
101
|
[&_.q-list_.q-router-link--active]:(bg-$light-secondary-container dark:bg-$dark-secondary-container)
|
|
103
102
|
`
|
|
@@ -14,7 +14,7 @@ const shortcuts: UserShortcuts<QuasarTheme> = [
|
|
|
14
14
|
/^q-item__section--side$/,
|
|
15
15
|
([, c], { theme }) =>
|
|
16
16
|
theme.quasar?.components?.['q-item__section--side'] ??
|
|
17
|
-
`!flex-initial text-[#757575] items-start pr-[16px] w-auto
|
|
17
|
+
`!flex-initial text-[#757575] items-start pr-[16px] w-auto [&_>_.q-icon]:(text-[24px]) [&_>_.q-avatar]:(text-[40px])`
|
|
18
18
|
],
|
|
19
19
|
|
|
20
20
|
[
|
|
@@ -8,7 +8,7 @@ const shortcuts: UserShortcuts<QuasarTheme> = [
|
|
|
8
8
|
theme.quasar?.components?.['q-tab'] ??
|
|
9
9
|
`px-[16px] py-[0] min-h-[48px] [transition:color_0.3s,_background-color_0.3s] whitespace-nowrap [color:inherit] no-underline
|
|
10
10
|
[&_.q-badge]:(top-[3px] -right-[12px])
|
|
11
|
-
[&_>_.q-focus-helper]:(!absolute !h-32px !w-52px !top-[calc(50%-23px)] !left-[calc(50%-26px)] !
|
|
11
|
+
[&_>_.q-focus-helper]:(!absolute !h-32px !w-52px !top-[calc(50%-23px)] !left-[calc(50%-26px)] !rounded-$shape-corner-large)
|
|
12
12
|
`
|
|
13
13
|
],
|
|
14
14
|
|
|
@@ -35,7 +35,7 @@ const shortcuts: UserShortcuts<QuasarTheme> = [
|
|
|
35
35
|
/^q-time__header-label$/,
|
|
36
36
|
([, c], { theme }) =>
|
|
37
37
|
theme.quasar?.components?.['q-time__header-label'] ??
|
|
38
|
-
`text-[48px]
|
|
38
|
+
`text-[48px] rounded-$shape-corner-small
|
|
39
39
|
leading-none tracking-[-0.00833em] [&_>_div_+_div]:(ml-[4px]) !flex-initial`
|
|
40
40
|
],
|
|
41
41
|
|
package/src/theme.ts
CHANGED
|
@@ -61,6 +61,13 @@ export interface QuasarTheme {
|
|
|
61
61
|
lg: string
|
|
62
62
|
xl: string
|
|
63
63
|
}
|
|
64
|
+
shape: {
|
|
65
|
+
corner: {
|
|
66
|
+
small: string
|
|
67
|
+
medium: string
|
|
68
|
+
large: string
|
|
69
|
+
}
|
|
70
|
+
}
|
|
64
71
|
colors: {
|
|
65
72
|
light: MaterialColorScheme
|
|
66
73
|
dark: MaterialColorScheme
|
|
@@ -1222,6 +1229,13 @@ const defaultTheme: QuasarTheme = {
|
|
|
1222
1229
|
lg: '1440px',
|
|
1223
1230
|
xl: '1920px'
|
|
1224
1231
|
},
|
|
1232
|
+
shape: {
|
|
1233
|
+
corner: {
|
|
1234
|
+
small: '8px',
|
|
1235
|
+
medium: '12px',
|
|
1236
|
+
large: '16px'
|
|
1237
|
+
}
|
|
1238
|
+
},
|
|
1225
1239
|
colors: {
|
|
1226
1240
|
light: {
|
|
1227
1241
|
primary: '#684fa4',
|
|
@@ -1626,7 +1640,7 @@ const defaultTheme: QuasarTheme = {
|
|
|
1626
1640
|
}
|
|
1627
1641
|
}
|
|
1628
1642
|
|
|
1629
|
-
const generateTheme = (sourceColor: string): QuasarTheme => {
|
|
1643
|
+
const generateTheme = (sourceColor: string = '#806cb0'): QuasarTheme => {
|
|
1630
1644
|
const materialTheme = themeFromSourceColor(argbFromHex(sourceColor))
|
|
1631
1645
|
|
|
1632
1646
|
return {
|