tomusborne / generateblocks

GenerateBlocks is a small collection of lightweight WordPress blocks that can accomplish nearly anything.
https://generateblocks.com
188 stars 18 forks source link

Use FSE CSS variables in GB Color Picker #1214

Open diggeddy opened 3 months ago

diggeddy commented 3 months ago

FSE themes use CSS variables for their colors. And WP will return the variable in the color property for any core blocks. This does not work in GenerateBlocks, where it returns the static variable.

To replicate:

  1. use Twenty24 Theme
  2. add a Group block and Container Block, give them both a background color from the theme pallet
  3. inspect the results.

GB block outputs the the hex color in the bakcground property eg. #b1c5a4 and not the var eg. var(--wp--preset--color--accent-4)