Skip to content

Commit 02e8963

Browse files
authored
Merge pull request #3344 from meeseeksmachine/auto-backport-of-pr-3342-on-7.x
Backport PR #3342 on branch 7.x (HTMLManager: Do not reset lab's CSS variables if they are defined)
2 parents a2a31ce + 20dc79a commit 02e8963

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

packages/html-manager/src/libembed.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,16 @@ __webpack_public_path__ = (window as any).__jupyter_widgets_assets_path__ || __w
66

77
import 'font-awesome/css/font-awesome.css';
88
import '@lumino/widgets/style/index.css';
9-
import '@jupyter-widgets/controls/css/widgets.css';
9+
import '@jupyter-widgets/controls/css/widgets-base.css';
10+
11+
// If lab variables are not found, we set them (we don't want to reset the variables if they are already defined)
12+
if (
13+
getComputedStyle(document.documentElement).getPropertyValue(
14+
'--jp-layout-color0'
15+
) === ''
16+
) {
17+
require('@jupyter-widgets/controls/css/labvariables.css');
18+
}
1019

1120
// Used just for the typing. We must not import the javascript because we don't
1221
// want to include it in the require embedding.

0 commit comments

Comments
 (0)