ionic-team / stencil

A toolchain for building scalable, enterprise-ready component systems on top of TypeScript and Web Component standards. Stencil components can be distributed natively to React, Angular, Vue, and traditional web developers from a single, framework-agnostic codebase.
https://stenciljs.com
Other
12.5k stars 784 forks source link

Feature request: allow the use of a stylesheet as `adoptedStylesheets` in component libraries #1967

Open JMDidon opened 4 years ago

JMDidon commented 4 years ago

Stencil version:

 @stencil/core@1.7.4

I'm submitting a:

[ ] bug report [x] feature request [ ] support request

Current behaviour: Context: I'm working on a web component library.

Stencil allow the inclusion of globalStyles in the stencil.config.ts, which then is included in the dist after compilation. While this stylesheet is useful, a very common need in component libraries would be to be able to set some rules globally for all components (think fonts, reset.css, box-sizing: border-box, etc.).

Right now, the way to do it would be either to:

The second option seems better, and I feel that Stencil could handle this at build time instead of letting the developers implement a custom solution 😄

christophsaile commented 5 months ago

Hey, are there any plans to include this feature? @JMDidon did you manage to implement a custom soltuion that you can share?:)

christian-bromann commented 5 months ago

@christophsaile thanks for nudging on this issue. I've updated the label for it which slots it into our bucket of community features we consider to include in future roadmaps. Please subscribe to this issue to receive updates.

JMDidon commented 4 months ago

Hey @christophsaile!

I changed company kinda recently and haven't seen your message until today 😅 Basically we haven't worked on it as there were other prios, and as we had decided to drop support for ShadowDOM for accessibility reasons this feature lost a bit of its purpose to us.

Still, I think being able to declare an adoptedStylesheet for a component library would be very useful 🙂