stylus代码
functions = constant env
safe-area-fn(fn, position)
s("%s(safe-area-inset-%s)", fn, position)
safe-area-mixin(property, position, important = false)
for fn in functions
{property} safe-area-fn(fn, position) important == true ? !important : unquote("")
.cube-safe-area-pb {
safe-area-mixin(padding-bottom, bottom, true);
}
编译后的css代码:
.cube-safe-area-pb{
padding-bottom:constant(safe-area-inset-bottom)!important;
padding-bottom:env(safe-area-inset-bottom)!important
}
求问这段styl代码什么意思,我现在将这段stylus代码,转换为scss,该怎么写
https://github.com/txs1992/stylus-converter
stylus 转换为 sass 或 less 的工具
$functions: constant env;
@function safe-area-fn($fn, $position) {
@return s("%s(safe-area-inset-%s)", $fn, $position);
}
@function safe-area-mixin($property, $position, $important: false) {
@each $fn in $$functions {
@return #{$property}: safe-area-fn($fn, $position), $important==true;
}
}
.cube-safe-area-pb {
@include safe-area-mixin(padding-bottom, bottom, true);
}
感谢
你好,这个工具编译出来的scss是报错的
$functions: constant env;
@function safe-area-fn($fn, $position) {
@return s("%s(safe-area-inset-%s)", $fn, $position);
}
@function safe-area-mixin($property, $position, $important: false) {
@each $fn in $$functions {
@return #{$property}: safe-area-fn($fn, $position), $important == true;
}
}
.cube-safe-area-pb {
@include safe-area-mixin(padding-bottom, bottom, true);
}
在sassmeister测试怎么也不会改,求大佬帮忙看看