Text::Sass(3pm)

πŸ“¦
version 1.0.4 Β· 3 versions
, in debian bookworm, debian trixie, ubuntu noble

πŸ’– 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:

  • Readonly
  • Convert::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 for libsass. 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 another libsass binding.
  • 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 πŸ’…


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