Theming component 🎨 #856
Replies: 4 comments 6 replies
-
It is a missing feature and I think can be very useful. |
Beta Was this translation helpful? Give feedback.
-
I'd put the following cases as a validational:
|
Beta Was this translation helpful? Give feedback.
-
Interesting concept 👍 what is the advantage over using CSS classes defining variables? |
Beta Was this translation helpful? Give feedback.
-
Introducing an idea to provide design system identities as components rather than esm that apply styles (css variables only) on the html scope. <!-- theme ideally would be integrated only once in an app -->
<vwc-theme theme="light">
<!-- typography ideally would be integrated only once in an app -->
<vwc-typography>
<vwc-sizing>
<main>
<vwc-top-app-bar>
<!-- theme toggle button would set the closest vwc-theme ancestor (if exist) -->
<vwc-theme-toggle-button slot="action"></vwc-theme-toggle-button>
</vwc-top-app-bar>
<h1>Welcome to our app</h1>
<!-- notice this deeper scope and second usage of sizing to apply large size on button instead of the current button API 'enlarged' button as a low level component can drop support of dense / enlarged properties, rather would refer its block-size value to a css variable provided by `vwc - sizing` (it can obviously default to some hardcoded value of choice) -->
<vwc-sizing size="large">
<vwc-button>Click me</vwc-button>
</vwc-sizing>
</main>
<aside>
<vwc-alternate>
<!-- aside content -->
</vwc-alternate>
</aside>
</vwc-sizing>
</vwc-typography>
</vwc-theme> disadvantages:
|
Beta Was this translation helpful? Give feedback.
-
Develop a wrapper component to apply theming to inner components
Apply css variables only to define theming context
note that any css styling props will not apply to tags deeper than 1st level nesting
this has been in plan in the past but was dropped due to the barriers mentioned above.
the updated plan is to only provide the theming exactly as scheme does but in a component modular practice
Note: Fast components (Microsoft's), Spectrum (Adobe) provide that same practice
This is a 1 stop shop for
Beta Was this translation helpful? Give feedback.
All reactions