Custom properties outputting twice
rileymacisaac opened this issue · comments
Hey there,
Not a big issue but I noticed that my CSS custom properties were outputting twice and I couldn't figure out why for a while.
After digging into some of the gorko code, I noticed that it's theme related. I'm not using themes, nor have any mention of it in my config.
I added an empty themes value to my $gorko-config
and that seemed to do the trick.
Example:
$gorko-config: (
"css-vars": (
"themes": (),
...
),
),
Hidden away in the readme is this:
When you enable CSS custom properties, Gorko will generate the :root blocks for you, but sometimes, you might want those :root blocks not to be rendered. This is common if you are generating more than one CSS bundle. To disable the generation of CSS Custom Property blocks, set $generate-css-vars = false;, before you import Gorko, just like generating utility classes on demand.
That should do the job for you!
Sadly that actually renders no css-vars for me at all, and setting themes to empty still works best for me. Perhaps I'll have to dig into my config a little more, but from what I can tell I am only importing gorko once.
I see this issue is closed, but I thought I'd mention that I'm getting the same results as @rileymacisaac described with a pretty close setup to what is shown in the documentation. Just in case it helps, I'm using sass "sass": "^1.50.1"
and "gorko": "^0.9.1"
.
@shroy happy to hear I am not alone haha. I'm using a different version of sass, but same gorko version.
"sass": "^1.49.7"