Closed Scott-MacD closed 6 years ago
Was doing some more thorough investigating to possibly contribute a PR and realized this already works as style.blockSize
, the actual example I was using had a hyphen in the variable name and didn't show up in dev tools.
It would be nice if this exported the same variables stylable already shares to other stylesheets to the JS interface as well.
Right now there are two work arounds for this, the first one being to maintain the variables in two separate places (once in the JS, and once in the CSS), which has issues which making sure you maintain both files, as well as these variables may be linked specifically to a theme, which the JS should not care about.
The other workaround is to have the css use the stylable vars to create css custom properties, which you could then read from JS using
getComputedStyle
, which is slower do to us having to read from the DOM and has potential for cascade issues.Really looking for a way to directly access the exported vars from the stylesheet such as: