Vanilla extract in browser environment for on-demand css generation #1645
ziyadshaikh013
started this conversation in
Show and tell
Replies: 0 comments
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.
-
First of all Thank you! for this amazing library,
A while ago I was exploring ways to generate css on demand based on maybe an API response or json schema stored in a database, I knew vanilla extract converts js/ts to css so I started digging little deeper and explored it's source code, which is by the pretty well written so even though it's complicated, it's easy to follow and understand.
After exploring a bit I realised that it's internals are just javascript and can be used in any js environment even browser, so I create a PoC where given a style or theme object, it can generate css on demand in browser. This seems counter productive given the nature of this library but for apps with micro-sites or vendor site setup where each client can configure styling or look and feel of app this can be very useful. After this possibilities are endless you can store the generated css in a file and upload to cloud and then fetch it later, create a UX that shows live preview using browser environment and on save generate actual css which can be loaded for each vendor.
Github repository - https://github.com/ziyadshaikh013/vanilla-extract-browser
Beta Was this translation helpful? Give feedback.
All reactions