Link

Overview


Table of contents


PrintNode (type alias)

The Print Css Node

Signature

export type PrintNode<T extends object> = T & {
  selector?: [string, CssNode<T>][]
  media?: [string, [string, CssNode<T>][]][]
}

Example

import { printNodeToString, PrintNode } from '../PrintNode'
const node: PrintNode<any> = {
  color: 'red',
  marginTop: '12px',
  marginLeft: '1px',
  selector: [
    [
      '$:hover',
      {
        color: 'green',
        marginTop: '20px',
        marginLeft: '21px'
      }
    ],
    [
      '$:focus',
      {
        color: 'blue',
        marginTop: '2px',
        marginLeft: '3px'
      }
    ]
  ],
  media: [
    [
      '@media screen and (max-width: 120em)',
      [
        [
          '$:hover',
          {
            color: 'red',
            marginTop: '20px',
            marginLeft: '21px'
          }
        ],
        [
          '$:focus',
          {
            color: 'blue',
            marginTop: '2px',
            marginLeft: '3px'
          }
        ]
      ]
    ]
  ]
}

Added in v0.2.0

printNodeToString (constant)

PrintNode to string

Signature


export const printNodeToString: (a: PrintNode<object>) => string = ...

Added in v0.2.0

cssNodeToPrintNode (function)

CssNode to PrintNode

Signature


export const cssNodeToPrintNode = <T extends object>(a: CssNode<T>): PrintNode<T> => ...

Added in v0.2.0