Skip to content

getCssPropertyValue

Reads a CSS property from the element’s computed style.

Import:

import 'obsidian-test-mocks/setup';

Signature:

function getCssPropertyValue(this: Element, property: string, pseudoElement: string | undefined): string

Parameters:

Parameter Type Description
this Element
property string The CSS property name, such as --font-text-size.
pseudoElement string | undefined The pseudo-element to read from, such as ::before.

Returns: string — The computed value, or an empty string when the property is not set.