Gerillass
v2.1.0Type: Function
isTime();
Returns the value if it is a time in s or ms, and errors otherwise.
Arguments
| Name | Type | Description |
|---|---|---|
$value | time | Accepts a duration such as 0.2s or 300ms, or 0. |
Examples
Validating a duration argument in a mixin of your own.
@mixin fade($duration) {
transition: opacity isTime($duration) ease;
}
.panel {
@include fade(0.4s);
}.panel {
transition: opacity 0.4s ease;
}What it refuses
Arguments are checked, so a wrong value stops the build with a message instead of quietly producing the wrong CSS.
.panel {
transition-duration: isTime(400px);
}Error: '400px' is not a valid time value. Time values must be specified in either seconds (s) or milliseconds (ms). Please try one of the following forms: '1s', '0.2s', or '3ms'