skills/web-dev/web-css/SKILL.md
CSS: Grid/Flexbox, custom properties, animations, media queries, BEM, CSS Modules, :has/:is
npx skillsauth add alphaonedev/openclaw-graph web-cssInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill allows OpenClaw to generate, optimize, and debug CSS code focusing on advanced features like Grid and Flexbox layouts, custom properties (variables), animations, media queries, BEM methodology, CSS Modules, and selectors like :has() and :is().
Use this skill for web development tasks involving styling components, such as creating responsive layouts, animating elements, or modularizing styles in projects using frameworks like React or Vue. Apply it when code needs to be efficient, maintainable, and compatible with modern browsers.
display: grid; grid-template-columns: repeat(3, 1fr);) or Flexbox (e.g., display: flex; justify-content: space-between;).--primary-color: #007bff; for theming.@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }.@media (max-width: 768px) { .container { flex-direction: column; } }..block__element--modifier for scalable CSS.import styles from './styles.module.css'; and using className={styles.button}.div:has(p) { margin: 10px; } or button:is(:hover, :active) { background: red; }.To invoke this skill in OpenClaw, use the CLI command: openclaw execute web-css --input "task description" --options key=value. For API integration, send a POST request to /api/skills/web-css with a JSON body like { "task": "generate grid layout", "params": { "elements": 3 } }. Always set the environment variable for authentication: $OPENCLAW_API_KEY. Pass inputs as strings or JSON objects; for example, specify CSS features via flags like --feature grid or --feature animations.
openclaw execute web-css --task generate --type flexbox --properties "justify-content:center; align-items:center;" to output a Flexbox snippet.{ "action": "add-animation", "selector": ".fade-element", "keyframes": "from { opacity: 0; }" } to append animation code.openclaw execute web-css --optimize --breakpoints "mobile:480px, tablet:768px" to refine responsive styles.{ "bem": true, "modules": { "path": "./src/styles" } }. For CSS Modules, ensure output includes import statements like import styles from './Component.module.css';..container {
display: flex;
flex-wrap: wrap;
}
Generated via openclaw execute web-css --task layout --type flexbox.Integrate this skill with build tools like Webpack or Vite by wrapping outputs in module formats. For example, pipe OpenClaw output to a CSS processor: openclaw execute web-css --output file.css && postcss file.css --use autoprefixer. If using in a Node.js environment, import as const openclaw = require('openclaw-sdk'); openclaw.run('web-css', { auth: process.env.OPENCLAW_API_KEY });. Ensure CSS outputs are compatible with your framework; for React, generate class names that match BEM patterns. Handle dependencies by including libraries like css-loader for modules.
Common errors include invalid CSS syntax or missing API keys; check for "SyntaxError" in responses and retry with corrected input. If authentication fails, verify $OPENCLAW_API_KEY is set and not expired. For API calls, catch HTTP errors like 401 (unauthorized) by logging and prompting for re-auth. Example: In code, use try-catch:
try {
const response = await fetch('/api/skills/web-css', { headers: { 'Authorization': `Bearer ${process.env.OPENCLAW_API_KEY}` } });
if (!response.ok) throw new Error('API error');
} catch (error) {
console.error('Handle:', error.message); // Output: "API error"
}
Always validate inputs before execution, e.g., ensure selectors are valid strings.
Flexbox Layout Generation: To create a responsive navigation bar, run openclaw execute web-css --task generate-layout --type flexbox --selectors ".nav" --properties "justify-content:space-around;". This outputs:
.nav {
display: flex;
justify-content: space-around;
}
Then, integrate it into your HTML as <nav class="nav">...</nav>.
Media Query for Responsiveness: For a grid-based gallery, use openclaw execute web-css --task add-media --breakpoint "768px" --selector ".gallery" --styles "grid-template-columns:1fr;". Resulting snippet:
@media (min-width: 768px) {
.gallery { grid-template-columns: repeat(2, 1fr); }
}
Apply this in a project to make the gallery adapt to tablet screens.
tools
Root web development: project structure, tooling selection, deployment decisions
development
WebAssembly: Rust/Go/C to WASM, wasm-bindgen, Emscripten, WASM Component Model
development
Vue 3: Composition API script setup, Pinia, Vue Router 4, SFCs, Vite, Nuxt 3
tools
Tailwind CSS 4: utility classes, config, JIT, arbitrary values, darkMode, plugins, shadcn/ui