forge
forge copied to clipboard
feat: opt-in global stylesheets to allow for CSS-only component styling
PR Checklist
Please check if your PR fulfills the following requirements:
- Tests for the changes have been added/updated: N/A
- Docs have been added/updated: Y
- Does this PR introduce a breaking change? N
- I have linked any related GitHub issues to be closed when this PR is merged? N
Describe the new behavior?
Introduces pre-built global stylesheets that developers can use in their applications/libraries to apply CSS classes to native HTML elements that offers visually consistent design to their functional JS-based counterparts. This opens the door for using Forge in pages where performance is of the utmost concern, or in static pages that don't have a build tool... etc.
Additionally, for basic components that do not offer any built-in JavaScript-based functionality such as cards for example, developers could opt for the CSS class on a native <div>
instead to reduce overhead if they desire.
It's important to note that even for simple elements such as <forge-card>
you still gain the benefit of guaranteed style encapsulation via the shadow DOM and the CSS-only solution mentioned above is just an alternative, not necessarily our recommended usage.
Additional information
The need for this has come up for requirements of highly performant pages such as login pages, general static redirect landing pages, and otherwise any multi-page or SSR-based pages where the overhead of upgrading custom elements and declarative shadow DOM restrictions is of concern.