Skip to content

Releases: deno-front-end/css-parser

0.3.0

12 Jan 16:36
6ded0ef
Compare
Choose a tag to compare

What's Changed

  • feat(core/parser): add ast node value property by @LukeeeeBennett in #4

Full Changelog: 0.2.0...0.3.0

0.2.0

30 Oct 07:45
6ac7375
Compare
Choose a tag to compare

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

0.1.0

27 Oct 17:03
Compare
Choose a tag to compare

css_parser

CSS Lexer & Parser implementation for Deno

  • CSS parser and lexer
  • Preserves comments and position in the AST when specified
  • Parses whole of Bootstrap 3.3.7 in <108ms

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