Text-Sass-XS
view release on metacpan or search on metacpan
lib/Text/Sass/XS.pm view on Meta::CPAN
there is an error it will C<croak()>.
=item C<compile_file(input_path)>
$css = $sass->compile_file("/path/to/foo.scss");
This compiles the Sass file that is passed in the first parameter. If
there is an error it will C<croak()>.
=item C<options>
$sass->options->{include_paths} = ['/path/to/assets'];
Allows you to inspect or change the options after a call to C<new>.
=item C<scss2css(source_code)>
$css = $sass->scss2css("scss souce code");
Same as C<compile>.
=item C<sass2css(source_code)>
$css = $sass->compile("sass source code");
Wrapper method of C<Text::Sass#sass2css>.
=item C<css2sass(source_code)>
$css = $sass->css2sass("css source code");
Wrapper method of C<Text::Sass#css2sass>.
=back
=head1 FUNCTIONAL INTERFACE
=head1 EXPORT
Nothing to export.
=head1 EXPORT_OK
=head2 Funcitons
=over 4
=item C<sass_compile($source_string :Str, $options :HashRef)>
Returns css string if success. Otherwise throws exception.
Default value of C<$options> is below.
my $options = {
output_style => SASS_STYLE_COMPRESSED,
source_comments => SASS_SOURCE_COMMENTS_NONE,
include_paths => undef,
image_path => undef,
};
C<input_paths> is a coron-separated string for "@import". C<image_path> is a string using for "image-url".
=item C<sass_compile_file($input_path :Str, $options :HashRef)>
Returns css string if success. Otherwise throws exception. C<$options> is same as C<sass_compile>.
=back
=head2 Constants
For C<$options-E<gt>{output_style}>.
=over 4
=item C<SASS_STYLE_NESTED>
=item C<SASS_STYLE_EXPANDED>
=item C<SASS_STYLE_COMPRESSED>
=back
For C<$options-E<gt>{source_comments}>.
=over 4
=item C<SASS_SOURCE_COMMENTS_NONE>
=item C<SASS_SOURCE_COMMENTS_DEFAULT>
=item C<SASS_SOURCE_COMMENTS_MAP>
=back
=head1 EXPORT_TAGS
=over 4
=item :func
Exports C<sass_compile> and C<sass_compile_file>.
=item :const
Exports all constants.
=item :all
Exports :func and :const.
=back
=head1 SEE ALSO
L<Text::Sass> - Pure perl implementation.
L<CSS::Sass> - Yet another libsass binding.
=head1 LICENSE
Text::Sass::XS
( run in 2.460 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )