near / react-on-chain

Improved execution layer for NEAR decentralized frontend components
https://roc-docs.near.dev/
23 stars 5 forks source link

🔷 [Epic] Support `@import` for CSS #383

Open mpeterdev opened 1 month ago

mpeterdev commented 1 month ago

Description

Many UI packages and libraries require importing an external stylesheet. We should support this as much as possible while maintaining component area of influence boundaries.

mpeterdev commented 1 month ago

Brainstorming

Could this be implemented as a LightningCSS Custom Transform similar to how we handle TS imports via our Babel plugin?

We could fetch the external stylesheet and inject all the rules under the top level .wrapper class of the component. One issue that comes to mind is handling the waterfall effect of importing a stylesheet which imports another and so on