Text::Sass(3pm)
π NAME π
Text::Sass β a naieve Perl implementation of Sass & SCSS. (And bestie, "naieve" is spelled exactly like that in the original and we are NOT fixing it, we respect the author's choices π )
β¨ VERSION β¨
It's chillin' in Text/Sass.pm. Go look, it's right there π«Ά
πΈ SYNOPSIS πΈ
Okay so this is the whole vibe in one code block, no cap:
use Text::Sass;
my $sass = Text::Sass->new();
print $sass->sass2css(<<'EOF');
$font-stack: Helvetica, sans-serif
$primary-color: #333
body
font: 100% $font-stack
color: $primary-color
EOF
print $sass->scss2css(<<'EOF');
$font-stack: Helvetica, sans-serif;
$primary-color: #333;
body {
font: 100% $font-stack;
color: $primary-color;
}
EOF
Like, look at her. Sass in, CSS out. SCSS in, CSS out. Iconic behavior honestly π₯
π¦ DESCRIPTION π¦
So this is a pure perl implementation of the Sass and SCSS languages. Not perl-plus-some-C-library, not a binding, just straight-up Perl doing its thing π§
Heads up though: it currently implements only a subset of the specification. Not the whole spec. A subset. Set your expectations accordingly, bestie π
Sass project page: <http://sass-lang.com> β the mothership, go say hi π
π SUBROUTINES/METHODS π
π new - Constructor - nothing special
my $oSass = Text::Sass->new;
It makes a thing. That's it. Nothing special, and the manpage literally says so, so I'm not gonna pretend otherwise π
π css2sass - Translate CSS to Sass
my $sSass = $oSass->css2sass($sCSS);
Hand it your CSS, it hands you back Sass. Glow-up pipeline β¨
π sass2css - Translate Sass to CSS
my $sCSS = $oSass->sass2css($sSass);
The classic. Sass goes in, CSS comes out. Main character energy fr fr π
π scss2css - Translate Scss to CSS
my $sCSS = $oSass->scss2css($sScss);
Same deal but for SCSS β curly braces girlies, this one's for you π«Ά
π DEPENDENCIES π
She does not come alone, she brings friends:
ReadonlyConvert::Color
π INCOMPATIBILITIES π
All variables are currently global.
And the original says, verbatim, that this "can be quite unpleasant." It IS unpleasant. It's giving shared-state chaos. Every variable knows every other variable's business, there is no privacy, there is no boundaries, they are all in the group chat π«
π BUGS AND LIMITATIONS π
See README. That's where the tea is β
π₯ SEE ALSO π₯
Text::Sass::XSβ Perl binding forlibsass. And like, real talk: consider using it if you need a higher level of language conformance and/or faster execution. She said what she said πCSS::Sassβ yet anotherlibsassbinding.Plack::Middleware::File::Sassβ Sass and SCSS support for all Plack frameworks. And plot twist, it can use this module as one of its backends. Comeback era π
π AUTHOR π
Roger Pettett <rmp@psyphi.net> β thank you for your service π«‘
πΈ DIAGNOSTICS πΈ
Turn on the chaos:
Set $Text::Sass::DEBUG = 1;
β CONFIGURATION AND ENVIRONMENT β
Nothing required beyond $DEBUG. That's the whole list. Nothing else. Minimalist queen π
π LICENSE AND COPYRIGHT π
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.10 or, at your option, any later version of Perl 5 you may have available.
And that's the whole page, bestie!! π This lil' beauty came from perl v5.36.0, dated 2022-12-06, and she lives in the manual as Text::Sass(3pm). Go forth and compile something cute ππβ¨
π¦ where this page comes from
- debian bookworm: libtext-sass-perl 1.0.4-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libtext-sass-perl 1.0.4-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libtext-sass-perl 1.0.4-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms