Skip to content

Commit fc37dcf

Browse files
authored
build: allow empty theme assets during build step (#2407)
1 parent 2592754 commit fc37dcf

File tree

3 files changed

+21
-13
lines changed

3 files changed

+21
-13
lines changed

tools/component-builder-simple/css/index.js

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ function buildCSS() {
2222
"index.css",
2323
"themes/spectrum.css", // spectrum comes first
2424
"themes/*.css",
25-
])
25+
], {
26+
allowEmpty: true,
27+
})
2628
.pipe(concat("index.css"))
2729
.pipe(
2830
postcss(processors, {
@@ -38,7 +40,9 @@ function buildCSSWithoutThemes() {
3840
"index.css",
3941
"themes/spectrum.css", // spectrum comes first
4042
"themes/*.css",
41-
])
43+
], {
44+
allowEmpty: true,
45+
})
4246
.pipe(concat("index-base.css"))
4347
.pipe(
4448
postcss(processorsFunction({ noFlatVariables: true }), {
@@ -53,15 +57,19 @@ function buildCSSThemeIndex() {
5357
.src([
5458
"themes/spectrum.css", // spectrum comes first
5559
"themes/*.css",
56-
])
60+
], {
61+
allowEmpty: true,
62+
})
5763
.pipe(concat("index-theme.css"))
5864
.pipe(postcss(processorsFunction({ noSelectors: true })))
5965
.pipe(gulp.dest("dist/"));
6066
}
6167

6268
function buildCSSThemes() {
6369
return gulp
64-
.src(["themes/*.css"])
70+
.src(["themes/*.css"], {
71+
allowEmpty: true,
72+
})
6573
.pipe(postcss(processorsFunction({ noSelectors: true })))
6674
.pipe(gulp.dest("dist/themes/"));
6775
}
@@ -71,7 +79,9 @@ function buildCSSThemes() {
7179
*/
7280
function buildExpressTheme() {
7381
return gulp
74-
.src(["dist/index-theme.css"])
82+
.src(["dist/index-theme.css"], {
83+
allowEmpty: true,
84+
})
7585
.pipe(concat("express.css"))
7686
.pipe(postcss(processorsFunction().concat(require("postcss-combininator"))))
7787
.pipe(gulp.dest("dist/themes/"));

tools/component-builder/css/lib/varUtils.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,9 @@ function getAllVars() {
169169
`${varDir}/css/globals/*.css`,
170170
`${varDir}/custom.css`,
171171
coreTokensFile,
172-
])
172+
], {
173+
allowEmpty: true,
174+
})
173175
.pipe(concat("everything.css"))
174176
.pipe(
175177
through.obj(function getAllVars(file, enc, cb) {
@@ -194,7 +196,9 @@ function getAllComponentVars() {
194196
`${varDir}/css/components/*.css`,
195197
`${varDir}/css/globals/*.css`,
196198
`${varDir}/custom.css`,
197-
])
199+
], {
200+
allowEmpty: true,
201+
})
198202
.pipe(concat("everything.css"))
199203
.pipe(
200204
through.obj(function getAllVars(file, enc, cb) {

tools/component-builder/css/vars.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,12 @@ governing permissions and limitations under the License.
1212

1313
const gulp = require("gulp");
1414
const through = require("through2");
15-
const postcss = require("postcss");
1615
const logger = require("gulplog");
1716
const fsp = require("fs").promises;
1817
const path = require("path");
1918

2019
const varUtils = require("./lib/varUtils");
2120

22-
// Todo: get these values from a common place?
23-
let colorStops = ["darkest", "dark", "light", "lightest"];
24-
25-
let scales = ["medium", "large"];
26-
2721
function bakeVars() {
2822
return gulp
2923
.src(["dist/index-vars.css"], {

0 commit comments

Comments
 (0)