Agent skill

CSS Expert Skill: Modern Flexbox, Grid and Container Queries

The css-expert skill from OpenFang gives an AI coding agent a compact CSS rulebook covering flexbox versus grid, custom property tokens, container queries, cascade layers, fluid type and common layout pitfalls.

Install
curl -fsSL https://openfang.sh/install | sh
View on GitHub

Stars, license and last push from GitHub. Install count as reported by the open skills directory.

What is the css-expert skill?

The css-expert skill is a single SKILL.md bundled with OpenFang. It briefs an AI coding agent as a front-end layout specialist, with principles, techniques, four layout patterns and four pitfalls covering flexbox, grid, custom properties, container queries, cascade layers and animation. It has no scripts or reference files.

Its first principle fits on one line: flexbox for one dimensional layouts, CSS Grid for two dimensional ones. The rest of this short SKILL.md expands that stance into a rulebook for responsive, accessible and maintainable styles.

The skill is one of the 60 bundled skills in OpenFang, an open source agent operating system written in Rust. The folder contains only SKILL.md, so there are no scripts or reference files to load.

The five principles

  • Flexbox for rows or columns, Grid for rows and columns together.
  • Custom properties for themes, spacing scales and any repeated value.
  • Mobile first design with min-width media queries.
  • Logical properties such as inline-start and block-end over left and bottom.
  • Cascade layers with @layer instead of !important.

Techniques it names

  • grid-template-areas for named regions, and auto-fit or auto-fill with minmax() for grids that need no media queries.
  • Design tokens as custom properties on :root, such as --color-primary and --space-md.
  • @container queries so a component responds to its parent, not the viewport.
  • @keyframes animation built on transform and opacity.
  • Transitions of 150 to 300ms on hover and focus-visible states.
  • The :has() selector, plus :is() and :where() for controlled specificity.

Four patterns and four pitfalls

The patterns are a Holy Grail grid, fluid type with clamp(), aspect-ratio boxes and a dark mode toggle built from token swaps. The pitfalls warn against fixed pixel containers, arbitrary z-index stacking, unchecked vendor prefixes and deep preprocessor nesting.

Who the css-expert skill is for

Best for

Not for

  • Tailwind first projects. See tailwind-design-system for utility class conventions.
  • Deep layout theory. The file is a compact summary and shows no worked code.

Use it with UiChemy

UiChemy Composer is an AI visual editor that writes real HTML, CSS and JS inside Elementor or Gutenberg. Use the skill to sharpen the layout rules your agent follows, then build the page in Figma or UiChemy Composer. Click Get Started on uichemy.com. For grid detail, see layout-grid.