Skip to content

Commit 1bafc49

Browse files
authored
Merge pull request #12704 from CesiumGS/sandcastle-ff-hack
Add hack to avoid Firefox styling bug
2 parents cc8c6e0 + 35f062c commit 1bafc49

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Apps/Sandcastle/CesiumSandcastle.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,10 @@ require({
618618

619619
// Apply user HTML to bucket.
620620
const htmlElement = bucketDoc.createElement("div");
621-
htmlElement.innerHTML = htmlEditor.getValue();
621+
// Stylesheet imports are weirdly broken in Firefox 140. This is a hacky workaround
622+
// https://github.com/CesiumGS/cesium/issues/12700
623+
const htmlCode = htmlEditor.getValue().replace(/@import/, "@import ");
624+
htmlElement.innerHTML = htmlCode;
622625
bucketDoc.body.appendChild(htmlElement);
623626

624627
const onScriptTagError = function () {
@@ -1176,7 +1179,9 @@ require({
11761179
baseHref = `${baseHref.substring(0, pos)}/gallery/`;
11771180

11781181
const code = jsEditor.getValue();
1179-
const html = htmlEditor.getValue();
1182+
// Stylesheet imports are weirdly broken in Firefox 140. This is a hacky workaround
1183+
// https://github.com/CesiumGS/cesium/issues/12700
1184+
const html = htmlEditor.getValue().replace(/@import/, "@import ");
11801185
const data = makeCompressedBase64String([code, html, baseHref]);
11811186

11821187
let url = getBaseUrl();

0 commit comments

Comments
 (0)