Link

Overview


Table of contents


CssNode (type alias)

The Css Node

Signature

export type CssNode<T extends CssProperties> = T & {
  selector?: Record<string, CssNode<T>>
}

Example

import { CssNode } from 'macoolka-css-rule'
type P = { color1?: string }
type P1 = { color?: string; margin?: number }

export const c: CssNode<Input<P, P1>> = {
  color1: 'red',
  selector: {
    ':focus': {
      color1: '1'
    },
    ':focus:active': {
      margin: 5
    },
    ':focus:disable': {
      margin: 5
    },
    ':focus:active:disable': {
      color1: 'blue'
    },
    ':disable': {
      color1: 'yellow',
      margin: 7
    }
  }
}

Added in v0.2.0

CssThemeNode (type alias)

Add Theme Property in CssNode

Signature

export type CssThemeNode<P extends CssProperties, T extends CssTheme> = CssNode<P> & { theme?: T }

Added in v0.2.0

Input (type alias)

Input Type overwrite Output Type

Signature

export type Input<I extends CssProperties, O extends CssProperties> = O & I

Added in v0.2.0

cssNodeToNode (function)

CssNode to Node

Signature


export const cssNodeToNode = <T extends CssProperties>(a: CssNode<T>): Node<T> => ...

Added in v0.2.0

cssThemeNodeToThemeNode (function)

CssThemeNode to ThemeNode

Signature


export const cssThemeNodeToThemeNode = <P extends CssProperties, T extends CssTheme>(a: CssThemeNode<P, T>): ThemeNode<P, T> => ...

Added in v0.2.0

themeNodeToCssThemeNode (function)

ThemeNode to CssThemeNode

Signature


export const themeNodeToCssThemeNode = <O extends CssProperties, T extends CssTheme>
    (input: ThemeNode<O, T>): CssThemeNode<O, T> => ...

Added in v0.2.0

map (export)

Signature

typeof map

Added in v0.2.0

mapWithIndex (export)

Signature

typeof mapWithIndex

Added in v0.2.0

record (export)

Signature


FunctorWithIndex1<"Record", string> & Foldable1<"Record"> & TraversableWithIndex1<"Record", string> & Compactable1<"Record"> & FilterableWithIndex1<"Record", string> & Witherable1<"Record"> & FoldableWithIndex1<"Record", string>

Added in v0.2.0

reduce (export)

Signature

;<A, B>(b: B, f: (b: B, a: A) => B) => (fa: Record<string, A>) => B

Added in v0.2.0

reduceRight (export)

Signature

;<A, B>(b: B, f: (a: A, b: B) => B) => (fa: Record<string, A>) => B

Added in v0.2.0

reduceRightWithIndex (export)

Signature

typeof reduceRightWithIndex

Added in v0.2.0

reduceWithIndex (export)

Signature

typeof reduceWithIndex

Added in v0.2.0