fix: inline xterm.css into injected style string (host never loads standalone lib/client.css, helper textarea was visible)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { Fragment, useCallback, useEffect, useRef, useState } from 'react'
|
||||
import { Terminal } from 'xterm'
|
||||
import 'xterm/css/xterm.css'
|
||||
|
||||
import MarkdownIt from 'markdown-it'
|
||||
import hljs from 'highlight.js/lib/core'
|
||||
import hljsTypescript from 'highlight.js/lib/languages/typescript'
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
export const css = [
|
||||
// xterm 自带样式以文本内联(宿主只加载 JS,独立的 lib/client.css 不会被注入——
|
||||
// 否则 xterm 的隐藏输入 textarea 会裸露成左上角的小输入框)
|
||||
// @ts-ignore
|
||||
import xtermCss from 'xterm/css/xterm.css'
|
||||
|
||||
export const css = xtermCss + '\n' + [
|
||||
// 区块整体
|
||||
'.dsh-wt_section{box-sizing:border-box;display:flex;flex-direction:column;gap:6px;width:100%;padding:0}',
|
||||
'.dsh-wt_float{min-width:176px;max-width:264px;background:var(--dsw-alias-bg-base,#0b0e14);border:1px solid var(--dsw-alias-border-l2,#3a4150);border-radius:10px;padding:8px;box-shadow:var(--dsw-shadow-lv2,0 8px 24px rgba(0,0,0,.4))}',
|
||||
|
||||
Reference in New Issue
Block a user