Skip to content

Commit 70bfd93

Browse files
committed
fix(card): build lightdom at build time
1 parent fb6dcb4 commit 70bfd93

File tree

6 files changed

+12
-2
lines changed

6 files changed

+12
-2
lines changed

.changeset/brave-feet-sing.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@patternfly/pfe-card": patch
3+
"@patternfly/pfe-cta": patch
4+
---
5+
6+
build pfe-card and pfe-cta's light dom CSS during the `build` command

docs/demo/demo.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ if (!HTMLIncludeElement.prototype.attributeChangedCallback.toString().includes('
99
console.info('No need to patch <html-include>');
1010
} else {
1111
console.info('Patching <html-include>');
12+
// @ts-expect-error: tla is available
13+
await customElements.whenDefined('html-include');
1214
const isLinkAlreadyLoaded = (link: HTMLLinkElement) => {
1315
try {
1416
return !!(link.sheet && link.sheet.cssRules);

elements/pfe-card/demo/pfe-card.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<link rel="stylesheet" href="/core/pfe-styles/pfe-context.min.css">
44
<link rel="stylesheet" href="/core/pfe-styles/pfe-layouts.min.css">
55
<link rel="stylesheet" href="/core/pfe-styles/pfe.min.css">
6-
<link rel="stylesheet" href="/elements/pfe-card/pfe-card---lightdom.min.css">
6+
<link rel="stylesheet" href="/elements/pfe-card/pfe-card--lightdom.min.css">
77
<link rel="stylesheet" href="/elements/pfe-card/demo/demo.css">
88

99
<pfe-card color="lightest" border class="button-series">

elements/pfe-card/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"build:clean": "npm run clean",
2828
"build:esbuild": "node ../../scripts/build.js --include pfe-card",
2929
"build:analyze": "npm run analyze",
30+
"build:lightdom": "sass pfe-card--lightdom.scss pfe-card--lightdom.min.css --style=compressed --load-path=../../node_modules",
3031
"build:types": "tsc -b .",
3132
"🧑‍🔬-----TEST-------🧑‍🔬": "❓ Test packages",
3233
"test": "wtr --files './test/*.spec.ts' --config ../../web-test-runner.config.js",

elements/pfe-cta/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"build": "run-s build:*",
2727
"build:clean": "npm run clean",
2828
"build:esbuild": "node ../../scripts/build.js --include pfe-cta",
29-
"build:lightdom": "sass pfe-cta--lightdom.scss pfe-cta--lightdom.css --load-path=../../node_modules",
29+
"build:lightdom": "sass pfe-cta--lightdom.scss pfe-cta--lightdom.min.css --style=compressed --load-path=../../node_modules",
3030
"build:analyze": "npm run analyze",
3131
"build:types": "tsc -b .",
3232
"🧑‍🔬-----TEST-------🧑‍🔬": "❓ Test packages",

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"build:analyze": "lerna run analyze --parallel",
3030
"build:styles": "npm run build --workspace @patternfly/pfe-styles",
3131
"build:core": "npm run build --workspace @patternfly/pfe-core",
32+
"build:lightdom": "npm run build:lightdom --workspaces --if-present",
3233
"build:elements": "scripts/build.js",
3334
"build:types": "tsc -b",
3435
"build:docs": "run-s build:docs:*",

0 commit comments

Comments
 (0)