css - How to pass a code block to a function or mixin in Stylus -


i'm moving sass stylus , have lots of mixins pass in code block accessible inside mixin @content.

for example...

@mixin respond-min($width) {     // if we're outputting fixed media query set...     @if $fix-mqs {         // ...and if should apply these rules...         @if $fix-mqs >= $width {             // ...output content user gave us.             @content;         }     }     @else {         // otherwise, output using regular media query         @media , (min-width: $width) {             @content;         }     } }  @include respond-min($mq-group2) {     & {         border: 1px solid green;     } } 

i want convert above code stylus, main problem far been how pass code block mixin stylus doesn't appear have feature.

is there alternative solution?

any appreciated.

this become possible latest release of stylus — 0.41.0, code above written in stylus this:

respond-min($width)   // if we're outputting fixed media query set...   if $fix-mqs defined     // ...and if should apply these rules...     if $fix-mqs >= $width       // ...output content user gave us.       {block}   else     // otherwise, output using regular media query     media = 'all , (min-width: %s)' % $width     @media media       {block}  +respond-min($mq-group2)   border: 1px solid green 

Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -