UNPKG

design-token-inspector

Version:

UI components built for inspecting design tokens in a live application

15 lines (14 loc) 736 B
import { RawCssRuleWithIndex } from '../../types/css'; /** * Function to get all the CSS style rules that apply to a given element. * * Note: This is ALL the CSS rules that apply for an element, not the variables, * and not just the ones that are actually used for rendering the element (i.e., * this does not filter out rules that are overridden by more specific rules). * * @param el Element to fetch CSS rules for * @returns An array of objects containing the CSSStyleRule and its index in the stylesheet * that applies to the element. * Each object has the structure: { rule: CSSStyleRule, indexInStylesheet: number } */ export declare const getCssUsedByElement: (el: Element) => RawCssRuleWithIndex[];