是否可以使用:root带有 ID 或类的选择器?我正在尝试翻转不同页面上的颜色。
:root {
--color-one: red;
--color-two: blue;
}
/* Can something like this happen? */
.posts:root {
--color-one: green;
--color-two: yellow;
}
Run Code Online (Sandbox Code Playgroud)
我想在引入类时覆盖根变量。我知道我可以用 JS 实现,但如果可能的话我想使用纯 CSS。
干杯!
我正在用Gulp创建一个静态站点生成器.我想知道如何将每个数据(JSON)传输到单个jade模板中以生成多个html文件.这是gulp'模板'任务:
gulp.task('templates', function () {
'use strict';
var myData = JSON.parse(fs.readFileSync('./_assets/data/content.json'));
var myPages = myData.pages;
var myPosts = myData.posts;
gulp.src('./_assets/templates/index.jade')
.pipe(data(function (file) {
return myData;
}))
.pipe(jade())
.pipe(minifyhtml())
.pipe(gulp.dest('./_site/'))
.pipe(connect.reload());
// this is my dumb attempt at trying to
// output each piece of data and than
// have jade create an html file...
for (var i in myPages) {
gulp.src('./_assets/templates/page.jade')
.pipe(data(function (file) {
return myPages[i];
}))
.pipe(jade())
.pipe(minifyhtml())
.pipe(gulp.dest('./_site/'))
.pipe(connect.reload());
}
});
function applyTemplate(data, template) {
'use …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用网站上的快速指南设置一个新的方形空间开发者网站.
https://developers.squarespace.com/get-started
我无法登录我的squarespace帐户,然后同步这些网站.输入密码后出现以下错误.
ERROR: { StatusCodeError: 404 - "<html>\n<head>\n<title>404 Not Found</title>\n<style> body { background-color: #F2F2F2; color: #3E3E3E; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 12px; } pre { word-wrap: break-word; } </style>\n</head>\n<body>\n<h1>404 Not Found</h1>\n<p><pre>oy7BQZNq/qHYGjXF0 @ Thu, 18 Jan 2018 20:27:51 GMT</pre>\n<p><pre>SEC-1306</pre>\n<p><pre></pre>\n</body>\n</html>"
at new StatusCodeError (/Users/cwahlfeldt/Apps/base-template-npm/node_modules/request-promise-core/lib/errors.js:32:15)
at Request.plumbing.callback (/Users/cwahlfeldt/Apps/base-template-npm/node_modules/request-promise-core/lib/plumbing.js:104:33)
at Request.RP$callback [as _callback] (/Users/cwahlfeldt/Apps/base-template-npm/node_modules/request-promise-core/lib/plumbing.js:46:31)
at Request.self.callback (/Users/cwahlfeldt/Apps/base-template-npm/node_modules/request/request.js:186:22)
at Request.emit (events.js:160:13)
at Request.<anonymous> (/Users/cwahlfeldt/Apps/base-template-npm/node_modules/request/request.js:1163:10)
at Request.emit (events.js:160:13)
at IncomingMessage.<anonymous> (/Users/cwahlfeldt/Apps/base-template-npm/node_modules/request/request.js:1085:12)
at Object.onceWrapper (events.js:255:19)
at IncomingMessage.emit (events.js:165:20)
at endReadableNT (_stream_readable.js:1101:12)
at process._tickCallback (internal/process/next_tick.js:152:19) …Run Code Online (Sandbox Code Playgroud)