@eccenca/gui-elements
Version:
GUI elements based on other libraries, usable in React application, written in Typescript.
29 lines (28 loc) • 1.23 kB
TypeScript
/**
* Based on CSS Tricks tutorial.
* @see https://css-tricks.com/how-to-get-all-custom-properties-on-a-page-in-javascript/
*/
interface getLocalCssStyleRulesProps {
cssRuleType?: "CSSStyleRule";
selectorText?: string;
}
interface getLocalCssStyleRulePropertiesProps extends getLocalCssStyleRulesProps {
propertyType?: "all" | "normal" | "custom";
}
interface getCustomPropertiesProps extends getLocalCssStyleRulesProps {
filterName?: (name: string) => boolean;
removeDashPrefix?: boolean;
returnObject?: boolean;
}
export default class CssCustomProperties {
getterDefaultProps: getCustomPropertiesProps;
customprops: {};
constructor(props?: getCustomPropertiesProps);
customProperties: (props?: getCustomPropertiesProps) => string[][] | Record<string, string>;
static listLocalStylesheets: () => CSSStyleSheet[];
static listLocalCssRules: () => CSSRule[];
static listLocalCssStyleRules: (filter?: getLocalCssStyleRulesProps) => CSSStyleRule[];
static listLocalCssStyleRuleProperties: (filter?: getLocalCssStyleRulePropertiesProps) => string[][];
static listCustomProperties: (props?: getCustomPropertiesProps) => string[][] | Record<string, string>;
}
export {};