#65561 closed defect (bug) (fixed)
Styles: preserve important gradient declarations for statu
| Reported by: | ramonopoly | Owned by: | ramonopoly |
|---|---|---|---|
| Priority: | normal | Milestone: | 7.1 |
| Component: | Editor | Version: | trunk |
| Severity: | normal | Keywords: | has-patch has-unit-tests gutenberg-merge |
| Cc: | Focuses: |
Description
Problem: State styles currently append !important directly to CSS values before Style Engine sanitization. For gradient values, this can cause safecss_filter_attr() to reject otherwise valid declarations, so responsive/state gradient CSS may not be emitted.
Solution: Store !important as declaration metadata in the Style Engine, preserve it through rule generation and optimization, and append it only after sanitization.
Attachments (1)
Change History (7)
This ticket was mentioned in PR #12361 on WordPress/wordpress-develop by @ramonopoly.
6 weeks ago
#1
#2
@
6 weeks ago
@sachinrajcp123 this ticket already has a patch on https://github.com/WordPress/wordpress-develop/pull/12361. Your patch looks like a copy of that, so I think we can safely discard it. Thanks.
@wildworks commented on PR #12361:
5 weeks ago
#3
I would appreciate it if you could proceed with this PR and commit it in time for the 7.1 Beta1 release on July 15.
@ramonopoly commented on PR #12361:
4 weeks ago
#4
I'll rebase this after https://github.com/WordPress/wordpress-develop/pull/11384 lands and it should be good to go
@ramonopoly commented on PR #12361:
4 weeks ago
#6
Committed in hr62720 / dfff16ff7ef0a06623a35c2aa1743d130b134cc0
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Backport of https://github.com/WordPress/gutenberg/pull/79568
## What
State styles currently append !important directly to CSS values before Style Engine sanitization. For gradient values, this can cause safecss_filter_attr() to reject otherwise valid declarations, so responsive/state gradient CSS may not be emitted.
## How
Store !important as declaration metadata in the Style Engine, preserve it through rule generation and optimization, and append it only after sanitization.
Trac ticket: https://core.trac.wordpress.org/ticket/65561
## Use of AI Tools
AI assistance: Yes
Tool(s): GitHub Copilot, ChatGPT
Model(s): GPT-5.5
Used for: Initial architectural discussion. Unit test scaffolding.