vuetify icon indicating copy to clipboard operation
vuetify copied to clipboard

[Feature Request] Export color pack in Vuetify 3

Open RafDevX opened this issue 2 years ago • 3 comments

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';

RafDevX avatar Dec 29 '22 17:12 RafDevX

Any workaround for the moment? Also have Module not found: Error: Can't resolve 'vuetify/lib/util/colors'.

gaetandezeiraud avatar Feb 17 '23 22:02 gaetandezeiraud

Interesting; I've been doing this for a while now:

import colors from 'vuetify/lib/util/colors.mjs';

Seems to work for me.

ttonyh avatar May 04 '23 17:05 ttonyh

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)

Bassadin avatar May 04 '23 19:05 Bassadin

import colors from "vuetify/lib/util/colors"; WorksForMe:tm:; there's just no typescript defs image

SIGSTACKFAULT avatar May 21 '23 20:05 SIGSTACKFAULT

https://vuetifyjs.com/en/styles/colors/#javascript-color-pack

You can do

import colors from 'vuetify/util/colors'

hupling avatar Jan 10 '24 10:01 hupling