This PR changes the internal API for enhance style transforms. It makes the following changes:
Adds a context property to the internal API so that the style transform knows if it was called from a template or from in the SSR markup
Runs the SSR style transform from in the processCustomElements function and collects the resulting styles to be added to the head.
This allows for instance and component unique styles if needed.
Users write styles as if they are targeting the shadowDOM and these tags can be transformed to work with the lightDOM for SSR.
These styles are processed with context="markup" so that the style transform script knows that the output should be global css rather than css in a shadowDOM.
The collected styles for SSR are deduplicated and merged into one <style> tag added to the document head.
This PR changes the internal API for enhance style transforms. It makes the following changes:
context
property to the internal API so that the style transform knows if it was called from a template or from in the SSR markupprocessCustomElements
function and collects the resulting styles to be added to the head.context="markup"
so that the style transform script knows that the output should be global css rather than css in a shadowDOM.<style>
tag added to the document head.