kirki icon indicating copy to clipboard operation
kirki copied to clipboard

Extend Color Sanitization to Support CSS Variables

Open AdamForst opened this issue 2 years ago • 0 comments

This pull request updates the color sanitization regex within Color_Palette.php to support CSS variables. By integrating patterns that match CSS variable definitions (--variable-name) and usages (var(--variable-name)), we enable developers to use CSS variables in color settings seamlessly. This enhancement aligns with modern CSS practices, offering greater flexibility and theming capabilities.

The update carefully extends the existing regex pattern, preserving all previous functionalities and security measures. It has been thoroughly tested to ensure compatibility with standard color formats and CSS variables.

  • Allows the use of CSS variables in theme and plugin development within Kirki's color controls.
  • Maintains backward compatibility and security while embracing modern web standards.
  • Enhances theming capabilities by supporting dynamic color schemes.

AdamForst avatar Mar 24 '24 11:03 AdamForst