Override preferredFormat not working

Created on 6 October 2023, over 1 year ago
Updated 9 October 2023, over 1 year ago

Problem/Motivation

When an option is already set in color-spectrum.jquery.js like preferredFormat: "rgb" you cannot override that option to another value, The default rgb is kept.

Steps to reproduce

Try to override preferredFormat from rgb to hex in your theme using style_options.yml , the value is not used because it gets overridden again.

options:
  bg_color:
    plugin: background_color
    label: Background Color
    method: css
    settings:
      appendTo: '.ui-dialog-content'
      showPalette: true
      allowEmpty: true
      preferredFormat: 'hex'

This prevents to solve this issue https://www.drupal.org/project/style_options/issues/3374997 โœจ Extra classes for Background Color plugin Needs work to have background classes with an identifier where the hex color code is to be appended to the background class name.

Proposed resolution

Remove preferredFormat: "rgb" in color-spectrum.jquery.js, set the option in [yourtheme].style_options.yml

๐Ÿ› Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

๐Ÿ‡ง๐Ÿ‡ชBelgium johanvdr

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024