mirror of
https://github.com/danog/dart-sass.git
synced 2024-11-27 04:34:59 +01:00
Fix bounds-checking for opacify() et al.
This commit is contained in:
parent
2edc6210d3
commit
d71e530622
@ -1,3 +1,8 @@
|
||||
## 1.0.0-alpha.5
|
||||
|
||||
* Fix bounds-checking for `opacify()`, `fade-in()`, `transparentize()`, and
|
||||
`fade-out()`.
|
||||
|
||||
## 1.0.0-alpha.4
|
||||
|
||||
* Add support for bracketed lists.
|
||||
|
@ -986,7 +986,8 @@ SassColor _opacify(List<Value> arguments) {
|
||||
var color = arguments[0].assertColor("color");
|
||||
var amount = arguments[1].assertNumber("amount");
|
||||
|
||||
return color.changeAlpha(color.alpha + amount.valueInRange(0, 1, "amount"));
|
||||
return color.changeAlpha(
|
||||
(color.alpha + amount.valueInRange(0, 1, "amount")).clamp(0, 1));
|
||||
}
|
||||
|
||||
/// The definition of the `transparentize()` and `fade-out()` functions.
|
||||
@ -994,7 +995,8 @@ SassColor _transparentize(List<Value> arguments) {
|
||||
var color = arguments[0].assertColor("color");
|
||||
var amount = arguments[1].assertNumber("amount");
|
||||
|
||||
return color.changeAlpha(color.alpha - amount.valueInRange(0, 1, "amount"));
|
||||
return color.changeAlpha(
|
||||
(color.alpha - amount.valueInRange(0, 1, "amount")).clamp(0, 1));
|
||||
}
|
||||
|
||||
/// Converts a Sass string index into a codepoint index into a string whose
|
||||
|
@ -1,5 +1,5 @@
|
||||
name: sass
|
||||
version: 1.0.0-alpha.4
|
||||
version: 1.0.0-dev
|
||||
description: A Sass implementation in Dart.
|
||||
author: Dart Team <misc@dartlang.org>
|
||||
homepage: https://github.com/sass/dart-sass
|
||||
|
Loading…
Reference in New Issue
Block a user