Bug 241475

Summary: Allow keywords in CSS custom property fallback
Product: WebKit Reporter: Shaw Jia <xiaozj>
Component: CSSAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: koivisto, simon.fraser, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Safari 15   
Hardware: All   
OS: All   

Description Shaw Jia 2022-06-09 10:43:49 PDT
Allow the use of keywords in custom property fallback.

One useful use case is to allow the use of "revert" to use user-agent stylesheet value as fallback.

Ex: * {display:var(--display,revert); --display:initial}

The example may seem redundant, but becomes useful with more complex logic such as responsive variants, modular scale for font sizes etc.

Firefox already supports this, Chrome is in the process of fixing it in https://bugs.chromium.org/p/chromium/issues/detail?id=1105782
Comment 1 Radar WebKit Bug Importer 2022-06-10 10:08:02 PDT
<rdar://problem/94822036>