小编Mor*_*mdy的帖子

Gulp:将文件复制到以特定字符串开头的多个文件夹

我正在将文件复制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)

gulp

3
推荐指数
1
解决办法
672
查看次数

Sass:使用 & 符号“&”作为具有特定类的正文标签

演示: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)

css sass

2
推荐指数
1
解决办法
2201
查看次数

如何用css制作这个圆形的形状

我如何通过保持内部圆形区域透明来制作这种形状?

定制圆形

这里是我要实现的示例: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)

html css css3

-2
推荐指数
1
解决办法
253
查看次数

标签 统计

css ×2

css3 ×1

gulp ×1

html ×1

sass ×1