-
Notifications
You must be signed in to change notification settings - Fork 158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Runtime Theming #2362
Comments
I tried to gather some nice articles on how css-in-js can help vs. why it could be a bad idea. Here are some arguments about why it could be bad. Why it could help: Some theming examples: TL;DR Main benefits are having styles closely tied to components. Styles are included only if the component is rendered. Theming is possible on runtime. Components can easily extend each other. The CSS is not going anywhere, it's still there just inside of js. |
Needs to be tested:
Needs to be implemented in POC:
|
Result of research:Css-in-jsFor our use case, this approach seems like too much effort for not so much benefits. CSS custom properties (CSS variables)This approach proved itself quite promising. Theming works fine for both components inside the SPA and for web components. The only issues seem to be IE11. Since it's not natively supported we need to transpile the code. In my research, I used css vars ponyfill which worked with components which are already in SPA. The problem was in the web components though where I haven't managed to get it working. Also, there was a performance issue when using Seems like we would need to implement some special solution for IE11 then. One idea is to have the CSS file containing the variables manually transpiled (probably some script to do this). Other option could be to do a fork of ODS and manually adjusting the theme. CSS variables provide an option to specify a fallback which could be used for the default theme. |
As discussed with @DeepDiver1975 and @felixboehm individually, we want to invest in new technologies and not let IE 11 stop us from doing it. So we should move on with the CSS custom attributes approach.
|
The minimum we should aim for in the context of the "ocis extensions" epic is to have everything in place so that extensions can start using CSS custom attributes where needed. In general I'd expect extensions to only work with the ODS but we know that sometimes there are exceptions where local styles are used. So the latter should be able to use the CSS custom attributes. |
Requirements
Themable topics
Requirements
The text was updated successfully, but these errors were encountered: