Add additional data to file scope #682
AndrewLeedham
started this conversation in
Ideas
Replies: 1 comment
-
On further reflection this wouldn't work because the script injection is dev only, so it would have no effect in production. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
From what I understand files scopes wrap a VE
.css.ts
file, meaning rules can be associated with said scope and grouped. This is then reflected in thedata-file
anddata-package
attributes on the injected<style>
tag.Would it be possible to allow additional attributes to be included for these
<style>
tags. My use case is includingtheme
andmode
attributes that I can then use to toggle stylesheets on and off given the current mode (light/dark) and theme.Thinking it could be exposed by the css package from the filescope module here: https://github.com/seek-oss/vanilla-extract/blob/master/packages/css/src/fileScope.ts. Perhaps the API could look something like this:
Beta Was this translation helpful? Give feedback.
All reactions