Replies: 2 comments
-
With all the feedback, we’re talking about giving you guys the more simple “just reach in and get the values” version of this earlier. So stay tuned for an update on that asap. We’ll post it here when it comes out. |
Beta Was this translation helpful? Give feedback.
-
Thanks for your feedback! Much appreciated. I realised this may not have been worthy of a separate discussion as it looks like this is mostly covered in #38 The first thing I tried to do was get the values directly from the settings so I can contruct the CSS etc myself, once that is available I will be able to adopt these new settings! |
Beta Was this translation helpful? Give feedback.
-
👋 Hello! William here from Switch
The new style settings in the theme editor look great UI-wise, but from a development perspective we will be unable to implement this in its current state as we can't access the CSS variables directly.
I had my hopes up as I was reading the documentation and thought that by default it would just output CSS variables (or custom properties):
I mis-read it and realised it just meant CSS properties in general and not variables.
However you are using CSS variables under the hood, setting from on the
html
element and then overriding those when using theclass_list
filter. What we would prefer to do instead is output the variables directly onto the section inside a style tag under the ID of the section.e.g. something like this:
That would output something like this.. (using section ID as selector iD):
OR
inline the CSS variables inside the element
Which would output:
CSS variables are a critical component of CSS now, and are framework agnostic - all developers would benefit from being able to access these variables directly so they can utilise these new UI controls seamlessly into their existing stylesheets. It would also help solve some of the issues around specificity mentioned in #38.
As it currently stands (unless I'm mistaken), I can't even get just the values from these style settings.. the first thing I tried to do was just read the values and construct my own CSS variables but it seems that is not supported.
Beta Was this translation helpful? Give feedback.
All reactions