@wordpress/style-engine
Version:
A suite of parsers and compilers for WordPress styles.
48 lines • 2.03 kB
TypeScript
/**
* Internal dependencies
*/
import type { CssRulesKeys, GeneratedCSSRule, Style, StyleOptions } from '../types';
/**
* Returns a JSON representation of the generated CSS rules.
*
* @param style Style object.
* @param options Options object with settings to adjust how the styles are generated.
* @param path An array of strings representing the path to the style value in the style object.
* @param ruleKey A CSS property key.
*
* @return GeneratedCSSRule[] CSS rules.
*/
export declare function generateRule(style: Style, options: StyleOptions, path: string[], ruleKey: string): {
selector: string | undefined;
key: string;
value: string;
}[];
/**
* Returns a JSON representation of the generated CSS rules taking into account box model properties, top, right, bottom, left.
*
* @param style Style object.
* @param options Options object with settings to adjust how the styles are generated.
* @param path An array of strings representing the path to the style value in the style object.
* @param ruleKeys An array of CSS property keys and patterns.
* @param individualProperties The "sides" or individual properties for which to generate rules.
*
* @return GeneratedCSSRule[] CSS rules.
*/
export declare function generateBoxRules(style: Style, options: StyleOptions, path: string[], ruleKeys: CssRulesKeys, individualProperties?: string[]): GeneratedCSSRule[];
/**
* Returns a CSS var value from incoming style value following the pattern `var:description|context|slug`.
*
* @param styleValue A raw style value.
*
* @return string A CSS var value.
*/
export declare function getCSSVarFromStyleValue(styleValue: string): string;
/**
* Capitalizes the first letter in a string.
*
* @param {string} str The string whose first letter the function will capitalize.
*
* @return string A CSS var value.
*/
export declare function upperFirst([firstLetter, ...rest]: string): string;
//# sourceMappingURL=utils.d.ts.map