@kuma-ui/sheet
Version:
🐻 Kuma UI is a utility-first, zero-runtime CSS-in-JS library that offers an outstanding developer experience and optimized performance.
48 lines (45 loc) • 1.32 kB
TypeScript
type ResponsiveStyle = {
base: string;
media: {
[]: string;
};
};
type SystemStyle = {
base: ResponsiveStyle["base"];
responsive: ResponsiveStyle["media"];
pseudo: {
key: string;
base: ResponsiveStyle["base"];
responsive: ResponsiveStyle["media"];
}[];
};
declare class Sheet {
private static instance;
private base;
private responsive;
private pseudo;
private css;
private constructor();
static getInstance(): Sheet;
private static getClassNamePrefix;
addRule(style: SystemStyle, isDynamic?: boolean): string;
private _addBaseRule;
private _addMediaRule;
private _addPseudoRule;
_processCSS(css: string): string;
/**
* parseCSS takes in raw CSS and parses it to valid CSS using Stylis.
* It's useful for handling complex CSS such as media queries and pseudo selectors.
*/
parseCSS(style: string): string;
removeDuplicates(): void;
getCSS(): string;
reset(): void;
}
/**
* The Sheet singleton class is responsible for managing the CSS rules, responsive
* styles, and pseudo-classes used by Kuma-UI. It provides methods to add and retrieve
* rules, and generates the final CSS output.
*/
declare const sheet: Sheet;
export { Sheet, SystemStyle, sheet };