Skip to content

Commit 4d70926

Browse files
committed
🐛fix the typo
1 parent be9330f commit 4d70926

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "my-sv",
2+
"name": "tampermonkey-emoji-commit-github",
33
"private": true,
44
"version": "0.0.0",
55
"type": "module",

src/main.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
import App from './App.svelte';
2-
import tailwindBase from './assets/tailwind.css';
2+
import tailwindBase from './assets/tailwind.css?inline';
33
// 创建顶层 document 环境的 dom 节点
44
function createContainerInDocument() {
55
const container = document.createElement('div');
6-
container.id = 'tempermonkey-app';
6+
container.id = 'tampermonkey-app';
77
container.style.zIndex = "2147483647";
88
container.style.position = "fixed";
99
return container;
1010
}
11-
// 创建 shadowRoot 环境下的 container 节点(用于挂在 Vue 示例)
11+
// 创建 shadowRoot 环境下的 container 节点(用于挂载 Svelte 示例)
1212
function containerInShadowRoot() {
1313
const container = document.createElement('div');
14-
container.id = 'tempermonkey-app-shadow-container';
14+
container.id = 'tampermonkey-app-in-shadow-container';
1515
return container;
1616
}
1717
function createDom() {
@@ -23,6 +23,7 @@ function createDom() {
2323
return containerInShadow;
2424
}
2525
function copyCssFromMainDocument(container) {
26+
// // 将 main document 中的 css 拷贝到 shadow document 中
2627
// [...document.querySelectorAll('style')].map((i)=>i.cloneNode(true)).forEach((i)=>container.appendChild(i));
2728
// [...document.querySelectorAll('link')].map(i=>i.cloneNode(true)).forEach(i=>container.appendChild(i));
2829
const styleDom = document.createElement('style');

0 commit comments

Comments
 (0)