Skip to content

bgtfw-palette-selector controls are not updating their values when color palette is changed #108

@jamesros161

Description

@jamesros161

When a bgtfw-palette-selector control is set, the value is set as such color2:rgb(255,255,255) instead of just saving the color palette position.

When the color palette changes, and the new rgb value of that color is different than what is saved in the theme mod for these controls, the rgb value is not changed. For example, if you change color palette position 2 to rgb( 33, 33, 33 ), the value SHOULD become color2:rgb(33,33,33) but it doesn't. It stays set to color2:rgb(255,255,255) . MOST places this isn't that big of a deal, because the color position can be used for the generated CSS values ( ie color: var(--color-2) ). However, when the rgb color itself is needed ( ie, for opacity effects or for hover effects ), this presents a problem.

This has been addressed on a control by control basis, by obtaining the rgb value from the palette at runtime, however, something needs to be done so that whenever the theme_mod changes, all bgtfw-palette-selector controls can be updated systematically.

This will need to be implemented two ways:

  1. JS implementation so that the changes can be previewed in the customizer
  2. PHP implementation on customizer publish

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions