Skip to content

0.2.0

Compare
Choose a tag to compare
@littledivy littledivy released this 30 Oct 07:45
· 3 commits to main since this release
6ac7375

css_parser 0.2.0

CSS Lexer & Parser implementation for Deno

Changes

Fixes

  • use const & let instead of var

  • fix: use const for unreassigned immutables

  • fix: set default value of options instead of ||

  • fix: explicitly state any types for isolatedModules flag

  • fix: reduce code dupe

  • fix: use import/export type for types

  • fix: remove unused imports

  • feat: use Token type

Usage

Parse CSS to AST -

import { parse } from "https://deno.land/x/[email protected]/mod.ts";

let ast = parse("/* comment */ p { color: black; }", {/* OPTIONS */})
// {
//   type: "stylesheet",
//   stylesheet: {
//     rules: [
//       { type: "comment", text: " comment ", position: [Object] },
//       { type: "rule", selectors: [Array], declarations: [Array], position: [Object] }
//     ]
// }