free-style
- Version 5.0.1
- Published
- 47.3 kB
- No dependencies
- MIT license
Install
npm i free-styleyarn add free-stylepnpm add free-styleOverview
Make CSS easier and more maintainable by using JavaScript
Index
Functions
Classes
Interfaces
Type Aliases
Functions
Classes
class Cache
class Cache<T extends Container<any>> {}Implement a cache/event emitter.
constructor
constructor(changes?: Changes);property changeId
changeId: number;property changes
changes?: Changes;property children
protected children: T[];property counters
protected counters: Map<string, number>;property sheet
protected sheet: string[];method add
add: (style: T) => void;method merge
merge: (cache: Cache<any>) => this;method remove
remove: (style: T) => void;method unmerge
unmerge: (cache: Cache<any>) => this;class Rule
class Rule extends Cache<Rule | Style> implements Container<Rule> {}Implement rule logic for style output.
class Selector
class Selector implements Container<Selector> {}Selector is a dumb class made to represent nested CSS selectors.
constructor
constructor(selector: string);property selector
selector: string;method cid
cid: () => string;method clone
clone: () => Selector;method getStyles
getStyles: () => string;class Sheet
class Sheet extends Cache<Rule | Style> {}The FreeStyle class implements the API for everything else.
constructor
constructor(prefix: string, changes?: Changes);property prefix
prefix: string;method getStyles
getStyles: () => string;method register
register: (compiled: Compiled) => string;method registerStyle
registerStyle: (styles: Styles) => string;class Style
class Style extends Cache<Selector> implements Container<Style> {}The style container registers a style string with selectors.
Interfaces
interface Changes
interface Changes {}Propagate change events.
interface Compiled
interface Compiled {}Pre-registered container for cached styles and rules.
property displayName
displayName: string | undefined;property id
id: string;property rules
rules: CompiledRule[];property styles
styles: CompiledStyle[];interface CompiledRule
interface CompiledRule {}interface CompiledStyle
interface CompiledStyle {}interface Container
interface Container<T> {}Cache-able interface.
interface Styles
interface Styles {}Input styles object.
property $displayName
$displayName?: string;property $global
$global?: boolean;property $unique
$unique?: boolean;index signature
[selector: string]: PropertyValue | PropertyValue[] | Styles;Type Aliases
type PropertyValue
type PropertyValue = number | boolean | string | null | undefined;Valid CSS property values.
Package Files (1)
Dependencies (0)
No dependencies.
Dev Dependencies (9)
Peer Dependencies (0)
No peer dependencies.
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/free-style.
- Markdown[](https://www.jsdocs.io/package/free-style)
- HTML<a href="https://www.jsdocs.io/package/free-style"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 3761 ms. - Missing or incorrect documentation? Open an issue for this package.
