我正在将文件复制style.scss从特定的目录与启动多个文件夹皮肤提。
事实上,我不知道如何告诉 gulp 选择以这个字符串skin-开头的文件夹。
这是我的 gulp 代码:
// Copy Files
gulp.task( "copyFiles" , function() {
return gulp.src( "app/scss/style.scss" )
.pipe( gulp.dest( "app/scss/skins/skin-*" ) );
});
Run Code Online (Sandbox Code Playgroud)
在命令提示符下,它说任务正在运行但没有结果。
我为此搜索了很多,但没有找到方法。我在这里找到了这个问题,它接近我的问题上下文,但没有帮助!Gulp 使用通配符目录复制单个文件(src 管道 dest)
演示:https : //codepen.io/moradxd/pen/WJpPyQ
假设我有这个 HTML 代码:
<body class="boxed">
<div class="text-white">
<a href="#" class="btn-featured">Button</a>
</div>
</dody>
Run Code Online (Sandbox Code Playgroud)
我正在使用这个 sass 代码如下:
.boxed {
// error with using "Ampersand"
body& {
}
}
Run Code Online (Sandbox Code Playgroud)
但这会导致编译错误,其中说:
虽然我想要的结果如下:
// This the result i want
body.boxed {
}
Run Code Online (Sandbox Code Playgroud)
我知道我可以这样使用它,它会产生我正在寻找的结果:
// I know i can use this
body {
&.boxed {
}
}
Run Code Online (Sandbox Code Playgroud)
但是为了组织目的,我想将 .boxed 类代码与正文 css 代码内部分开。
那么为什么不允许这样做,尽管元素及其父级的类似代码适用于以下情况:
// Although this similar code for element and
// it's parent is working
.btn-featured {
.text-white & {
font-size: …Run Code Online (Sandbox Code Playgroud) 我如何通过保持内部圆形区域透明来制作这种形状?
这里是我要实现的示例:http://codepen.io/moradxd/pen/EgVVdg
body {
background: #16c5de;
}
.shape-box {
width: 80px;
height: 80px;
position: relative;
margin: 100px auto;
}
.element-1,
.element-2 {
display: block;
position: relative;
}
.element-1 {
width: 80px;
height: 40px;
background: #fff;
position: absolute;
bottom: 0;
z-index: 0;
}
.element-2 {
width: 80px;
height: 80px;
background: #16c5de;
z-index: 1;
border-radius: 100%;
}Run Code Online (Sandbox Code Playgroud)
<div class="shape-box">
<span class="element-1"></span>
<span class="element-2"></span>
</div><!-- .shape-box -->Run Code Online (Sandbox Code Playgroud)