UNPKG

@sujalchoudhari/solaris-ui

Version:

A UI framework to create HTML pages with just JavaScript.

37 lines (36 loc) 1.21 kB
import Style from "../components/styles"; /** * The StyleManager class manages styles that are added to the page dynamically. */ export default class StyleManager { /** * An array of styles that have been added to the page. */ static styles: Style[]; /** * Adds a style to the page. * @param {Style} style - The style to add. */ static addStyle(style: Style): void; /** * Removes a style from the page. * @param {Style} style - The style to remove. */ static removeStyle(style: Style): void; /** * Returns the CSS text for all styles that have been added to the page. * @returns {string} - The CSS text for all styles. */ static toString(): string; /** * Checks if a style has already been added to the page. * @param {Style} style - The style to check. * @returns {boolean} - true if the style has already been added, false otherwise. */ static isStyleAdded(style: Style): boolean; /** * Returns an array of all external styles that have been added to the page. * @returns {Array<Style>} - An array of all external styles. */ static getExternalStyles(): Array<Style>; }