小编bob*_*lon的帖子

如何将@import .css文件作为sass中的.scss文件?

我正在使用gulp作为任务运行器,scss为我合并和缩小文件.在这种情况下,如果我尝试导入常规CSS文件,它将编译为css import语句,如下所示:

/* style.scss */
@import "../../bower_components/animate.css/animate.css";

/* style.css */
@import url(../../bower_components/animate.css/animate.css);
Run Code Online (Sandbox Code Playgroud)

那么如何导入那个常规的css文件,而不是只用语句来编译那个?style.csscss @import

css sass

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

Bootstrap 4支持LESS?

正如现在的bootstrap团队宣布版本4 alpha本身使用SASS作为CSS预处理器.这是否意味着它没有任何支持?!

less twitter-bootstrap

14
推荐指数
2
解决办法
2万
查看次数

ubuntu bower命令,错误:EACCES,权限被拒绝'.../insight-bower.json'

我无法以我的用户身份运行bower命令,这使我在运行bower时出现以下错误:

错误:EACCES,权限被拒绝'/home/***/.config/configstore/insight-bower.json'您无权访问此文件.

at Object.fs.openSync (fs.js:432:18)
at Object.fs.readFileSync (fs.js:286:15)
at Object.create.all.get (/usr/local/lib/node_modules/bower/node_modules/insight/node_modules/configstore/index.js:27:26)
at Object.Configstore (/usr/local/lib/node_modules/bower/node_modules/insight/node_modules/configstore/index.js:20:44)
at new Insight (/usr/local/lib/node_modules/bower/node_modules/insight/lib/index.js:37:34)
at ensureInsight (/usr/local/lib/node_modules/bower/lib/util/analytics.js:25:19)
at Object.setup (/usr/local/lib/node_modules/bower/lib/util/analytics.js:41:9)
at Object.<anonymous> (/usr/local/lib/node_modules/bower/bin/bower:72:11)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
Run Code Online (Sandbox Code Playgroud)

但是当我以root身份运行bower时,它运行正常.

怎么了?它以前工作正常,但由于我做了以下命令,它出错了.

sudo bower cache clean --allow-root
Run Code Online (Sandbox Code Playgroud)

ubuntu bower

6
推荐指数
1
解决办法
4512
查看次数

实施宁静管理区域的角度安全风险是什么?

我有兴趣用AngularJS实现restful管理区域.由于API应该是无状态的,我想使用OAuth实现管理区域,我对像MitM这样的安全风险很可怕.

那么这种情况下的安全风险是什么?如何修复主题?

security restful-authentication angularjs

5
推荐指数
1
解决办法
113
查看次数

如何创建一个半边界圆(只有CSS,而不是js甚至svg)?

我有兴趣创建如下图所示的内容.一个带有透明背景和细边框的计数器盒,以及该半圆底部的图标.

在此输入图像描述

我做了我想要的东西,见下文:

.chartBottom{
   width:0;
   height:0;
   border:60px solid #c45;
   border-bottom:60px solid transparent;
   border-radius: 60px;
 }
Run Code Online (Sandbox Code Playgroud)

但这个技巧的问题在于它不能有任何透明的背景.有任何想法吗?

css css3 css-shapes

4
推荐指数
1
解决办法
865
查看次数

如何使用jQuery将check attr添加到单选按钮nth-child?

我有一组单选按钮,我想将check attr添加到其中一个.这是我的代码:

<input type="radio" name="radioButton" id="rd1">
<input type="radio" name="radioButton" id="rd2">
<input type="radio" name="radioButton" id="rd3">
<input type="radio" name="radioButton" id="rd4">
<input type="radio" name="radioButton" id="rd5">

<script>
   $('input[name=slider]:nth-child(3)').prop('checked', true);
</script>
Run Code Online (Sandbox Code Playgroud)

我用.attr('checked','checked')测试了脚本.但脚本不正常.我错了什么?

jquery radio-button

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

检查输入的正确选择器和具有相同父项的标签是什么?

考试".subNav"有一个父元素,包括4个输入元素和4个与输入相关的标签.

<nav class="subNav">
    <input type="radio" name="subNav" id="s1">              
    <input type="radio" name="subNav" id="s2">
    <input type="radio" name="subNav" id="s3">
    <input type="radio" name="subNav" id="s4">
    <label for="s1"><h2>S1</h2></label>
    <label for="s2"><h2>S2</h2></label>
    <label for="s3"><h2>S3</h2></label>
    <label for="s4"><h2>S4</h2></label>
</nav>
Run Code Online (Sandbox Code Playgroud)

我想在输入其中一个输入时,它的标签会得到不同的背景颜色.但我不知道waht是正确的选择器.我使用下面的选择器,但不能正常工作:

#s1:checked ~ label:nth-child(1){ background-color: rgba(0, 0, 0, 0.5); }
Run Code Online (Sandbox Code Playgroud)

那么什么是正确的选择器?

html css css-selectors css3

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