CSS optimization for DarkMode
Hi Everyone,
We are working to achieve Dark Mode functionality for our components. We have achieved the functionality ,but the point where we need suggestions/solutions is for optimizing CSS.
We have tried the below ways to include CSS :
1. Place the CSS in the clientlibs : placing the CSS in the clientlibs is creating an issue for us.The issue is
it generates <link> tag like this <link rel="stylesheet" type="text/css" href="mystyle.css"> . This is an issue because our components are used on email clients , and some of the email clients will not support this and it will break the component and the content.
2. Tried placing the CSS in Component's HTML (internal style sheet) - does not work as expected.
3. used wcmBindings- helper class, not working (found it on some article , very less knowledge about it.)
Our aim is to optimize CSS, or load the css classes dynamically for the component, so that the page load is faster, and when we author the page and check the page source, we should see only the CSS class relatable to us, instead of other CSS class, which is not required for that component.
Note : I've tried to explain the scenario in simpler way, if it's not clear, please ask more questions in comments. Thanks.
@kautuk_sahni