Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / CSS

dynamic-range-limit-mix() — weighted HDR limits

`dynamic-range-limit-mix()` mixes dynamic-range limits as shares of headroom above HDR Reference White and sets the element’s display limit.

Version: CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required

Syntax

dynamic-range-limit-mix( [ <'dynamic-range-limit'> && <percentage [0,100]> ]# )

dynamic-range-limit-mix() mixes dynamic-range limits as shares of headroom above HDR Reference White and sets the element’s display limit.

The example assigns nested dynamic-range-limit-mix(no-limit 10%, dynamic-range-limit-mix(standard 25%, constrained 75%) 20%, dynamic-range-limit-mix(constrained 10%, no-limit 30%) 20%). Chromium reports support as true, flattens it to dynamic-range-limit-mix(standard 10%, constrained 40%, no-limit 50%), and inherits that value to a child; one out-of-range component returns false.

Grammar: dynamic-range-limit-mix( [ <'dynamic-range-limit'> && <percentage [0,100]> ]# ).

Each pair combines standard, constrained, or no-limit with a percentage from 0% through 100%; weights normalize to 100% and nested mixes flatten into canonical order. The property inherits. The precise result in stops is intentionally not exposed for privacy, and the visible effect depends on an HDR display, so computed normalization and inheritance are the correct portable evidence.

Examples

const parent=document.createElement('div');
const child=document.createElement('div'); parent.append(child); document.body.append(parent);
parent.style.setProperty('dynamic-range-limit','dynamic-range-limit-mix(no-limit 10%, dynamic-range-limit-mix(standard 25%, constrained 75%) 20%, dynamic-range-limit-mix(constrained 10%, no-limit 30%) 20%)');
const supported=CSS.supports('dynamic-range-limit','dynamic-range-limit-mix(standard 25%, no-limit 75%)');
const computed=getComputedStyle(parent).getPropertyValue('dynamic-range-limit');
const inherited=getComputedStyle(child).getPropertyValue('dynamic-range-limit');
const invalid=CSS.supports('dynamic-range-limit','dynamic-range-limit-mix(standard 101%, no-limit 1%)');
console.log('supported='+supported+'; computed='+computed+'; inherited='+inherited+'; over-100-item='+invalid);

Result

supported=true; computed=dynamic-range-limit-mix(standard 10%, constrained 40%, no-limit 50%); inherited=dynamic-range-limit-mix(standard 10%, constrained 40%, no-limit 50%); over-100-item=false

`dynamic-range-limit-mix()` mixes dynamic-range limits as shares of headroom above HDR Reference White and sets the element’s display limit.

Sources