Answer the question
In order to leave comments, you need to log in
Is there an analogue of the @content directive from Sass in Stylus?
Is there an analogue of the @content directive from Sass in Stylus?
For example, rewrite the
mixin @mixin keyframes ($animation-name) {
@-webkit-keyframes $animation-name{
@content;
}
@-moz-keyframes $animation-name{
@content;
}
@-ms-keyframes $animation-name{
@content;
}
@-o-keyframes $animation-name{
@content;
}
@keyframes $animation-name{
@content;
}
}
use
p {
@include keyframes("my-anim") {
0% { font-size: 20px; }
100% { font-size: 30px; }
}
}
Answer the question
In order to leave comments, you need to log in
In Stylus prefixes for keyframes will be added automatically enough entry:
@keyframes myanim
0%
font-size 20px
100%
font-size 30px
// Mixin
key( name = 'name' )
@keyframes {name}
{block}
// Use
p
+key( 'font' )
0%
font-size 20px
100%
font-size 30px
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question