Transitions
In this module you can find standard mixins for prefix-free transition property and pre-defined mixins for special cases.
File
lightingfly/modules/_transitions.scss
Links
Specification for CSS 3 transitions: w3.org
Learn to CSS 3 transitions: w3schools.com
transition-property
Mixin for prefix-free using transition-property property.
Mixin
@mixin transition-property($properties...)
Arguments
$properties...:
[color, background, ...]
- names of CSS properties separated by comma.
Usage example
Demo
First element has simple background transition, second element is extended with transition for color and box-shadow.
Other mixins used in demo: box-shadow
transition-duration
Mixin for prefix-free using transition-duration property.
Mixin
@mixin transition-duration($durations...)
Arguments
$durations...:
[1s, 500ms, ...]
- durations of transitions separated by comma
Usage example
Demo
Duration on mousein is set to 150ms but duration on mouseout is set to 2s.
Other mixins used in demo: box-shadow
transition-timing-function
Mixin for prefix-free using transition-timing-function property.
Mixin
@mixin transition-timing-function($functions...)
Arguments
$functions...:
[linear, ease, ease-in, ease-out, ease-in-out, cubic-bezier(1,1,1,1)]
- timing functions for transitions separated by comma
Usage example
Demo
These three elements have three diferent timing functions for transition
transition-delay
Mixin for prefix-free using transition-delay property.
Mixin
@mixin transition-delay($delays...)
Arguments
$delays...:
[1s, 500ms, ...]
- delays of transitions separated by comma
Usage example
Demo
CSS property visibility is delayed on mouseout.
Other mixins used in demo: opacity