Astro style css string #1046
Replies: 3 comments 5 replies
-
Such a feature would be very useful, though there should also be a corresponding way to transfer the component-generated css and/or js into whatever mechanism Astro is using to bundle css and js into the final page output under normal rendering conditions (without the container API). |
Beta Was this translation helpful? Give feedback.
-
I have tried using While getting access to the scripts and CSS would be very useful for preview, I don't really like this solution for a final build. It would be the unprocessed scripts and CSS, from what I can tell. So, in addition to something like what I am doing above, to access the unprocessed CSS/scripts, something like you propose would be great, something that returns the processed CSS/scripts. Only change I would make is to the names. So:
|
Beta Was this translation helpful? Give feedback.
-
Body
Summary
[vite-id]?[framework]&type=style&[astro:'index=0&']lang.css&inline
- gets style css/scss stringit would be useful to have this working, currently get an error about syntax from ast parser.
also allowing this enables css retrieval for astro, svelte, ect... for container api.
svelte does this for their own styles - sveltekit
Background & Motivation
#462, #916, #533
I have been having an use with accessing css to render my component correctly and other users have expressed interest in being able to access the styles and scripts of rendered astro component with slots.
Goals
Example
Beta Was this translation helpful? Give feedback.
All reactions