WPCubed Product Support

Can you read CSS variables in WPTrichtext?

wpsupport

The WPTools CSS interpreter does not handle CSS variables, functions or media selectors.

#2 ♥ 0
2.4k Views 2 users read 1 min

Hello, I tried to read an .HTML file, then I wanted that when reading that file it would bring its CSS attributes but it didn't work, after a lot of trying I observed that when I did a p{color:red;} in my CSS styles it did change color, but when used p{color:var(--redColor);} didn't work. (--redColor:red😉, this is in html when viewed in any browser, obviously it is reflected but when it is read in wptools it is not, and I would like to know from now on I have to work my styles in the first way, Or is there a way to read the variables?

Code I use to read the html and CSS:

 WPRichText.LoadFromFile( 'D:\temporal\GC 2023\pruebacss\test.html', true, 'AUTO-csspath:"style.css"');
#1 ♥ 0