vuetify
vuetify copied to clipboard
[Feature Request] Export color pack in Vuetify 3
Problem to solve
Vuetify 2 previously exported its colors (see here), such that
import colors from 'vuetify/lib/util/colors';
previously worked, allowing users to patch into Vuetify's colors and use them.
However, after upgrading to Vuetify 3, this is no longer the case, despite being listed in v3's documentation.
Proposed solution
Export the color pack, for example, as a named (non-default) export of Vuetify - e.g.:
export { colors } from '@/util/colors';
Any workaround for the moment?
Also have Module not found: Error: Can't resolve 'vuetify/lib/util/colors'.
Interesting; I've been doing this for a while now:
import colors from 'vuetify/lib/util/colors.mjs';
Seems to work for me.
import colors from 'vuetify/lib/util/colors.mjs';
This nets me the following error:
Could not find a declaration file for module 'vuetify/lib/util/colors.mjs'. '[...]ttn-locator-frontend/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/vuetify/lib/util/colors.mjs' implicitly has an 'any' type.
If the 'vuetify' package actually exposes this module, try adding a new declaration (.d.ts) file containing `declare module 'vuetify/lib/util/colors.mjs';`ts(7016)
import colors from "vuetify/lib/util/colors"; WorksForMe:tm:; there's just no typescript defs
https://vuetifyjs.com/en/styles/colors/#javascript-color-pack
You can do
import colors from 'vuetify/util/colors'