网站设计系统

设计与多媒体 社区

技能解读

当前原文的自动摘译,尚未人工审校。

何时使用

创建新的 Astro 组件或页面部分 添加或修改 CSS(全局或范围) 在现有实用程序类之间进行选择 定义新的 CSS 变量 审查涉及网站样式的 PR

主题

该站点在 <html> 上使用 data-theme 属性。支持两种主题:主题 · 选择器 · 调色板复古(默认) · :root · Game Boy 绿光 · [data-theme="light"] · 温暖中性色

规则

所有颜色必须使用 CSS 变量 - 切勿硬编码十六进制值 新变量必须在 :root(复古)和 global.css 中的 [data-theme="light"] 块中定义 切勿修改主题切换器机制或其 localStorage 键

响应式断点

移动优先的方法。默认样式针对移动设备;使用min-width进行扩展。断点 · 目标 · 模式默认 · 移动设备 · 单列,紧凑间距 min-width: 640px · 平板电脑 · 2 列网格,扩展间距 min-width: 1024px · 桌面 · 3-4 列网格,完整布局

网格公用事业

使用现有的网格类:.grid-2、.grid-3、.grid-4。

流狐档案 运行与权限由流狐静态检查推断,不代表作者声明或实际测试结果。
领域
设计与多媒体
作者声明的智能体
未找到明确声明;不据此推断已兼容或已测试
静态检查
88 / 100 · 启发式扫描,不代表运行安全
运行环境证据
未执行;当前没有隔离运行测试证据
作者 / 版本 / 许可证
@macalbert · 未声明许可证
上下文用量评级
低消耗
接入复杂程度
即装即用
是否需要外部接口密钥
不需要
兼容的系统
未声明(默认跨平台)
运行环境要求
未检出明确要求
检测到的文件与系统行为
  • 只读
  • 允许写入 / 修改
网络行为
仅限本地
安装命令数
无(仅作为资料)

需要注意: 未声明工具权限范围;实际权限由运行环境决定。

作者说明文件(原文) SKILL.md

# Website Design System

Rules and patterns for the Envilder website's pure CSS design system.

## When to Use

- Creating new Astro components or page sections
- Adding or modifying CSS (global or scoped)
- Choosing between existing utility classes
- Defining new CSS variables
- Reviewing PRs that touch website styling

## Themes

The site uses `data-theme` attribute on `<html>`. Two themes are supported:

| Theme | Selector | Palette |
|-------|----------|---------|
| Retro (default) | `:root` | Game Boy green |
| Light | `[data-theme="light"]` | Warm neutrals |

### Rules

- **All colors MUST use CSS variables** — never hardcode hex values
- New variables MUST be defined in **both** `:root` (retro) and
  `[data-theme="light"]` blocks in `global.css`
- Never modify the theme switcher mechanism or its localStorage key

```css
/* ✓ Correct */
color: var(--color-text);
background: var(--color-bg);

/* ✗ NEVER */
color: #8bac0f;
background: #1a1a2e;
```

## Responsive Breakpoints

Mobile-first approach. Default styles target mobile; expand with `min-width`.

| Breakpoint | Target | Pattern |
|------------|--------|---------|
| Default | Mobile | Single column, compact spacing |
| `min-width: 640px` | Tablet | 2-column grids, expanded spacing |
| `min-width: 1024px` | Desktop | 3-4 column grids, full layout |

### Grid Utilities

Use existing grid classes: `.grid-2`, `.grid-3`, `.grid-4`.

## Spacing & Layout

Use the spacing scale defined in `global.css`:

- Variables: `--space-xs` through `--space-4xl`
- Container max-width: `--max-width` (1200px)

## Typography

| Use | Font | Access |
|-----|------|--------|
| Section titles / pixel style | Press Start 2P | Via `.pixel-card h3` or custom class |
| Body text | Inter | Default (inherited) |
| Code / terminal | JetBrains Mono | `<code>`, `<pre>`, or mono class |

- Use `clamp()` for fluid typography
- Never use fixed `px` font sizes

## Component Patterns

Reuse existing CSS classes for visual consistency:

| Class | Purpose |
|-------|---------|
| `.pixel-card` | Bordered cards with pixel corner notches |
| `.pixel-icon` | Emoji with pixelated filter |
| `.pixel-shadow` | 4px offset retro shadow |
| `.badge` | Small label badges |
| `.pixel-divider` | Section separator |
| `.scanlines` | CRT overlay effect (use sparingly) |
| `.section` | Standard section wrapper with vertical padding |

## File Locations

| What | Where |
|------|-------|
| Global CSS | `src/website/src/styles/global.css` |
| Components | `src/website/src/components/*.astro` |
| Layout | `src/website/src/layouts/BaseLayout.astro` |

## Constraints

- DO NOT install CSS frameworks or UI libraries — use existing pure CSS
- DO NOT hardcode colors — always CSS variables from `global.css`
- DO NOT use fixed pixel font sizes — use `clamp()` or relative units
- DO NOT break existing responsive layouts when adding new sections
- DO NOT add JavaScript frameworks (React, Vue) — Astro components +
  `<script>` tags only
- ONLY add new CSS variables if defined in both theme blocks

讨论

基于 GitHub Discussions。登录 GitHub 即可参与讨论、点赞、订阅更新。