Parser

NAME

CSS::Minifier::Parser — custom brace-counting CSS parser

DESCRIPTION

Parses raw CSS into a Document tree using brace-counting and character-level scanning. Handles strings (single/double quotes with escapes), comments, braceless at-rules (@import, @charset, @namespace), and recursive block structure for nested at-rules.

Note: CSS native nesting (e.g. & b { ... }) is not supported and will silently misparse. Nested rulesets must be flattened before minification. @keyframes (percentage/from/to keyframe selectors) IS handled correctly.

Methods

  • parse(Str $css, Bool :$preserve-licenses -- Document)> — parses CSS and returns a Document tree. When :$preserve-licenses is True, /*! */ comments are extracted into Document.licenses.

EXPORTED SUBS

  • parse-body(Str $body -- List)> — parses the body of a ruleset or declaration-only at-rule into a list of key => value Pair objects.

AUTHOR

Sasha Abbott <[email protected]>

COPYRIGHT AND LICENSE

This library is free software; you can redistribute it and/or modify it under CC0.

CSS::Minifier v0.0.14

CSS Minifier

Authors

  • Sasha Abbott

License

CC0-1.0

Dependencies

Test Dependencies

Provides

  • CSS::Minifier
  • CSS::Minifier::Document
  • CSS::Minifier::Normalizer
  • CSS::Minifier::Parser
  • CSS::Minifier::Pipeline
  • CSS::Minifier::Plugin
  • CSS::Minifier::Plugin::Dedup
  • CSS::Minifier::Plugin::Merging
  • CSS::Minifier::Util
  • CSS::Minifier::Writer

The Camelia image is copyright 2009 by Larry Wall. "Raku" is a trademark of the Yet Another Society. All rights reserved.

Built with Podlite — the markup and publishing tools behind this site.