CSS::Scopifier::Group - Like CSS::Scopifier but can handle rule groups
use CSS::Scopifier::Group; my $CSS = CSS::Scopifier::Group->read('/path/to/base.css'); $CSS->scopify('.myclass'); # To scopify while also merging 'html' and 'body' into # the '.myclass' selector rule: $CSS->scopify('.myclass', merge => ['html','body']); # New, "scopified" version of the CSS with each rule # prepended with '.myclass': my $newCss = $CSS->write_string;
This module provides exactly the same API as CSS::Scopifier, but is able to handle nested "group" rules, such as:
@media print { h5 { font-size: 200%; } }
It scopifies the inner/nested rules in the same manner as the top-level. Internally, it creates and tracks separate CSS::Scopifier objects for each group/level (which can also be nested multiple levels deep).
Henry Van Styn <vanstyn@cpan.org>
This software is copyright (c) 2015 by IntelliTree Solutions llc.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install CSS::Scopifier, copy and paste the appropriate command in to your terminal.
cpanm
cpanm CSS::Scopifier
CPAN shell
perl -MCPAN -e shell install CSS::Scopifier
For more information on module installation, please visit the detailed CPAN module installation guide.