will generate such CSS:
.block.svelte-3zrlxr{display:block}
.block is my own custom class name
.svelte-3zrlxr is auto-generated class name for whole component
But this is not enough!
This was a "cheap" solution, that have side effects!
Today... custom class names (like block) can collide with GLOBAL class names.
This means, that custom used classes are simple not isolated!
Describe the proposed solution
Svelte like solution. Example code:
(module was added to not break compatibility)
Describe the problem
First... Vue has this functionality - I miss in Svelte https://vuejs.org/api/sfc-css-features.html#css-modules https://github.com/vitejs/vite/discussions/7447#discussioncomment-4128874
Code like this in Svelte:
will generate such CSS:
.block.svelte-3zrlxr{display:block}
.block is my own custom class name .svelte-3zrlxr is auto-generated class name for whole component
But this is not enough! This was a "cheap" solution, that have side effects! Today... custom class names (like block) can collide with GLOBAL class names. This means, that custom used classes are simple not isolated!
Describe the proposed solution
Svelte like solution. Example code: (module was added to not break compatibility)
or convert (auto obfuscate)
Both should be possible
Alternatives considered
CSS-modules work today. They obfuscate class names. Vite support CSS modules: https://vitejs.dev/guide/features#css-modules
If i write code like this, it works:
It generate this class name for "block":
_block_1xra7_1
But now, I need to split component in separate files. I search a way to use