mirror of
https://github.com/danog/dart-sass.git
synced 2024-12-02 09:37:49 +01:00
Add percentage().
This commit is contained in:
parent
e1a6178ced
commit
b0a675ab14
@ -479,6 +479,15 @@ void defineCoreFunctions(Environment environment) {
|
||||
return new SassString(string.text.toLowerCase(), quotes: string.hasQuotes);
|
||||
}));
|
||||
|
||||
// ## Number
|
||||
|
||||
environment
|
||||
.setFunction(new BuiltInCallable("percentage", r"$number", (arguments) {
|
||||
var number = arguments[0].assertNumber("number");
|
||||
number.assertNoUnits();
|
||||
return new SassNumber(number.value * 100, '%');
|
||||
}));
|
||||
|
||||
// ## Introspection
|
||||
|
||||
environment.setFunction(new BuiltInCallable("inspect", r"$value",
|
||||
|
Loading…
Reference in New Issue
Block a user