You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The new Greenwood website is piloting a plugin for supporting a very basic implementation of CSS Modules ™️ optimized for providing a nice co-located CSS DX in particular for Light DOM Web Components used for static templating.
Would strip out the import statement and add the CSS as a <style> tag to the HTML page, including for SSR, leaving you with something like this in your final HTML
There are some patches needed for this too, so we should try and vet those first against Greenwood's test cases.
Details
As CSS Modules are a spec and can get quite complex, this should definitely be marked as experimental and YMMV, but did want something nice to compliment a .css first authoring experience with minimal fuss / happy path only support. The below are probably a couple things we can handle for the PR
// needs to reference the import name<h1class="${styles.heading}">Welcome to Greenwood!</h1>// as opposed toconst{ heading }=styles;<h1class="${heading}">Welcome to Greenwood!</h1>
Discussions
And these are probably better left to putting into a discussion
refactor to avoid having to use intermediate output file (I think this is needed for prerendering because things run in a Worker Thread? 🤔 )
conform to icss specification (leverage postcss-modules package?)
Summary
The new Greenwood website is piloting a plugin for supporting a very basic implementation of CSS Modules ™️ optimized for providing a nice co-located CSS DX in particular for Light DOM Web Components used for static templating.
Like a footer, for example
Would strip out the
import
statement and add the CSS as a<style>
tag to the HTML page, including for SSR, leaving you with something like this in your final HTMLDetails
As CSS Modules are a spec and can get quite complex, this should definitely be marked as experimental and YMMV, but did want something nice to compliment a .css first authoring experience with minimal fuss / happy path only support. The below are probably a couple things we can handle for the PR
Discussions
And these are probably better left to putting into a discussion
prerendering
because things run in a Worker Thread? 🤔 )The text was updated successfully, but these errors were encountered: