Skip to content

Commit 7730271

Browse files
committed
only declare CSS vars once; pass vars file to postcss for reference
1 parent b5e4d10 commit 7730271

File tree

3 files changed

+2
-4
lines changed

3 files changed

+2
-4
lines changed

gulp.d/tasks/build.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ module.exports = (src, dest, preview) => () => {
5252
},
5353
},
5454
]),
55-
postcssVar({ preserve: preview }),
55+
// NOTE importFrom is for supplemental CSS files
56+
postcssVar({ importFrom: path.join(src, 'css', 'vars.css'), preserve: preview }),
5657
preview ? postcssCalc : () => {},
5758
autoprefixer,
5859
preview

src/css/home.css

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
@import "vars.css";
2-
31
.doc .panel {
42
margin-top: 1rem;
53
background-color: var(--color-smoke-50);

src/css/vendor/docsearch.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
@import "docsearch.js/dist/cdn/docsearch.css";
2-
@import "../vars.css";
32

43
.algolia-autocomplete .ds-dropdown-menu > :first-child {
54
max-height: calc(100vh - var(--navbar-height));

0 commit comments

Comments
 (0)