ezyang / ezyang/htmlpurifier

How to keep CSS variable

Open
#353 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
3.4k
Forks
361
Avg merge
3d 41m
Merged PRs (30d)
2

Description

Hello,

How can I configure the library to sanitize style attribute (remove duplicate, etc...) but keep CSS variable please ?
If I give the following html, it removes the style property color because it considers that it's not a valid color I guess.

<span style="color: var(--color-c16);">Hello World !</span>

Thanks !

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files, tests, or entry points are named. Start by locating the style-attribute sanitizer and its color validation, then verify how CSS custom properties are handled; done means sanitizing the example preserves color: var(--color-c16) without weakening other style checks.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
security
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.