Problem With Darkmode
-
Great plugin, thank you so much for this! I am trying to solve a little “glitch”, will be very thankful if any help is possible.
What I want to achieve. I am using “Cards Compact” theme. Added some simple CSS tweaks (I have my adjusted theme in my site theme folder). My only problem is that “wpp list li a” is rgb (85, 85, 85). But I want this black, not gray (readability, contrast).Simple you say. Just put CSS into your Cards Compact theme saying they should be black. OK, done. But now, I have problem with Dark Mode plugin. After switching to dark, the titles stay black. OK, never mind, we can just put somewhere CSS with a selector saying “If dark mode is on, just change the color to gray.” The selector is easy, “html.wp-dark-mode-active” and we can add !important, of course. Well, this is not possible, because this plugin’s CSS is enclosured under Shadow DOM. So, when we are in the shadow DOM, we do not know, if outside is something like “html.wp-dark-mode-active”. And also, from outside, we know that dark mode is active, but we can not tweak CSS encapsuled in Shadow DOM. Ops, seams this can not be solved.
There is a 2 year old workaround trick. See here please: workaround at the end. The workaround says 1) put your added CSS to default theme. 2) Set widget to theme “None”. This should at the same time A) switch off the Shadow DOM closure so we can see the dark mode is on from within the plugin, B) use anyways the default Cards Compact theme.
OK, I tried this wild solution (if the plugin will be updated, could the default theme be overritten and the adjustmens lost?). Anyways, it did not work. The reason is if theme is set to “None” it actually does not use the default Cards Compact theme anymore (if I understand it right), so we are missing many lines of CSS here.
See my screenshots, please:
screenshotsThe first image is theme “None” and the second one is theme “Cards Compact”. The style.css file is exactly the same in default Cards Compact theme and also my customized Cards Compact theme.
I even tried to use
`add_filter(‘wpp_additional_theme_styles’, ‘wpp_additional_css_rules’
and add the whole contents of style.css there but no effect.
I spent many hours on this and did not find a solution…any idea how to solve?
The page I need help with: [log in to see the link]
The topic ‘Problem With Darkmode’ is closed to new replies.