The discussion revolves around overriding border-radius variables in Discourse themes. Don initially struggled to override core variables in a remote theme, finding that !important was necessary. chapoi confirmed the issue and noted it only occurred when a local theme component with CSS was active. awesomerobot reproduced the problem, showing that the variables.scss file is injected into every theme, causing repeated :root declarations that override custom styles. pmusaraj explained that the :root declarations in variables.scss are the root cause and suggested moving them to a global location in core, which was confirmed by awesomerobot as a fix in a proposed PR.
I tried to override the new border-radius variables with a remote theme but it seems to the core :root variables are always prioritize. I can override these if I create a theme component in admin. Is there a way to override these with theme? What am I missing?
This tiny change is so useful thanks so much!
Ok it works as expected just my test site joking me.
I tried to add in scss/custom-variables.scss and import it to the common.scss. And I tried to add directly to common.scss too.
I just notice now it works if there is no other component (created in admin) assigned to the theme. If I create a component in admin with some css in common section. Then it won’t override the core root variables for me.
It works if the theme has no component or the component Common / CSS is empty.
I see. Very interesting. Thanks for the clear steps.
Will see what I come up with. At the moment I’m sceptical there will be a different solution that the !important you’re already using, but will be good to know how/why this is working like this.