Text-Sass-XS

 view release on metacpan or  search on metacpan

README.md  view on Meta::CPAN


        $css = $sass->compile("source code");

    This compiles the Sass string that is passed in the first parameter. If
    there is an error it will `croak()`.

- `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 `croak()`.

- `options`

        $sass->options->{include_paths} = ['/path/to/assets'];

    Allows you to inspect or change the options after a call to `new`.

- `scss2css(source_code)`

        $css = $sass->scss2css("scss souce code");

    Same as `compile`.

- `sass2css(source_code)`

        $css = $sass->compile("sass source code");

    Wrapper method of `Text::Sass#sass2css`.

- `css2sass(source_code)`

        $css = $sass->css2sass("css source code");

    Wrapper method of `Text::Sass#css2sass`.

# FUNCTIONAL INTERFACE

# EXPORT

Nothing to export.

# EXPORT\_OK

## Funcitons

- `sass_compile($source_string :Str, $options :HashRef)`

    Returns css string if success. Otherwise throws exception.

    Default value of `$options` is below.

        my $options = {
            output_style    => SASS_STYLE_COMPRESSED,
            source_comments => SASS_SOURCE_COMMENTS_NONE, 
            include_paths   => undef,
            image_path      => undef,
        };

    `input_paths` is a coron-separated string for "@import". `image_path` is a string using for "image-url".

- `sass_compile_file($input_path :Str, $options :HashRef)`

    Returns css string if success. Otherwise throws exception. `$options` is same as `sass_compile`.

## Constants

For `$options->{output_style}`.

- `SASS_STYLE_NESTED`
- `SASS_STYLE_EXPANDED`
- `SASS_STYLE_COMPRESSED`

For `$options->{source_comments}`.

- `SASS_SOURCE_COMMENTS_NONE`
- `SASS_SOURCE_COMMENTS_DEFAULT`
- `SASS_SOURCE_COMMENTS_MAP`

# EXPORT\_TAGS

- :func

    Exports `sass_compile` and `sass_compile_file`.

- :const

    Exports all constants.

- :all

    Exports :func and :const.

# SEE ALSO

[Text::Sass](http://search.cpan.org/perldoc?Text::Sass) - Pure perl implementation.

[CSS::Sass](http://search.cpan.org/perldoc?CSS::Sass) - Yet another libsass binding.

# LICENSE

Text::Sass::XS

Copyright (C) 2013 Yoshihiro Sasaki.

This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.

libsass

Copyright (C) 2012 by Hampton Catlin.

See libsass/LICENSE for more details.

# AUTHOR

Yoshihiro Sasaki <ysasaki@cpan.org>



( run in 1.722 second using v1.01-cache-2.11-cpan-39bf76dae61 )