-
-
Notifications
You must be signed in to change notification settings - Fork 834
Feature request: allow the use of a stylesheet as adoptedStylesheets in component libraries #1967
Copy link
Copy link
Closed
Labels
Feature: Want this? Upvote it!This PR or Issue may be a great consideration for a future idea.This PR or Issue may be a great consideration for a future idea.
Description
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:
- manually include the global stylesheet in all components of the library, which means that all components will now include the stylesheet itself which in turn can cause a very quick augmentation of the bundle size.
- manually configure a Constructable Stylesheet system, in order to make all your components adopt the stylesheet.
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 😄
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Feature: Want this? Upvote it!This PR or Issue may be a great consideration for a future idea.This PR or Issue may be a great consideration for a future idea.