Link

概述


目录


CssNode (类型)

The Css Node

签名

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

示例

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
    }
  }
}

v0.2.0 中添加

CssThemeNode (类型)

CssNode 中加 theme 属性

签名

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

v0.2.0 中添加

Input (类型)

输入类型覆盖输出类型

签名

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

v0.2.0 中添加

cssNodeToNode (函数)

转换 CssNode 到 Node

签名


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

v0.2.0 中添加

cssThemeNodeToThemeNode (函数)

转换 CssThemeNode 到 ThemeNode

签名


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

v0.2.0 中添加

themeNodeToCssThemeNode (函数)

转换 ThemeNode 到 CssThemeNode

签名


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

v0.2.0 中添加

map (导出)

签名

typeof map

v0.2.0 中添加

mapWithIndex (导出)

签名

typeof mapWithIndex

v0.2.0 中添加

record (导出)

签名


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

v0.2.0 中添加

reduce (导出)

签名

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

v0.2.0 中添加

reduceRight (导出)

签名

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

v0.2.0 中添加

reduceRightWithIndex (导出)

签名

typeof reduceRightWithIndex

v0.2.0 中添加

reduceWithIndex (导出)

签名

typeof reduceWithIndex

v0.2.0 中添加