Writer

NAME

CSS::Minifier::Writer — Document-tree CSS serializer

DESCRIPTION

Serializes a Document tree back into minified CSS. Handles:

  • Quote normalization (double → single, with escaped-quote protection)

  • Color masking (named → hex, hex shortening, rgb → hex)

  • Color naming (hex → named, when :color-names is set)

  • Font-weight normalization (bold → 700, normal → 400)

  • Zero-unit removal (0px → 0)

  • URL quote wrapping

  • Space insertion before { for at-rules with a prelude

Attributes

  • $.sep — separator between top-level statements (default '')

  • $.color-masks — enable hex color shortening (default True)

  • $.color-names — convert hex to named colors (default False)

When both :color-names and :color-masks are enabled, :color-names takes precedence (colors are named rather than hex-shortened).

Methods

  • write-document(Document $doc -- Str)> — renders the document tree to a minified CSS string

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.