Css 如何在手写笔中将代码块传递给函数或mixin
我正在从Sass转移到Stylus,我有很多mixin,我在其中传递一个代码块,它可以在mixin中作为Css 如何在手写笔中将代码块传递给函数或mixin,css,sass,stylus,Css,Sass,Stylus,我正在从Sass转移到Stylus,我有很多mixin,我在其中传递一个代码块,它可以在mixin中作为@content访问 例如 @mixin respond-min($width) { // If we're outputting for a fixed media query set... @if $fix-mqs { // ...and if we should apply these rules... @if $fix-mqs >=
@content
访问
例如
@mixin respond-min($width) {
// If we're outputting for a fixed media query set...
@if $fix-mqs {
// ...and if we should apply these rules...
@if $fix-mqs >= $width {
// ...output the content the user gave us.
@content;
}
}
@else {
// Otherwise, output it using a regular media query
@media all and (min-width: $width) {
@content;
}
}
}
@include respond-min($mq-group2) {
& {
border: 1px solid green;
}
}
我想将上面的代码转换成手写笔,但我的主要问题是如何将代码块传递到mixin中,因为手写笔似乎没有这个功能
有没有替代方案
非常感谢您的帮助。值得注意的是,关于将多个参数传递到@media查询中,目前存在一些尚未解决的问题。此外,混音器不能用作选择器。最新版本的手写笔-0.41.0使这成为可能,上面的代码可以用手写笔编写,如下所示:
respond-min($width)
// If we're outputting for a fixed media query set...
if $fix-mqs is defined
// ...and if we should apply these rules...
if $fix-mqs >= $width
// ...output the content the user gave us.
{block}
else
// Otherwise, output it using a regular media query
media = 'all and (min-width: %s)' % $width
@media media
{block}
+respond-min($mq-group2)
border: 1px solid green
您当前必须创建一个mixin并将其作为一个函数传递!非常感谢你。我打算在不久的将来把英国广播公司的新闻从Sass转到Stylus:——)