0.0.12-alpha • Published 2 years ago

c2ve v0.0.12-alpha

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Convert CSS (SCSS/SASS) to vanilla-extract.

playground

Install

npm i -D c2ve

Usage

Once installed, you can run it to convert css (scss/sass) files to vanilla-extract ts files. For example:

npx c2ve sample/test.css

Output:sample/test.css.ts

Sample

From

.foo {
  background-color: blue;
}
@media (min-width: 1200px) {
  input {
    font-size: 5rem;
  }
  .foo {
    font-size: 5rem;
    color: red;
  }
  .bar {
    font-size: 10rem;
  }
}

To

import { globalStyle, style } from "@vanilla-extract/css";

globalStyle("input", {
  "@media": {
    "(min-width: 1200px)": {
      fontSize: "5rem",
    },
  },
});
export const bar = style({
  "@media": {
    "(min-width: 1200px)": {
      fontSize: "10rem",
    },
  },
});
export const foo = style({
  backgroundColor: "blue",
  "@media": {
    "(min-width: 1200px)": {
      fontSize: "5rem",
      color: "red",
    },
  },
});

Principles of conduct

Please see the principles of conduct when building a site.

License

This library is licensed under the MIT license.

0.0.12-alpha

2 years ago

0.0.10-alpha

2 years ago

0.0.9-alpha

2 years ago

0.0.7-alpha

2 years ago

0.0.6-alpha

2 years ago

0.0.5-alpha

2 years ago

0.0.3-alpha

2 years ago

0.0.2-alpha

2 years ago

0.0.1-alpha

2 years ago