#Import css into a variable
1 messages · Page 1 of 1 (latest)
Do you use a bundler or other build tool?
For types you need a .d.ts file as well:
declare module '*.css' {
const value: string;
export default value;
}
this is not possible by default with TypeScript, you can only import JS/TS, or JSON files
you need to use a different compiler/bundler, like esbuild
and as Jakob said, you'll also need a typing file, so that TS stops complaining about the import not being valid
I think this worked. Thanks.