0.0.3 • Published 9 months ago

@mincho-js/transform-to-vanilla v0.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

@mincho-js/transform-to-vanilla

CSS in JS syntax converter for Vanilla Extract

Install

npm install @mincho-js/transform-to-vanilla

# or
yarn add @mincho-js/transform-to-vanilla

# or
pnpm install @mincho-js/transform-to-vanilla

API

transform

Convert to a vanilla extract object according to the CSS Literals and CSS Nesting RFCs.

import { transform } from "@mincho-js/transform-to-vanilla";

transform(styleObj);
transform(styleObj, context);

TransformContext

The context type of the transform.

import type { TransformContext } from "@mincho-js/transform-to-vanilla";

const initTransformContext: TransformContext = {
  result: {},
  basedKey: "",
  parentSelector: "",
  parentAtRules: {
    "@media": "",
    "@supports": "",
    "@container": "",
    "@layer": ""
  },
  propertyReference: {},
  variantMap: {},
  variantReference: {}
};