@code-coaching/vuetiful 0.0.0
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/README.md +143 -0
- package/dist/style.css +1 -0
- package/dist/styles/all.css +4645 -0
- package/dist/types/components/atoms/VButton.vue.d.ts +86 -0
- package/dist/types/components/atoms/index.d.ts +2 -0
- package/dist/types/components/index.d.ts +2 -0
- package/dist/types/constants/MyConstants.d.ts +1 -0
- package/dist/types/constants/index.d.ts +2 -0
- package/dist/types/index.d.ts +12 -0
- package/dist/types/types/index.d.ts +1 -0
- package/dist/types/types/tailwind.d.ts +4 -0
- package/dist/types/utils/MyUtil.d.ts +5 -0
- package/dist/types/utils/dark-mode/dark-mode.d.ts +18 -0
- package/dist/types/utils/dark-mode/dark-mode.vue.d.ts +91 -0
- package/dist/types/utils/index.d.ts +6 -0
- package/dist/types/utils/platform/platform.d.ts +4 -0
- package/dist/types/utils/theme/theme-switcher.vue.d.ts +106 -0
- package/dist/types/utils/theme/theme.d.ts +9 -0
- package/dist/vuetiful.es.mjs +515 -0
- package/dist/vuetiful.umd.js +17 -0
- package/package.json +47 -0
- package/src/assets/fonts/myfont.woff +0 -0
- package/src/assets/main.css +17 -0
- package/src/components/atoms/VButton.vue +78 -0
- package/src/components/atoms/index.ts +3 -0
- package/src/components/index.ts +3 -0
- package/src/constants/MyConstants.ts +1 -0
- package/src/constants/index.ts +5 -0
- package/src/env.d.ts +8 -0
- package/src/index.ts +29 -0
- package/src/styles/all.css +21 -0
- package/src/styles/core.css +65 -0
- package/src/styles/elements/alerts.css +17 -0
- package/src/styles/elements/badges.css +31 -0
- package/src/styles/elements/breadcrumbs.css +26 -0
- package/src/styles/elements/buttons.css +103 -0
- package/src/styles/elements/cards.css +32 -0
- package/src/styles/elements/chips.css +22 -0
- package/src/styles/elements/forms.css +268 -0
- package/src/styles/elements/lists.css +48 -0
- package/src/styles/elements/logo-clouds.css +29 -0
- package/src/styles/elements/modals.css +15 -0
- package/src/styles/elements/placeholders.css +17 -0
- package/src/styles/elements/popups.css +16 -0
- package/src/styles/elements/tables.css +102 -0
- package/src/styles/elements.css +19 -0
- package/src/styles/highlight-js.css +116 -0
- package/src/styles/tailwind.css +16 -0
- package/src/styles/typography.css +101 -0
- package/src/styles/variants.css +156 -0
- package/src/tailwind/core.cjs +37 -0
- package/src/tailwind/generated/intellisense-classes.cjs +558 -0
- package/src/tailwind/intellisense.cjs +21 -0
- package/src/tailwind/settings.cjs +20 -0
- package/src/tailwind/theme/colors.cjs +20 -0
- package/src/tailwind/tokens/backgrounds.cjs +48 -0
- package/src/tailwind/tokens/border-radius.cjs +21 -0
- package/src/tailwind/tokens/borders.cjs +24 -0
- package/src/tailwind/tokens/fills.cjs +20 -0
- package/src/tailwind/tokens/rings.cjs +50 -0
- package/src/tailwind/tokens/text.cjs +35 -0
- package/src/tailwind/vuetiful.cjs +19 -0
- package/src/themes/theme-modern.css +127 -0
- package/src/themes/theme-rocket.css +119 -0
- package/src/themes/theme-sahara.css +128 -0
- package/src/themes/theme-seafoam.css +121 -0
- package/src/themes/theme-seasonal.css +115 -0
- package/src/themes/theme-vintage.css +125 -0
- package/src/themes/theme-vuetiful.css +118 -0
- package/src/types/index.ts +1 -0
- package/src/types/tailwind.ts +7 -0
- package/src/utils/MyUtil.ts +7 -0
- package/src/utils/dark-mode/dark-mode.ts +90 -0
- package/src/utils/dark-mode/dark-mode.vue +133 -0
- package/src/utils/index.ts +7 -0
- package/src/utils/platform/platform.ts +10 -0
- package/src/utils/theme/theme-switcher.vue +155 -0
- package/src/utils/theme/theme.ts +65 -0
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/* A New Years inspired theme. */
|
|
2
|
+
|
|
3
|
+
/* https://fonts.google.com/specimen/Quicksand?query=Quicksand */
|
|
4
|
+
@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@300;400;500;600;700&display=swap');
|
|
5
|
+
|
|
6
|
+
:root {
|
|
7
|
+
/* =~= Theme Properties =~= */
|
|
8
|
+
--theme-font-family-base: system-ui;
|
|
9
|
+
--theme-font-family-heading: 'Quicksand', sans-serif;
|
|
10
|
+
--theme-font-color-base: var(--color-surface-500);
|
|
11
|
+
--theme-font-color-dark: var(--color-surface-200);
|
|
12
|
+
--theme-rounded-base: 12px;
|
|
13
|
+
--theme-rounded-container: 12px;
|
|
14
|
+
--theme-border-base: 0px;
|
|
15
|
+
/* =~= Theme On-X Colors =~= */
|
|
16
|
+
--on-primary: 0 0 0;
|
|
17
|
+
--on-secondary: 255 255 255;
|
|
18
|
+
--on-tertiary: 255 255 255;
|
|
19
|
+
--on-success: 0 0 0;
|
|
20
|
+
--on-warning: 0 0 0;
|
|
21
|
+
--on-error: 255 255 255;
|
|
22
|
+
--on-surface: 255 255 255;
|
|
23
|
+
/* =~= Theme Colors =~= */
|
|
24
|
+
/* primary | #40b09d */
|
|
25
|
+
--color-primary-50: 226 243 240; /* ⬅ #e2f3f0 */
|
|
26
|
+
--color-primary-100: 217 239 235; /* ⬅ #d9efeb */
|
|
27
|
+
--color-primary-200: 207 235 231; /* ⬅ #cfebe7 */
|
|
28
|
+
--color-primary-300: 179 223 216; /* ⬅ #b3dfd8 */
|
|
29
|
+
--color-primary-400: 121 200 186; /* ⬅ #79c8ba */
|
|
30
|
+
--color-primary-500: 64 176 157; /* ⬅ #40b09d */
|
|
31
|
+
--color-primary-600: 58 158 141; /* ⬅ #3a9e8d */
|
|
32
|
+
--color-primary-700: 48 132 118; /* ⬅ #308476 */
|
|
33
|
+
--color-primary-800: 38 106 94; /* ⬅ #266a5e */
|
|
34
|
+
--color-primary-900: 31 86 77; /* ⬅ #1f564d */
|
|
35
|
+
/* secondary | #d7a12d */
|
|
36
|
+
--color-secondary-50: 249 241 224; /* ⬅ #f9f1e0 */
|
|
37
|
+
--color-secondary-100: 247 236 213; /* ⬅ #f7ecd5 */
|
|
38
|
+
--color-secondary-200: 245 232 203; /* ⬅ #f5e8cb */
|
|
39
|
+
--color-secondary-300: 239 217 171; /* ⬅ #efd9ab */
|
|
40
|
+
--color-secondary-400: 227 189 108; /* ⬅ #e3bd6c */
|
|
41
|
+
--color-secondary-500: 215 161 45; /* ⬅ #d7a12d */
|
|
42
|
+
--color-secondary-600: 194 145 41; /* ⬅ #c29129 */
|
|
43
|
+
--color-secondary-700: 161 121 34; /* ⬅ #a17922 */
|
|
44
|
+
--color-secondary-800: 129 97 27; /* ⬅ #81611b */
|
|
45
|
+
--color-secondary-900: 105 79 22; /* ⬅ #694f16 */
|
|
46
|
+
/* tertiary | #411d96 */
|
|
47
|
+
--color-tertiary-50: 227 221 239; /* ⬅ #e3ddef */
|
|
48
|
+
--color-tertiary-100: 217 210 234; /* ⬅ #d9d2ea */
|
|
49
|
+
--color-tertiary-200: 208 199 229; /* ⬅ #d0c7e5 */
|
|
50
|
+
--color-tertiary-300: 179 165 213; /* ⬅ #b3a5d5 */
|
|
51
|
+
--color-tertiary-400: 122 97 182; /* ⬅ #7a61b6 */
|
|
52
|
+
--color-tertiary-500: 65 29 150; /* ⬅ #411d96 */
|
|
53
|
+
--color-tertiary-600: 59 26 135; /* ⬅ #3b1a87 */
|
|
54
|
+
--color-tertiary-700: 49 22 113; /* ⬅ #311671 */
|
|
55
|
+
--color-tertiary-800: 39 17 90; /* ⬅ #27115a */
|
|
56
|
+
--color-tertiary-900: 32 14 74; /* ⬅ #200e4a */
|
|
57
|
+
/* success | #aad765 */
|
|
58
|
+
--color-success-50: 242 249 232; /* ⬅ #f2f9e8 */
|
|
59
|
+
--color-success-100: 238 247 224; /* ⬅ #eef7e0 */
|
|
60
|
+
--color-success-200: 234 245 217; /* ⬅ #eaf5d9 */
|
|
61
|
+
--color-success-300: 221 239 193; /* ⬅ #ddefc1 */
|
|
62
|
+
--color-success-400: 196 227 147; /* ⬅ #c4e393 */
|
|
63
|
+
--color-success-500: 170 215 101; /* ⬅ #aad765 */
|
|
64
|
+
--color-success-600: 153 194 91; /* ⬅ #99c25b */
|
|
65
|
+
--color-success-700: 128 161 76; /* ⬅ #80a14c */
|
|
66
|
+
--color-success-800: 102 129 61; /* ⬅ #66813d */
|
|
67
|
+
--color-success-900: 83 105 49; /* ⬅ #536931 */
|
|
68
|
+
/* warning | #e1ca84 */
|
|
69
|
+
--color-warning-50: 251 247 237; /* ⬅ #fbf7ed */
|
|
70
|
+
--color-warning-100: 249 244 230; /* ⬅ #f9f4e6 */
|
|
71
|
+
--color-warning-200: 248 242 224; /* ⬅ #f8f2e0 */
|
|
72
|
+
--color-warning-300: 243 234 206; /* ⬅ #f3eace */
|
|
73
|
+
--color-warning-400: 234 218 169; /* ⬅ #eadaa9 */
|
|
74
|
+
--color-warning-500: 225 202 132; /* ⬅ #e1ca84 */
|
|
75
|
+
--color-warning-600: 203 182 119; /* ⬅ #cbb677 */
|
|
76
|
+
--color-warning-700: 169 152 99; /* ⬅ #a99863 */
|
|
77
|
+
--color-warning-800: 135 121 79; /* ⬅ #87794f */
|
|
78
|
+
--color-warning-900: 110 99 65; /* ⬅ #6e6341 */
|
|
79
|
+
/* error | #e1565d */
|
|
80
|
+
--color-error-50: 251 230 231; /* ⬅ #fbe6e7 */
|
|
81
|
+
--color-error-100: 249 221 223; /* ⬅ #f9dddf */
|
|
82
|
+
--color-error-200: 248 213 215; /* ⬅ #f8d5d7 */
|
|
83
|
+
--color-error-300: 243 187 190; /* ⬅ #f3bbbe */
|
|
84
|
+
--color-error-400: 234 137 142; /* ⬅ #ea898e */
|
|
85
|
+
--color-error-500: 225 86 93; /* ⬅ #e1565d */
|
|
86
|
+
--color-error-600: 203 77 84; /* ⬅ #cb4d54 */
|
|
87
|
+
--color-error-700: 169 65 70; /* ⬅ #a94146 */
|
|
88
|
+
--color-error-800: 135 52 56; /* ⬅ #873438 */
|
|
89
|
+
--color-error-900: 110 42 46; /* ⬅ #6e2a2e */
|
|
90
|
+
/* surface | #0f233e */
|
|
91
|
+
--color-surface-50: 219 222 226; /* ⬅ #dbdee2 */
|
|
92
|
+
--color-surface-100: 207 211 216; /* ⬅ #cfd3d8 */
|
|
93
|
+
--color-surface-200: 195 200 207; /* ⬅ #c3c8cf */
|
|
94
|
+
--color-surface-300: 159 167 178; /* ⬅ #9fa7b2 */
|
|
95
|
+
--color-surface-400: 87 101 120; /* ⬅ #576578 */
|
|
96
|
+
--color-surface-500: 15 35 62; /* ⬅ #0f233e */
|
|
97
|
+
--color-surface-600: 14 32 56; /* ⬅ #0e2038 */
|
|
98
|
+
--color-surface-700: 11 26 47; /* ⬅ #0b1a2f */
|
|
99
|
+
--color-surface-800: 9 21 37; /* ⬅ #091525 */
|
|
100
|
+
--color-surface-900: 7 17 30; /* ⬅ #07111e */
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/* Applied to body with `<body data-theme="seasonal">` */
|
|
104
|
+
[data-theme='seasonal'] {
|
|
105
|
+
/* prettier-ignore */
|
|
106
|
+
background-image:
|
|
107
|
+
radial-gradient(at 22% 100%, hsla(39,68%,50%,0.23) 0px, transparent 50%),
|
|
108
|
+
radial-gradient(at 80% 100%, hsla(189,100%,56%,0.33) 0px, transparent 50%);
|
|
109
|
+
}
|
|
110
|
+
.dark [data-theme='seasonal'] {
|
|
111
|
+
/* prettier-ignore */
|
|
112
|
+
background-image:
|
|
113
|
+
radial-gradient(at 22% 0%, hsla(39,68%,50%,0.15) 0px, transparent 50%),
|
|
114
|
+
radial-gradient(at 80% 0%, hsla(189,100%,56%,0.15) 0px, transparent 50%);
|
|
115
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/* https://fonts.google.com/specimen/Abril+Fatface?query=Abril+Fatface¬o.query=Abril */
|
|
2
|
+
@import url('https://fonts.googleapis.com/css2?family=Abril+Fatface&display=swap');
|
|
3
|
+
/* https://fonts.google.com/noto/specimen/Noto+Sans?query=sans */
|
|
4
|
+
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans:ital,wght@0,100;0,200;0,300;0,400;1,100;1,200;1,300&display=swap');
|
|
5
|
+
|
|
6
|
+
:root {
|
|
7
|
+
/* =~= Theme Styles =~= */
|
|
8
|
+
--theme-font-family-base: 'Noto Sans', sans-serif;
|
|
9
|
+
--theme-font-family-heading: 'Abril Fatface', cursive;
|
|
10
|
+
--theme-font-color-base: var(--color-primary-900);
|
|
11
|
+
--theme-font-color-dark: var(--color-primary-100);
|
|
12
|
+
--theme-rounded-base: 2px;
|
|
13
|
+
--theme-rounded-container: 4px;
|
|
14
|
+
--theme-border-base: 1px;
|
|
15
|
+
/* =~= Theme On-X Colors =~= */
|
|
16
|
+
--on-primary: 0 0 0;
|
|
17
|
+
--on-secondary: 0 0 0;
|
|
18
|
+
--on-tertiary: 0 0 0;
|
|
19
|
+
--on-success: 0 0 0;
|
|
20
|
+
--on-warning: 0 0 0;
|
|
21
|
+
--on-error: 0 0 0;
|
|
22
|
+
--on-surface: 255 255 255;
|
|
23
|
+
/* =~= Theme Colors =~= */
|
|
24
|
+
/* primary | #ea861a */
|
|
25
|
+
--color-primary-50: 252 237 221; /* ⬅ #fceddd */
|
|
26
|
+
--color-primary-100: 251 231 209; /* ⬅ #fbe7d1 */
|
|
27
|
+
--color-primary-200: 250 225 198; /* ⬅ #fae1c6 */
|
|
28
|
+
--color-primary-300: 247 207 163; /* ⬅ #f7cfa3 */
|
|
29
|
+
--color-primary-400: 240 170 95; /* ⬅ #f0aa5f */
|
|
30
|
+
--color-primary-500: 234 134 26; /* ⬅ #ea861a */
|
|
31
|
+
--color-primary-600: 211 121 23; /* ⬅ #d37917 */
|
|
32
|
+
--color-primary-700: 176 101 20; /* ⬅ #b06514 */
|
|
33
|
+
--color-primary-800: 140 80 16; /* ⬅ #8c5010 */
|
|
34
|
+
--color-primary-900: 115 66 13; /* ⬅ #73420d */
|
|
35
|
+
/* secondary | #97cea5 */
|
|
36
|
+
--color-secondary-50: 239 248 242; /* ⬅ #eff8f2 */
|
|
37
|
+
--color-secondary-100: 234 245 237; /* ⬅ #eaf5ed */
|
|
38
|
+
--color-secondary-200: 229 243 233; /* ⬅ #e5f3e9 */
|
|
39
|
+
--color-secondary-300: 213 235 219; /* ⬅ #d5ebdb */
|
|
40
|
+
--color-secondary-400: 182 221 192; /* ⬅ #b6ddc0 */
|
|
41
|
+
--color-secondary-500: 151 206 165; /* ⬅ #97cea5 */
|
|
42
|
+
--color-secondary-600: 136 185 149; /* ⬅ #88b995 */
|
|
43
|
+
--color-secondary-700: 113 155 124; /* ⬅ #719b7c */
|
|
44
|
+
--color-secondary-800: 91 124 99; /* ⬅ #5b7c63 */
|
|
45
|
+
--color-secondary-900: 74 101 81; /* ⬅ #4a6551 */
|
|
46
|
+
/* tertiary | #06b6d4 */
|
|
47
|
+
--color-tertiary-50: 218 244 249; /* ⬅ #daf4f9 */
|
|
48
|
+
--color-tertiary-100: 205 240 246; /* ⬅ #cdf0f6 */
|
|
49
|
+
--color-tertiary-200: 193 237 244; /* ⬅ #c1edf4 */
|
|
50
|
+
--color-tertiary-300: 155 226 238; /* ⬅ #9be2ee */
|
|
51
|
+
--color-tertiary-400: 81 204 225; /* ⬅ #51cce1 */
|
|
52
|
+
--color-tertiary-500: 6 182 212; /* ⬅ #06b6d4 */
|
|
53
|
+
--color-tertiary-600: 5 164 191; /* ⬅ #05a4bf */
|
|
54
|
+
--color-tertiary-700: 5 137 159; /* ⬅ #05899f */
|
|
55
|
+
--color-tertiary-800: 4 109 127; /* ⬅ #046d7f */
|
|
56
|
+
--color-tertiary-900: 3 89 104; /* ⬅ #035968 */
|
|
57
|
+
/* success | #84cb5d */
|
|
58
|
+
--color-success-50: 237 247 231; /* ⬅ #edf7e7 */
|
|
59
|
+
--color-success-100: 230 245 223; /* ⬅ #e6f5df */
|
|
60
|
+
--color-success-200: 224 242 215; /* ⬅ #e0f2d7 */
|
|
61
|
+
--color-success-300: 206 234 190; /* ⬅ #ceeabe */
|
|
62
|
+
--color-success-400: 169 219 142; /* ⬅ #a9db8e */
|
|
63
|
+
--color-success-500: 132 203 93; /* ⬅ #84cb5d */
|
|
64
|
+
--color-success-600: 119 183 84; /* ⬅ #77b754 */
|
|
65
|
+
--color-success-700: 99 152 70; /* ⬅ #639846 */
|
|
66
|
+
--color-success-800: 79 122 56; /* ⬅ #4f7a38 */
|
|
67
|
+
--color-success-900: 65 99 46; /* ⬅ #41632e */
|
|
68
|
+
/* warning | #f2ac23 */
|
|
69
|
+
--color-warning-50: 253 243 222; /* ⬅ #fdf3de */
|
|
70
|
+
--color-warning-100: 252 238 211; /* ⬅ #fceed3 */
|
|
71
|
+
--color-warning-200: 252 234 200; /* ⬅ #fceac8 */
|
|
72
|
+
--color-warning-300: 250 222 167; /* ⬅ #fadea7 */
|
|
73
|
+
--color-warning-400: 246 197 101; /* ⬅ #f6c565 */
|
|
74
|
+
--color-warning-500: 242 172 35; /* ⬅ #f2ac23 */
|
|
75
|
+
--color-warning-600: 218 155 32; /* ⬅ #da9b20 */
|
|
76
|
+
--color-warning-700: 182 129 26; /* ⬅ #b6811a */
|
|
77
|
+
--color-warning-800: 145 103 21; /* ⬅ #916715 */
|
|
78
|
+
--color-warning-900: 119 84 17; /* ⬅ #775411 */
|
|
79
|
+
/* error | #d57e78 */
|
|
80
|
+
--color-error-50: 249 236 235; /* ⬅ #f9eceb */
|
|
81
|
+
--color-error-100: 247 229 228; /* ⬅ #f7e5e4 */
|
|
82
|
+
--color-error-200: 245 223 221; /* ⬅ #f5dfdd */
|
|
83
|
+
--color-error-300: 238 203 201; /* ⬅ #eecbc9 */
|
|
84
|
+
--color-error-400: 226 165 161; /* ⬅ #e2a5a1 */
|
|
85
|
+
--color-error-500: 213 126 120; /* ⬅ #d57e78 */
|
|
86
|
+
--color-error-600: 192 113 108; /* ⬅ #c0716c */
|
|
87
|
+
--color-error-700: 160 95 90; /* ⬅ #a05f5a */
|
|
88
|
+
--color-error-800: 128 76 72; /* ⬅ #804c48 */
|
|
89
|
+
--color-error-900: 104 62 59; /* ⬅ #683e3b */
|
|
90
|
+
/* surface | #3f3731 */
|
|
91
|
+
--color-surface-50: 226 225 224; /* ⬅ #e2e1e0 */
|
|
92
|
+
--color-surface-100: 217 215 214; /* ⬅ #d9d7d6 */
|
|
93
|
+
--color-surface-200: 207 205 204; /* ⬅ #cfcdcc */
|
|
94
|
+
--color-surface-300: 178 175 173; /* ⬅ #b2afad */
|
|
95
|
+
--color-surface-400: 121 115 111; /* ⬅ #79736f */
|
|
96
|
+
--color-surface-500: 63 55 49; /* ⬅ #3f3731 */
|
|
97
|
+
--color-surface-600: 57 50 44; /* ⬅ #39322c */
|
|
98
|
+
--color-surface-700: 47 41 37; /* ⬅ #2f2925 */
|
|
99
|
+
--color-surface-800: 38 33 29; /* ⬅ #26211d */
|
|
100
|
+
--color-surface-900: 31 27 24; /* ⬅ #1f1b18 */
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
[data-theme='vintage'] h1,
|
|
104
|
+
[data-theme='vintage'] h2,
|
|
105
|
+
[data-theme='vintage'] h3,
|
|
106
|
+
[data-theme='vintage'] h4,
|
|
107
|
+
[data-theme='vintage'] h5,
|
|
108
|
+
[data-theme='vintage'] h6 {
|
|
109
|
+
letter-spacing: 1px;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/* Applied to body with `<body data-theme="vintage">` */
|
|
113
|
+
/* Created with: https://csshero.org/mesher/ */
|
|
114
|
+
[data-theme='vintage'] {
|
|
115
|
+
/* prettier-ignore */
|
|
116
|
+
background-image:
|
|
117
|
+
radial-gradient(at 100% 0%, hsla(135,34%,70%,0.20) 0px, transparent 50%),
|
|
118
|
+
radial-gradient(at 85% 100%, hsla(31,83%,50%,0.20) 0px, transparent 50%);
|
|
119
|
+
}
|
|
120
|
+
.dark [data-theme='vintage'] {
|
|
121
|
+
/* prettier-ignore */
|
|
122
|
+
background-image:
|
|
123
|
+
radial-gradient(at 100% 0%, hsla(135,34%,70%,0.14) 0px, transparent 50%),
|
|
124
|
+
radial-gradient(at 85% 100%, hsla(31,83%,50%,0.14) 0px, transparent 50%);
|
|
125
|
+
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/* https://fonts.google.com/specimen/Lato?query=lato¬o.query=Abril */
|
|
2
|
+
@import url('https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,100;0,300;0,400;0,700;0,900;1,100;1,300;1,400;1,700;1,900&display=swap');
|
|
3
|
+
|
|
4
|
+
:root {
|
|
5
|
+
/* =~= Theme Properties =~= */
|
|
6
|
+
--theme-font-family-base: system-ui;
|
|
7
|
+
--theme-font-family-heading: system-ui;
|
|
8
|
+
--theme-font-color-base: 0 0 0;
|
|
9
|
+
--theme-font-color-dark: 255 255 255;
|
|
10
|
+
--theme-rounded-base: 9999px;
|
|
11
|
+
--theme-rounded-container: 8px;
|
|
12
|
+
--theme-border-base: 1px;
|
|
13
|
+
/* =~= Theme On-X Colors =~= */
|
|
14
|
+
--on-primary: 0 0 0;
|
|
15
|
+
--on-secondary: 255 255 255;
|
|
16
|
+
--on-tertiary: 0 0 0;
|
|
17
|
+
--on-success: 0 0 0;
|
|
18
|
+
--on-warning: 0 0 0;
|
|
19
|
+
--on-error: 255 255 255;
|
|
20
|
+
--on-surface: 255 255 255;
|
|
21
|
+
/* =~= Theme Colors =~= */
|
|
22
|
+
/* primary | #0FBA81 */
|
|
23
|
+
--color-primary-50: 219 245 236; /* ⬅ #dbf5ec */
|
|
24
|
+
--color-primary-100: 207 241 230; /* ⬅ #cff1e6 */
|
|
25
|
+
--color-primary-200: 195 238 224; /* ⬅ #c3eee0 */
|
|
26
|
+
--color-primary-300: 159 227 205; /* ⬅ #9fe3cd */
|
|
27
|
+
--color-primary-400: 87 207 167; /* ⬅ #57cfa7 */
|
|
28
|
+
--color-primary-500: 15 186 129; /* ⬅ #0FBA81 */
|
|
29
|
+
--color-primary-600: 14 167 116; /* ⬅ #0ea774 */
|
|
30
|
+
--color-primary-700: 11 140 97; /* ⬅ #0b8c61 */
|
|
31
|
+
--color-primary-800: 9 112 77; /* ⬅ #09704d */
|
|
32
|
+
--color-primary-900: 7 91 63; /* ⬅ #075b3f */
|
|
33
|
+
/* secondary | #4F46E5 */
|
|
34
|
+
--color-secondary-50: 229 227 251; /* ⬅ #e5e3fb */
|
|
35
|
+
--color-secondary-100: 220 218 250; /* ⬅ #dcdafa */
|
|
36
|
+
--color-secondary-200: 211 209 249; /* ⬅ #d3d1f9 */
|
|
37
|
+
--color-secondary-300: 185 181 245; /* ⬅ #b9b5f5 */
|
|
38
|
+
--color-secondary-400: 132 126 237; /* ⬅ #847eed */
|
|
39
|
+
--color-secondary-500: 79 70 229; /* ⬅ #4F46E5 */
|
|
40
|
+
--color-secondary-600: 71 63 206; /* ⬅ #473fce */
|
|
41
|
+
--color-secondary-700: 59 53 172; /* ⬅ #3b35ac */
|
|
42
|
+
--color-secondary-800: 47 42 137; /* ⬅ #2f2a89 */
|
|
43
|
+
--color-secondary-900: 39 34 112; /* ⬅ #272270 */
|
|
44
|
+
/* tertiary | #0EA5E9 */
|
|
45
|
+
--color-tertiary-50: 219 242 252; /* ⬅ #dbf2fc */
|
|
46
|
+
--color-tertiary-100: 207 237 251; /* ⬅ #cfedfb */
|
|
47
|
+
--color-tertiary-200: 195 233 250; /* ⬅ #c3e9fa */
|
|
48
|
+
--color-tertiary-300: 159 219 246; /* ⬅ #9fdbf6 */
|
|
49
|
+
--color-tertiary-400: 86 192 240; /* ⬅ #56c0f0 */
|
|
50
|
+
--color-tertiary-500: 14 165 233; /* ⬅ #0EA5E9 */
|
|
51
|
+
--color-tertiary-600: 13 149 210; /* ⬅ #0d95d2 */
|
|
52
|
+
--color-tertiary-700: 11 124 175; /* ⬅ #0b7caf */
|
|
53
|
+
--color-tertiary-800: 8 99 140; /* ⬅ #08638c */
|
|
54
|
+
--color-tertiary-900: 7 81 114; /* ⬅ #075172 */
|
|
55
|
+
/* success | #84cc16 */
|
|
56
|
+
--color-success-50: 237 247 220; /* ⬅ #edf7dc */
|
|
57
|
+
--color-success-100: 230 245 208; /* ⬅ #e6f5d0 */
|
|
58
|
+
--color-success-200: 224 242 197; /* ⬅ #e0f2c5 */
|
|
59
|
+
--color-success-300: 206 235 162; /* ⬅ #ceeba2 */
|
|
60
|
+
--color-success-400: 169 219 92; /* ⬅ #a9db5c */
|
|
61
|
+
--color-success-500: 132 204 22; /* ⬅ #84cc16 */
|
|
62
|
+
--color-success-600: 119 184 20; /* ⬅ #77b814 */
|
|
63
|
+
--color-success-700: 99 153 17; /* ⬅ #639911 */
|
|
64
|
+
--color-success-800: 79 122 13; /* ⬅ #4f7a0d */
|
|
65
|
+
--color-success-900: 65 100 11; /* ⬅ #41640b */
|
|
66
|
+
/* warning | #EAB308 */
|
|
67
|
+
--color-warning-50: 252 244 218; /* ⬅ #fcf4da */
|
|
68
|
+
--color-warning-100: 251 240 206; /* ⬅ #fbf0ce */
|
|
69
|
+
--color-warning-200: 250 236 193; /* ⬅ #faecc1 */
|
|
70
|
+
--color-warning-300: 247 225 156; /* ⬅ #f7e19c */
|
|
71
|
+
--color-warning-400: 240 202 82; /* ⬅ #f0ca52 */
|
|
72
|
+
--color-warning-500: 234 179 8; /* ⬅ #EAB308 */
|
|
73
|
+
--color-warning-600: 211 161 7; /* ⬅ #d3a107 */
|
|
74
|
+
--color-warning-700: 176 134 6; /* ⬅ #b08606 */
|
|
75
|
+
--color-warning-800: 140 107 5; /* ⬅ #8c6b05 */
|
|
76
|
+
--color-warning-900: 115 88 4; /* ⬅ #735804 */
|
|
77
|
+
/* error | #D41976 */
|
|
78
|
+
--color-error-50: 249 221 234; /* ⬅ #f9ddea */
|
|
79
|
+
--color-error-100: 246 209 228; /* ⬅ #f6d1e4 */
|
|
80
|
+
--color-error-200: 244 198 221; /* ⬅ #f4c6dd */
|
|
81
|
+
--color-error-300: 238 163 200; /* ⬅ #eea3c8 */
|
|
82
|
+
--color-error-400: 225 94 159; /* ⬅ #e15e9f */
|
|
83
|
+
--color-error-500: 212 25 118; /* ⬅ #D41976 */
|
|
84
|
+
--color-error-600: 191 23 106; /* ⬅ #bf176a */
|
|
85
|
+
--color-error-700: 159 19 89; /* ⬅ #9f1359 */
|
|
86
|
+
--color-error-800: 127 15 71; /* ⬅ #7f0f47 */
|
|
87
|
+
--color-error-900: 104 12 58; /* ⬅ #680c3a */
|
|
88
|
+
/* surface | #495a8f */
|
|
89
|
+
--color-surface-50: 228 230 238; /* ⬅ #e4e6ee */
|
|
90
|
+
--color-surface-100: 219 222 233; /* ⬅ #dbdee9 */
|
|
91
|
+
--color-surface-200: 210 214 227; /* ⬅ #d2d6e3 */
|
|
92
|
+
--color-surface-300: 182 189 210; /* ⬅ #b6bdd2 */
|
|
93
|
+
--color-surface-400: 128 140 177; /* ⬅ #808cb1 */
|
|
94
|
+
--color-surface-500: 73 90 143; /* ⬅ #495a8f */
|
|
95
|
+
--color-surface-600: 66 81 129; /* ⬅ #425181 */
|
|
96
|
+
--color-surface-700: 55 68 107; /* ⬅ #37446b */
|
|
97
|
+
--color-surface-800: 44 54 86; /* ⬅ #2c3656 */
|
|
98
|
+
--color-surface-900: 36 44 70; /* ⬅ #242c46 */
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/* Headings */
|
|
102
|
+
[data-theme='vuetiful'] h1,
|
|
103
|
+
[data-theme='vuetiful'] h2,
|
|
104
|
+
[data-theme='vuetiful'] h3,
|
|
105
|
+
[data-theme='vuetiful'] h4,
|
|
106
|
+
[data-theme='vuetiful'] h5,
|
|
107
|
+
[data-theme='vuetiful'] h6 {
|
|
108
|
+
font-weight: bold;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/* Applied to body with `<body data-theme="vuetiful">` */
|
|
112
|
+
/* Created with: https://csshero.org/mesher/ */
|
|
113
|
+
/* prettier-ignore */
|
|
114
|
+
[data-theme='vuetiful'] {
|
|
115
|
+
background-image:
|
|
116
|
+
radial-gradient(at 0% 0%, rgba(var(--color-secondary-500) / 0.33) 0px, transparent 50%),
|
|
117
|
+
radial-gradient(at 98% 1%, rgba(var(--color-error-500) / 0.33) 0px, transparent 50%);
|
|
118
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './tailwind';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export const tailwindNumbers = ['50', '100', '200', '300', '400', '500', '600', '700', '800', '900'] as const;
|
|
2
|
+
|
|
3
|
+
export type TailwindNumbers = (typeof tailwindNumbers)[number];
|
|
4
|
+
|
|
5
|
+
export const semanticNames = ['primary', 'secondary', 'tertiary', 'success', 'warning', 'error' , 'surface'] as const;
|
|
6
|
+
|
|
7
|
+
export type SemanticNames = (typeof semanticNames)[number];
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { readonly, Ref, ref } from "vue";
|
|
2
|
+
import { usePlatform } from "../platform/platform";
|
|
3
|
+
|
|
4
|
+
const { isBrowser } = usePlatform();
|
|
5
|
+
|
|
6
|
+
const MODE = {
|
|
7
|
+
LIGHT: true,
|
|
8
|
+
DARK: false,
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const modeOsPrefers = ref(MODE.DARK);
|
|
12
|
+
const currentMode = ref(MODE.DARK);
|
|
13
|
+
const modeUserPrefers: Ref<boolean | undefined> = ref(undefined);
|
|
14
|
+
|
|
15
|
+
const useDarkMode = () => {
|
|
16
|
+
const getModeOsPrefers = (): boolean => {
|
|
17
|
+
const prefersLightMode = window.matchMedia("(prefers-color-scheme: light)").matches;
|
|
18
|
+
setModeOsPrefers(prefersLightMode);
|
|
19
|
+
return prefersLightMode;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const getModeUserPrefers = (): boolean | undefined => {
|
|
23
|
+
if (isBrowser) {
|
|
24
|
+
const mode = localStorage.getItem("modeUserPrefers");
|
|
25
|
+
if (mode !== null) modeUserPrefers.value = mode === "true";
|
|
26
|
+
}
|
|
27
|
+
return modeUserPrefers.value;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const getModeAutoPrefers = (): boolean => {
|
|
31
|
+
const os = getModeOsPrefers();
|
|
32
|
+
const user = getModeUserPrefers();
|
|
33
|
+
const modeValue = user !== undefined ? user : os;
|
|
34
|
+
return modeValue;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const setModeOsPrefers = (value: boolean) => {
|
|
38
|
+
modeOsPrefers.value = value;
|
|
39
|
+
if (isBrowser) {
|
|
40
|
+
localStorage.setItem("modeOsPrefers", value.toString());
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
const setModeUserPrefers = (value: boolean): void => {
|
|
44
|
+
modeUserPrefers.value = value;
|
|
45
|
+
if (isBrowser) {
|
|
46
|
+
localStorage.setItem("modeUserPrefers", value.toString());
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
const setModeCurrent = (value: boolean) => {
|
|
51
|
+
const elemHtmlClasses = document.documentElement.classList;
|
|
52
|
+
const classDark = "dark";
|
|
53
|
+
value === MODE.LIGHT ? elemHtmlClasses.remove(classDark) : elemHtmlClasses.add(classDark);
|
|
54
|
+
currentMode.value = value;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
const initializeMode = (): void => {
|
|
58
|
+
const mode = getModeAutoPrefers();
|
|
59
|
+
setModeCurrent(mode);
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
const autoModeWatcher = (): void => {
|
|
63
|
+
const mql = window.matchMedia("(prefers-color-scheme: light)");
|
|
64
|
+
const setMode = (value: boolean) => {
|
|
65
|
+
const elemHtmlClasses = document.documentElement.classList;
|
|
66
|
+
const classDark = `dark`;
|
|
67
|
+
value === MODE.LIGHT ? elemHtmlClasses.remove(classDark) : elemHtmlClasses.add(classDark);
|
|
68
|
+
};
|
|
69
|
+
setMode(mql.matches);
|
|
70
|
+
mql.onchange = () => {
|
|
71
|
+
setMode(mql.matches);
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
return {
|
|
76
|
+
modeOsPrefers: readonly(modeOsPrefers),
|
|
77
|
+
modeUserPrefers: readonly(modeUserPrefers),
|
|
78
|
+
currentMode: readonly(currentMode),
|
|
79
|
+
getModeOsPrefers,
|
|
80
|
+
getModeUserPrefers,
|
|
81
|
+
getModeAutoPrefers,
|
|
82
|
+
setModeUserPrefers,
|
|
83
|
+
setModeCurrent,
|
|
84
|
+
autoModeWatcher,
|
|
85
|
+
initializeMode,
|
|
86
|
+
MODE,
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
export { useDarkMode };
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
:class="`lightswitch-track ${classesTrack}`"
|
|
4
|
+
@click="onToggleHandler"
|
|
5
|
+
@keydown="onKeyDown"
|
|
6
|
+
on:keyup
|
|
7
|
+
on:keypress
|
|
8
|
+
role="switch"
|
|
9
|
+
aria-label="Light Switch"
|
|
10
|
+
:aria-checked="currentMode"
|
|
11
|
+
:title="`Toggle ${currentMode === false ? 'Dark' : 'Light'} Mode`"
|
|
12
|
+
tabindex="0"
|
|
13
|
+
>
|
|
14
|
+
<div :class="`lightswitch-thumb ${classesThumb}`">
|
|
15
|
+
<svg
|
|
16
|
+
:class="`lightswitch-icon ${classesIcon} ${iconFill}`"
|
|
17
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
18
|
+
viewBox="0 0 512 512"
|
|
19
|
+
>
|
|
20
|
+
<path fill="currentColor" :d="currentMode ? svgPath.sun : svgPath.moon" />
|
|
21
|
+
</svg>
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
</template>
|
|
25
|
+
|
|
26
|
+
<script lang="ts">
|
|
27
|
+
import type { CssClasses } from "@/index";
|
|
28
|
+
import { computed, ComputedRef, defineComponent, onMounted } from "vue";
|
|
29
|
+
import { useDarkMode } from "./dark-mode";
|
|
30
|
+
|
|
31
|
+
export default defineComponent({
|
|
32
|
+
props: {
|
|
33
|
+
bgLight: {
|
|
34
|
+
type: String as () => CssClasses,
|
|
35
|
+
default: "bg-surface-50",
|
|
36
|
+
},
|
|
37
|
+
bgDark: {
|
|
38
|
+
type: String as () => CssClasses,
|
|
39
|
+
default: "bg-surface-900",
|
|
40
|
+
},
|
|
41
|
+
textLight: {
|
|
42
|
+
type: String as () => CssClasses,
|
|
43
|
+
default: "text-surface-50",
|
|
44
|
+
},
|
|
45
|
+
textDark: {
|
|
46
|
+
type: String as () => CssClasses,
|
|
47
|
+
default: "text-surface-900",
|
|
48
|
+
},
|
|
49
|
+
width: {
|
|
50
|
+
type: String as () => CssClasses,
|
|
51
|
+
default: "w-12",
|
|
52
|
+
},
|
|
53
|
+
height: {
|
|
54
|
+
type: String as () => CssClasses,
|
|
55
|
+
default: "h-6",
|
|
56
|
+
},
|
|
57
|
+
ring: {
|
|
58
|
+
type: String as () => CssClasses,
|
|
59
|
+
default: "ring-[1px] ring-surface-500/30",
|
|
60
|
+
},
|
|
61
|
+
rounded: {
|
|
62
|
+
type: String as () => CssClasses,
|
|
63
|
+
default: "rounded-token",
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
setup(props, { attrs }) {
|
|
67
|
+
const { initializeMode, setModeCurrent, setModeUserPrefers, currentMode, MODE } = useDarkMode();
|
|
68
|
+
|
|
69
|
+
onMounted(() => {
|
|
70
|
+
initializeMode();
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
const cTransition = `transition-all duration-[200ms]`;
|
|
74
|
+
const cTrack = "cursor-pointer";
|
|
75
|
+
const cThumb = "aspect-square scale-[0.8] flex justify-center items-center";
|
|
76
|
+
const cIcon = "w-[70%] aspect-square";
|
|
77
|
+
|
|
78
|
+
const svgPath = {
|
|
79
|
+
sun: "M361.5 1.2c5 2.1 8.6 6.6 9.6 11.9L391 121l107.9 19.8c5.3 1 9.8 4.6 11.9 9.6s1.5 10.7-1.6 15.2L446.9 256l62.3 90.3c3.1 4.5 3.7 10.2 1.6 15.2s-6.6 8.6-11.9 9.6L391 391 371.1 498.9c-1 5.3-4.6 9.8-9.6 11.9s-10.7 1.5-15.2-1.6L256 446.9l-90.3 62.3c-4.5 3.1-10.2 3.7-15.2 1.6s-8.6-6.6-9.6-11.9L121 391 13.1 371.1c-5.3-1-9.8-4.6-11.9-9.6s-1.5-10.7 1.6-15.2L65.1 256 2.8 165.7c-3.1-4.5-3.7-10.2-1.6-15.2s6.6-8.6 11.9-9.6L121 121 140.9 13.1c1-5.3 4.6-9.8 9.6-11.9s10.7-1.5 15.2 1.6L256 65.1 346.3 2.8c4.5-3.1 10.2-3.7 15.2-1.6zM352 256c0 53-43 96-96 96s-96-43-96-96s43-96 96-96s96 43 96 96zm32 0c0-70.7-57.3-128-128-128s-128 57.3-128 128s57.3 128 128 128s128-57.3 128-128z",
|
|
80
|
+
moon: "M223.5 32C100 32 0 132.3 0 256S100 480 223.5 480c60.6 0 115.5-24.2 155.8-63.4c5-4.9 6.3-12.5 3.1-18.7s-10.1-9.7-17-8.5c-9.8 1.7-19.8 2.6-30.1 2.6c-96.9 0-175.5-78.8-175.5-176c0-65.8 36-123.1 89.3-153.3c6.1-3.5 9.2-10.5 7.7-17.3s-7.3-11.9-14.3-12.5c-6.3-.5-12.6-.8-19-.8z",
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
const onToggleHandler = () => {
|
|
84
|
+
const toggle = !currentMode.value;
|
|
85
|
+
setModeUserPrefers(toggle);
|
|
86
|
+
setModeCurrent(toggle);
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
type OnKeyDownEvent = KeyboardEvent & { currentTarget: EventTarget & HTMLDivElement };
|
|
90
|
+
const onKeyDown = (event: KeyboardEvent) => {
|
|
91
|
+
if (["Enter", "Space"].includes(event.code)) {
|
|
92
|
+
event.preventDefault();
|
|
93
|
+
(event as OnKeyDownEvent).currentTarget.click();
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
const trackBg = computed(() =>
|
|
98
|
+
currentMode.value === MODE.LIGHT ? props.bgLight : props.bgDark
|
|
99
|
+
);
|
|
100
|
+
const thumbBg = computed(() =>
|
|
101
|
+
currentMode.value === MODE.LIGHT ? props.bgDark : props.bgLight
|
|
102
|
+
);
|
|
103
|
+
const thumbPosition = computed(() =>
|
|
104
|
+
currentMode.value === MODE.LIGHT ? "translate-x-[100%]" : ""
|
|
105
|
+
);
|
|
106
|
+
const iconFill = computed(() => {
|
|
107
|
+
return currentMode.value === MODE.LIGHT ? props.textLight : props.textDark;
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
const classesTrack: ComputedRef<string> = computed(() => {
|
|
111
|
+
return `${cTrack} ${cTransition} ${props.width} ${props.height} ${props.ring} ${
|
|
112
|
+
props.rounded
|
|
113
|
+
} ${trackBg.value} ${attrs.class ?? ""}`;
|
|
114
|
+
});
|
|
115
|
+
const classesThumb: ComputedRef<string> = computed(
|
|
116
|
+
() =>
|
|
117
|
+
`${cThumb} ${cTransition} ${props.height} ${props.rounded} ${thumbBg.value} ${thumbPosition.value}`
|
|
118
|
+
);
|
|
119
|
+
const classesIcon: ComputedRef<string> = computed(() => `${cIcon}`);
|
|
120
|
+
|
|
121
|
+
return {
|
|
122
|
+
classesTrack,
|
|
123
|
+
classesThumb,
|
|
124
|
+
classesIcon,
|
|
125
|
+
svgPath,
|
|
126
|
+
onToggleHandler,
|
|
127
|
+
onKeyDown,
|
|
128
|
+
currentMode,
|
|
129
|
+
iconFill,
|
|
130
|
+
};
|
|
131
|
+
},
|
|
132
|
+
});
|
|
133
|
+
</script>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { useDarkMode } from "./dark-mode/dark-mode";
|
|
2
|
+
import DarkModeSwitch from "./dark-mode/dark-mode.vue";
|
|
3
|
+
import MyUtil from "./MyUtil";
|
|
4
|
+
import { useTheme } from "./theme/theme";
|
|
5
|
+
import ThemeSwitcher from "./theme/theme-switcher.vue";
|
|
6
|
+
|
|
7
|
+
export { MyUtil, DarkModeSwitch, ThemeSwitcher, useDarkMode, useTheme };
|