css-layout-solver

css-layout-solver is a skill for Claude Code, Codex from khalilbenaz/claude-skills-collection. It costs 89 tokens per session (2,099 once invoked), scanned A, original, MIT.

A guide to diagnosing CSS layout problems with Flexbox, Grid, container queries, overflow checks, and stacking-context analysis. Flexbox arranges items in one direction, while Grid handles rows and columns.

In plain words
What is it for?
Use it to fix centering, responsive layouts, variable-width columns, Flexbox and Grid issues, overflow, and z-index problems.
Why use it?
It helps explain misalignment, unwanted overflow, collapsed layouts, and elements appearing behind others before changing the CSS.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to fix centering, responsive layouts, variable-width columns, Flexbox and Grid issues, overflow, and z-index problems.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/khalilbenaz/claude-skills-collection/css-layout-solver
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add khalilbenaz/claude-skills-collection --skill css-layout-solver
Clone the repo
git clone --depth 1 https://github.com/khalilbenaz/claude-skills-collection

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for css-layout-solver

README.md
[![agentmods](https://agentmods.dev/badge/skills/khalilbenaz/claude-skills-collection/css-layout-solver/github.svg)](https://agentmods.dev/skills/khalilbenaz/claude-skills-collection/css-layout-solver)
Your own site
<a href="https://agentmods.dev/skills/khalilbenaz/claude-skills-collection/css-layout-solver"><img src="https://agentmods.dev/badge/skills/khalilbenaz/claude-skills-collection/css-layout-solver/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for css-layout-solver

Your own site · 80×15
<a href="https://agentmods.dev/skills/khalilbenaz/claude-skills-collection/css-layout-solver"><img src="https://agentmods.dev/badge/skills/khalilbenaz/claude-skills-collection/css-layout-solver.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 89 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,099 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00089 $0.02099
Opus 5 $0.00044 $0.01050
Sonnet 5 $0.00018 $0.00420
Haiku 4.5 $0.00009 $0.00210

Measured 8d ago against content hash 174ae42e29e3, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

css-layout-solver scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

dev-skills/css-layout-solver/SKILL.md · 217 lines

How it starts

The opening of the file, as written. The whole thing — 217 lines — stays where its author put it; the contents beside it link to each section on GitHub.

CSS Layout Solver

Étape 1 — Diagnostiquer avant de coder

Avant toute solution, collecter :

  • Ce que l'utilisateur voit : screenshot ou description du bug (débordement, mauvais alignement, collapse, etc.)
  • Ce qu'il attend : maquette ou description du résultat cible
  • Contexte DOM : nesting, nombre d'enfants, largeur/hauteur connue ou dynamique

Questions de triage rapide :

  1. Le problème est-il unidimensionnel (ligne OU colonne) → Flexbox
  2. Le problème est-il bidimensionnel (lignes ET colonnes) → Grid
  3. Le composant doit-il réagir à sa propre taille (pas au viewport) → Container Queries
  4. Y a-t-il un overflow ou un z-index suspect → Diagnostic stacking context

Étape 2 — Critères de choix de technique

Besoin Technique Éviter
Centrer un élément (1D) display:flex; align-items:center; justify-content:center margin:auto seul sans contexte flex/grid
Grille fixe (colonnes répétées) grid-template-columns: repeat(3, 1fr) float + clearfix
Colonnes de taille variable grid-template-columns: auto 1fr auto display:table-cell
Layout responsive sans media query grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)) media queries manuelles
Taille fluide entre deux bornes clamp(1rem, 2.5vw, 2rem) valeurs px fixes
Composant réutilisable responsive @container media query sur viewport
Sticky header/footer position:sticky; top:0 position:fixed (sort du flux)

Étape 3 — Snippets copiables par cas fréquent

Centrage universel (Flex)

.wrapper {
  display: flex;
  align-items: center;     /* axe transversal */
  justify-content: center; /* axe principal */
  min-height: 100dvh;      /* dvh : tient compte des barres mobiles */
}

Grille responsive sans media query

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 1.5rem;
}
/* min(100%, 280px) évite l'overflow sur petits écrans */

Read the full file on GitHub · 217 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 217 lines · 89 tokens per session scan A 174ae42e29e3

Subscribe to this mod's changes

css-layout-solver is a skill published in the GitHub repository khalilbenaz/claude-skills-collection (22 stars, last pushed 18d ago), licensed MIT. It adds 89 tokens to every session and 2,099 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.