@web-atoms/core
Version:
54 lines • 1.67 kB
TypeScript
declare class StyleFragment {
static newStyle({ selector, content }: {
selector?: string;
content?: string;
}): Partial<StyleFragment>;
private selector;
private content;
private id?;
private description?;
private order;
constructor({ selector, content }: {
selector: any;
content: any;
});
expand(selector?: any): string;
toString(): string;
/**
* Installs style globally, without appending it with any class
* @param selector global selector if any
* @param id id of style element
* @param description description if any
*/
installGlobal(selector?: string, id?: string, description?: string): void;
/**
* Installs style with an auto generated class name
* @param prefix prefix of an element if any
* @param description description if any
* @returns string
*/
installLocal(prefix?: string, description?: string): string;
withId(id: string): this;
withDescription(description: string): this;
/**
* Order of installation.
*
* @param order low | medium | high - default is low
* @returns
*/
withOrder(order: "low" | "medium" | "high"): this;
}
export type IStyleFragments = {
[key: string]: StyleFragment;
};
export type IStyleFragmentSet = {
[key: string]: IStyleFragments;
};
declare const styled: {
readonly styles: IStyleFragmentSet[];
css: (t: TemplateStringsArray, ...a: any[]) => Partial<StyleFragment>;
add(x: IStyleFragmentSet): void;
};
export default styled;
export declare const svgAsCssDataUrl: (text: string) => string;
//# sourceMappingURL=styled.d.ts.map