html-style
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesehtml-style
html-style
Transform barebones HTML into styled output using a specific design system.
使用特定设计系统将基础HTML转换为带样式的输出。
Workflow
工作流程
- Read the user's HTML
- Identify elements to style (tables, lists, status text, buttons, sections)
- Inject block from
<style>assets/base.css - Add appropriate classes to HTML elements
- Add interactive JS if needed (copy buttons, drafts, collapsible sections)
- 读取用户的HTML
- 识别需要样式化的元素(表格、列表、状态文本、按钮、区块)
- 从注入
assets/base.css代码块<style> - 为HTML元素添加合适的类
- 如有需要,添加交互式JS(复制按钮、草稿、可折叠区块)
Quick Class Reference
快速类参考
| Element | Class | Effect |
|---|---|---|
| Status text | | Red/green/orange inline text |
| Trend | | Green ↑ / Red ↓ |
| Category tag | | Blue/purple/orange pill |
| Status pill | | Filled green/red/orange |
| Filter toggle | | Outline / filled black |
| Time filter | | Small pill, black when active |
| Stat box | | 28px number, 12px label |
| Table | default or | Minimal or colored values |
| Section header | | Dark bar with white text |
| Collapsible | | Native HTML collapse |
| Insight | | Italic, yellow background |
| Tier | | Row background colors |
| 元素 | 类名 | 效果 |
|---|---|---|
| 状态文本 | | 红/绿/橙色行内文本 |
| 趋势 | | 绿色 ↑ / 红色 ↓ |
| 分类标签 | | 蓝/紫/橙色胶囊样式 |
| 状态胶囊 | | 填充式绿/红/橙色 |
| 筛选切换器 | | 轮廓样式 / 填充黑色 |
| 时间筛选器 | | 小型胶囊,激活时为黑色 |
| 统计框 | | 28px数字,12px标签 |
| 表格 | 默认或 | 极简样式或带颜色的值 |
| 区块标题 | | 深色栏配白色文本 |
| 可折叠元素 | | 原生HTML折叠功能 |
| 提示信息 | | 斜体,黄色背景 |
| 等级 | | 行背景色 |
Element Styling Rules
元素样式规则
Tables
表格
- Default: minimal borders, no hover
- Add for: hover effect,
.table-styled/.positivecell colors,.negativerows.highlight - Sortable: add with
th.sortable<a href="?sort=col">Col ▼</a>
- 默认:极简边框,无悬停效果
- 添加可实现:悬停效果、
.table-styled/.positive单元格颜色、.negative行高亮.highlight - 可排序:为添加
th.sortable<a href="?sort=col">Col ▼</a>
Status Indicators
状态指示器
- Text status (/
.stale/.warm): Use for inline status in sentences.pending - Status pills (): Use for badge-style indicators, typically with icon (✓ ✗ ◷)
.status-* - Trends (/
.trend-up): Use for numeric changes, adds arrow automatically.trend-down
- 文本状态(/
.stale/.warm):用于句子中的行内状态.pending - 状态胶囊():用于徽章式指示器,通常搭配图标(✓ ✗ ◷)
.status-* - 趋势(/
.trend-up):用于数值变化,自动添加箭头.trend-down
Sections
区块
Use with emoji prefix for visual breaks:
.section-headerhtml
<div class="section-header">🔴 URGENT</div>
<div class="section-header">🟠 PENDING</div>使用带emoji前缀的实现视觉分隔:
.section-headerhtml
<div class="section-header">🔴 URGENT</div>
<div class="section-header">🟠 PENDING</div>Interactive Elements
交互式元素
When HTML has drafts or copy buttons, add this JS:
javascript
function saveDraft(el) {
localStorage.setItem('draft:' + el.dataset.threadId, el.textContent);
}
function copyToClipboard(text, btn) {
navigator.clipboard.writeText(text).then(() => {
btn.textContent = 'Copied!';
setTimeout(() => btn.textContent = 'Copy', 1500);
});
}当HTML包含草稿或复制按钮时,添加以下JS:
javascript
function saveDraft(el) {
localStorage.setItem('draft:' + el.dataset.threadId, el.textContent);
}
function copyToClipboard(text, btn) {
navigator.clipboard.writeText(text).then(() => {
btn.textContent = 'Copied!';
setTimeout(() => btn.textContent = 'Copy', 1500);
});
}Deep Links
深度链接
Convert URLs to native app links:
- Telegram:
tg://resolve?domain=username - SMS:
sms:+14155551234
将URL转换为原生应用链接:
- Telegram:
tg://resolve?domain=username - SMS:
sms:+14155551234
Theme
主题
- Default: Light ()
background: #fff - Dark mode: Add to
class="dark"when user requests dark theme or context is trading/real-time<body>
- 默认:浅色()
background: #fff - 深色模式:当用户请求深色主题或场景为交易/实时数据时,为添加
<body>class="dark"
Compatibility with Structure Skills
与结构化技能的兼容性
When styling output from or , these class mappings apply:
quick-viewtable-filters为或的输出添加样式时,适用以下类映射:
quick-viewtable-filtersquick-view classes
quick-view 类映射
| Their Class | Style As |
|---|---|
| |
| |
| |
| Already styled (muted, small) |
| Already styled (muted header) |
| Inline button group |
| 原类名 | 样式化为 |
|---|---|
| |
| |
| |
| 已样式化(弱化、小字号) |
| 已样式化(弱化标题) |
| 行内按钮组 |
table-filters classes
table-filters 类映射
| Their Class | Style As |
|---|---|
| Flex row with gap |
| Inline chip container |
| Dark pill with |
| Dropdown panel ( |
| Centered, muted text |
The includes styles for these classes automatically.
base.css| 原类名 | 样式化为 |
|---|---|
| 带间距的Flex行 |
| 行内芯片容器 |
| 深色胶囊搭配 |
| 下拉面板( |
| 居中、弱化文本 |
base.cssResources
资源
- Full style reference: Read references/style-guide.md for detailed CSS patterns and examples
- Base CSS: Inject assets/base.css into tag in
<style><head>
- 完整样式参考:阅读references/style-guide.md获取详细CSS模式和示例
- 基础CSS:将assets/base.css注入到中的
<head>标签内<style>