Skip to content

Commit 7a6cff5

Browse files
committed
fix: add comments for CSS injection
1 parent 097ed4a commit 7a6cff5

File tree

1 file changed

+6
-1
lines changed
  • lib/generators/app/templates/src/awesome-script

1 file changed

+6
-1
lines changed

lib/generators/app/templates/src/awesome-script/app.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,15 @@ function Counter() {
2626
);
2727
}
2828

29+
// Inject CSS
30+
GM_addStyle(globalCss);
31+
2932
// Let's create a movable panel using @violentmonkey/ui
3033
const panel = getPanel({
3134
theme: 'dark',
32-
style: [globalCss, stylesheet].join('\n'),
35+
// If shadowDOM is enabled for `getPanel` (by default), `style` will be injected to the shadow root.
36+
// Otherwise, it is roughly the same as `GM_addStyle(stylesheet)`.
37+
style: stylesheet,
3338
});
3439
Object.assign(panel.wrapper.style, {
3540
top: '10vh',

0 commit comments

Comments
 (0)