@@ -15,7 +15,7 @@ CSS::Sass - Compile .scss files using libsass
15
15
my $css = $sass->compile_file('styles.scss');
16
16
17
17
# Add custom function to use inside your Sass code
18
- sub foobar { CSS::Sass::Type ::String->new('blue') }
18
+ sub foobar { CSS::Sass::Value ::String->new('blue') }
19
19
$sass->options->{sass_functions}->{'foobar'} = \ &foobar;
20
20
21
21
# Compile string and get css output and source-map json
@@ -221,20 +221,20 @@ feature parity and heading towards 3.4. It can compile .scss and .sass files.
221
221
function should be the function's Sass signature and the value should be a
222
222
Perl subroutine reference. This subroutine will be called whenever the
223
223
function is used in the Sass being compiled. The arguments to the subroutine
224
- are [ CSS::Sass::Type ] ( https://metacpan.org/pod/CSS::Sass::Type ) objects, which map to native perl types if possible.
225
- You can return either [ CSS::Sass::Type ] ( https://metacpan.org/pod/CSS::Sass::Type ) objects or supported native perl data
226
- structures. ` undef ` is an equivalent of CSS::Sass::Type ::Null->new.
224
+ are [ CSS::Sass::Value ] ( https://metacpan.org/pod/CSS::Sass::Value ) objects, which map to native perl types if possible.
225
+ You can return either [ CSS::Sass::Value ] ( https://metacpan.org/pod/CSS::Sass::Value ) objects or supported native perl data
226
+ structures. ` undef ` is an equivalent of CSS::Sass::Value ::Null->new.
227
227
228
228
The function is called with an ` eval ` statement so you may use "die" to
229
- throw errors back to libsass (` CSS::Sass::Type ::Error ` ).
229
+ throw errors back to libsass (` CSS::Sass::Value ::Error ` ).
230
230
231
231
A simple example:
232
232
233
233
sass_functions => {
234
234
'append_hello($str)' => sub {
235
235
my ($str) = @_;
236
- die '$str should be a string' unless $str->isa("CSS::Sass::Type ::String");
237
- return CSS::Sass::Type ::String->new($str->value . " hello");
236
+ die '$str should be a string' unless $str->isa("CSS::Sass::Value ::String");
237
+ return CSS::Sass::Value ::String->new($str->value . " hello");
238
238
# equivalent to return $str->value . " hello";
239
239
}
240
240
}
@@ -282,7 +282,7 @@ feature parity and heading towards 3.4. It can compile .scss and .sass files.
282
282
- ` Sass_Value ` Types
283
283
284
284
Sass knowns various ` Sass_Value ` types. We export the constants for completeness.
285
- Each type is mapped to a package inside the ` CSS::Sass::Type ` namespace.
285
+ Each type is mapped to a package inside the ` CSS::Sass::Value ` namespace.
286
286
287
287
# Value types
288
288
SASS_ERROR
@@ -305,11 +305,11 @@ feature parity and heading towards 3.4. It can compile .scss and .sass files.
305
305
native data types from your custom functions or use the datastructures
306
306
to access maps and lists.
307
307
308
- undef; # same as CSS::Sass::Type ::Null->new;
309
- 42; # same as CSS::Sass::Type ::Number->new(42);
310
- "foobar"; # same as CSS::Sass::Type ::String->new("foobar");
311
- [ 'foo', 'bar' ]; # same as CSS::Sass::Type ::List->new('foo', 'bar');
312
- { key => 'value' }; # same as CSS::Sass::Type ::Map->new(key => 'value');
308
+ undef; # same as CSS::Sass::Value ::Null->new;
309
+ 42; # same as CSS::Sass::Value ::Number->new(42);
310
+ "foobar"; # same as CSS::Sass::Value ::String->new("foobar");
311
+ [ 'foo', 'bar' ]; # same as CSS::Sass::Value ::List->new('foo', 'bar');
312
+ { key => 'value' }; # same as CSS::Sass::Value ::Map->new(key => 'value');
313
313
314
314
We bless native return values from custom functions into the correct package.
315
315
@@ -362,7 +362,7 @@ feature parity and heading towards 3.4. It can compile .scss and .sass files.
362
362
363
363
# SEE ALSO
364
364
365
- [ CSS::Sass::Type ] ( https://metacpan.org/pod/CSS::Sass::Type )
365
+ [ CSS::Sass::Value ] ( https://metacpan.org/pod/CSS::Sass::Value )
366
366
367
367
[ The Sass Home Page] ( http://sass-lang.com/ )
368
368
0 commit comments