Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend Color Sanitization to Support CSS Variables #2527

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

AdamForst
Copy link

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.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant