Skip to content

[Bug]: getComputedStyleByKey does not support CSS custom properties (--*) #8682

Description

@linxs0211

System Info

Not environment-specific. This issue concerns the behavior of the existing MTS API.

Details

The existing MTS API getComputedStyleByKey can read regular CSS properties, but it does not return the computed value for CSS custom properties (--*).

CSS custom properties should be readable through the same API. The returned value should reflect the computed value in the target element context, including inheritance and var() substitution.

Reproduce Steps

  1. Define a CSS custom property on an element:

    .target {
      --seed-color-fg-brand: #3370ff;
    }
  2. Use the MTS API to read --seed-color-fg-brand with getComputedStyleByKey.

  3. Observe that the API does not return #3370ff.

Expected Behavior

getComputedStyleByKey returns the computed value of the CSS custom property.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions