这是bootstrap 4.0 SASS
我的style.scss文件包含以下代码:
@import "../bootstrap/scss/bootstrap";
@import "colors";
@import "main";
Run Code Online (Sandbox Code Playgroud)
和_colors.scss文件包含以下代码:
$bg-white : white;
$theme-colors: (
primary: #333333
)
Run Code Online (Sandbox Code Playgroud)
你可以看到我只是试图覆盖它,$theme-color('primary')但问题在于它什么也没做.
如果我转移@import "colors"文件的开头style.scss它给我以下错误:
错误../bootstrap/scss/_forms.scss(第284行:$ color:null不是`rgba'的颜色)
实际上,style.scss文件编译成style.css文件,那个文件是链接文件.
问题:如何$theme-color在bootstrap-4使用时覆盖输入SASS?
任何帮助将不胜感激,并提前致谢
干杯.
监听多个状态变化React.JS useEffect时使用 hook 的最佳实践是什么
第一的:
useEffect(() => {
if ( first ) {
// do the stuff for first state changes
}
if ( second ) {
// do the stuff for second state changes
}
})
Run Code Online (Sandbox Code Playgroud)
第二:
useEffect(() => {
// do the stuff for first state changes
}, [first])
useEffect(() => {
// do the stuff for second state changes
}, [second])
Run Code Online (Sandbox Code Playgroud)
这两种方法有何优缺点?
我知道这个问题已经被问到了,但我找不到我想要的答案.
我试图循环JSON data在ajax响应后我得到格式的数据.我的Javascript代码是:
function ajaxMe(){
$(function(){
$.ajax({
type : 'GET',
url : 's-test.php'
}).done(function(data){
values = [data];
alert(data)
})
});
}
Run Code Online (Sandbox Code Playgroud)
在values成功接收变量数据后,我尝试使用console.log(JSON.stringify(values)) in 打印它,console结果为:
["\r\n {\"lat\" : \"51.508742\", \"ln\" : \"-0.320850\" , \"name\" : \"my corporation\"},\r\n {\"lat\" : \"51.508742\", \"ln\" : \"-0.420850\" , \"name\" : \"my corporation\"},\r\n {\"lat\" : \"51.508742\", \"ln\" : \"-0.520850\" , \"name\" : \"my corporation\"},\r\n {\"lat\" : \"51.508742\", \"ln\" : \"-0.620850\" , \"name\" : \"my corporation\"},\r\n {\"lat\" : …Run Code Online (Sandbox Code Playgroud) 它是SASS.
问题是如何在 SASS 应用程序中使用 bootstrap 颜色变量?我所做的是:
color: $theme-colors(primary);
Run Code Online (Sandbox Code Playgroud)
但这不起作用并引发错误。
任何帮助表示赞赏。
谢谢
bootstrap-4 ×2
sass ×2
ajax ×1
javascript ×1
jquery ×1
json ×1
php ×1
react-hooks ×1
reactjs ×1