用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/shwilliamson/automatasaurus --skill css-standards命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | css-standards |
| description | CSS, SCSS, and styling conventions. Use when writing, reviewing, or debugging styles and layouts. |
/* Block: standalone component */
.card {}
/* Element: part of a block (double underscore) */
.card__header {}
.card__body {}
.card__footer {}
/* Modifier: variation of block/element (double hyphen) */
.card--featured {}
.card--compact {}
.card__header--large {}
/* Example usage */
.user-profile {}
.user-profile__avatar {}
.user-profile__name {}
.user-profile--verified {}
/* UserCard.module.css */
.container {}
.header {}
.avatar {}
.name {}
/* Composes for shared styles */
.primaryButton {
composes: button from './shared.module.css';
background: var(--color-primary);
}
/* When creating custom utilities */
.text-center { text-align: center; }
.mt-4 { margin-top: 1rem; }
.flex { display: flex; }
.hidden { display: none; }
/* Define in :root for global variables */
:root {
/* Colors */
--color-primary: #0066cc;
--color-primary-hover: #0052a3;
--color-secondary: #6c757d;
--color-success: #28a745;
--color-error: #dc3545;
--color-warning: #ffc107;
/* Text colors */
--color-text: #1a1a1a;
--color-text-muted: #6c757d;
--color-text-inverse: #ffffff;
/* Backgrounds */
--color-bg: #ffffff;
--color-bg-secondary: #f8f9fa;
--color-bg-tertiary: #e9ecef;
/* Spacing scale */
--space-xs: 0.25rem; /* 4px */
--space-sm: 0.5rem; /* 8px */
--space-md: 1rem; /* 16px */
--space-lg: 1.5rem; /* 24px */
--space-xl: 2rem; /* 32px */
--space-2xl: 3rem; /* 48px */
/* Typography */
--font-family: system-ui, -apple-system, sans-serif;
--font-family-mono: , Consolas, monospace;
: ;
: ;
: ;
: ;
: ;
: ;
: ;
: ;
: ;
: ;
: ;
: ;
: ;
: (, , , );
: (, , , );
: (, , , );
: ease;
: ease;
: ease;
: ;
: ;
: ;
: ;
}
(: dark) {
{
: ;
: ;
: ;
}
}
{
: ;
: ;
}
/* Common flex patterns */
.flex-center {
display: flex;
align-items: center;
justify-content: center;
}
.flex-between {
display: flex;
align-items: center;
justify-content: space-between;
}
.flex-column {
display: flex;
flex-direction: column;
}
/* Gap for spacing (preferred over margins) */
.flex-row {
display: flex;
gap: var(--space-md);
}
/* Auto-fit responsive grid */
.grid-auto {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: var(--space-lg);
}
/* Fixed columns */
.grid-3 {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: var(--space-md);
}
/* Named areas for complex layouts */
.page-layout {
display: grid;
grid-template-areas:
"header header"
"sidebar main"
"footer footer";
grid-template-columns: 250px 1fr;
grid-template-rows: auto 1fr auto;
min-height: 100vh;
}
.header { grid-area: header; }
.sidebar { grid-area: sidebar; }
.main { grid-area: main; }
.footer { grid-area: footer; }
/* Mobile-first breakpoints */
/* Base styles = mobile */
.container {
padding: var(--space-md);
}
/* Tablet and up */
@media (min-width: 768px) {
.container {
padding: var(--space-lg);
}
}
/* Desktop and up */
@media (min-width: 1024px) {
.container {
padding: var(--space-xl);
max-width: 1200px;
margin: 0 auto;
}
}
/* Large desktop */
@media (min-width: 1280px) {
.container {
max-width: 1400px;
}
}
/* Custom properties for breakpoint-aware values */
:root {
--container-padding: var(--space-md);
}
@media (min-width: 768px) {
:root {
--container-padding: var(--space-lg);
}
}
.button {
display: inline-flex;
align-items: center;
justify-content: center;
gap: var(--space-xs);
padding: var(--space-sm) var(--space-md);
font-size: var(--font-size-md);
font-weight: 500;
line-height: 1;
border: none;
border-radius: var(--border-radius-md);
cursor: pointer;
transition: background-color var(--transition-fast),
transform var(--transition-fast);
}
.button:hover {
transform: translateY(-1px);
}
.button:active {
transform: translateY(0);
}
.button:disabled {
opacity: 0.5;
cursor: not-allowed;
transform: none;
}
.button--primary {
background-color: var(--color-primary);
color: var(--color-text-inverse);
}
.button--primary:hover {
background-color: var(--color-primary-hover);
}
.button--secondary {
: transparent;
: solid (--color-primary);
: (--color-primary);
}
.input {
width: 100%;
padding: var(--space-sm) var(--space-md);
font-size: var(--font-size-md);
line-height: var(--line-height-normal);
background-color: var(--color-bg);
border: 1px solid var(--color-bg-tertiary);
border-radius: var(--border-radius-md);
transition: border-color var(--transition-fast),
box-shadow var(--transition-fast);
}
.input:focus {
outline: none;
border-color: var(--color-primary);
box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}
.input:invalid {
border-color: var(--color-error);
}
.input::placeholder {
color: var(--color-text-muted);
}
.card {
background-color: var(--color-bg);
border-radius: var(--border-radius-lg);
box-shadow: var(--shadow-md);
overflow: hidden;
}
.card__header {
padding: var(--space-md) var(--space-lg);
border-bottom: 1px solid var(--color-bg-tertiary);
}
.card__body {
padding: var(--space-lg);
}
.card__footer {
padding: var(--space-md) var(--space-lg);
background-color: var(--color-bg-secondary);
}
/* Focus styles - never remove, only enhance */
:focus-visible {
outline: 2px solid var(--color-primary);
outline-offset: 2px;
}
/* Skip link for keyboard navigation */
.skip-link {
position: absolute;
top: -100%;
left: 0;
padding: var(--space-sm) var(--space-md);
background: var(--color-primary);
color: var(--color-text-inverse);
z-index: var(--z-tooltip);
}
.skip-link:focus {
top: 0;
}
/* Visually hidden but accessible */
.sr-only {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
border: 0;
}
/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
*,
*,
* {
: ;
: ;
: ;
}
}
(: high) {
{
: solid currentColor;
}
}
// Variables (or use CSS custom properties)
$breakpoint-tablet: 768px;
$breakpoint-desktop: 1024px;
// Mixins
@mixin respond-to($breakpoint) {
@if $breakpoint == tablet {
@media (min-width: $breakpoint-tablet) { @content; }
} @else if $breakpoint == desktop {
@media (min-width: $breakpoint-desktop) { @content; }
}
}
@mixin flex-center {
display: flex;
align-items: center;
justify-content: center;
}
// Usage
.hero {
padding: var(--space-lg);
@include flex-center;
@include respond-to(tablet) {
padding: var(--space-xl);
}
}
// Nesting (keep shallow - max 3 levels)
.card {
background: var(--color-bg);
&__header {
padding: var(--space-md);
}
&--featured {
border: 2px solid var(--color-primary);
}
&:hover {
box-shadow: var(--shadow-lg);
}
}
Check .claude/commands.md for project-specific commands. Common CSS commands:
# Build CSS
npm run build:css
# Watch for changes
npm run watch:css
# Lint CSS
npx stylelint "**/*.css"
npx stylelint "**/*.scss"
# Format
npx prettier --write "**/*.css"