[go: up one dir, main page]

Page MenuHomePhabricator

CSS sanitizer refuses TemplateStyles variable assignment to border-color but does permit background-color
Open, Needs TriagePublicFeature

Description

Steps to replicate the issue

What happens?:

  • Sanitizer refuses publishing, complaining about such lines.
  • Sanitizer will accept assignment to various other properties.
  • Sanitizer does accept background-color: var(--border-color-progressive,#3366cc);
  • Sanitizer does accept color: var(--color-progressive--hover,#447ff5);

What should have happened instead?:

  • Sanitizer should accept border-color: var();
  • There is no higher risk of border-color rather than background-color

Event Timeline

You can work around by setting border-top-color, border-bottom-color, etc independently.

border: 1px solid var( --border-color-base, #a2a9b1 ); also works as advised in T368637#9942128.

I don't get why the security issue of variable concatenation made it impossible to also set border-color: var(--border-color-base) without any additional concatenation. This, to me, seems like an easy thing to allow right now without having the perfect to be an enemy of the good.

border: 1px solid var( --border-color-base, #a2a9b1 ); also works as advised in T368637#9942128.

If the components are split in various declaractions, e.g. a common 1px and other like padding as common ancestor, later various particular colours, e.g background + border + foreground appearance, there is no shorthand border: available.

Izno changed the subtype of this task from "Bug Report" to "Feature Request".Mon, Oct 28, 3:07 AM
Izno moved this task from Backlog to External (css-sanitizer) on the TemplateStyles board.

For now this is intended behavior, see T361934#9692764

Could someone explain why the sanitizer e.g. cannot accept a border-color rule with only a single var(...) as its value?