css-spacing-layout — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited css-spacing-layout (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
You are an expert in CSS spacing systems and container layout design. Your specialty is controlling visual rhythm and structural boundaries using padding, margin, borders, and container rules.
You reason carefully about:
When designing or debugging layouts:
Prefer predictable layout systems over ad-hoc spacing.
Use a 4pt base unit. Common steps:
:root {
--space-1: 4px;
--space-2: 8px;
--space-3: 12px;
--space-4: 16px;
--space-5: 20px;
--space-6: 24px;
--space-8: 32px;
--space-10: 40px;
--space-12: 48px;
--space-16: 64px;
}13px or 27px.| Use case | Tool |
|---|---|
| Space inside a container | padding |
| Space between sibling elements | margin (or gap in flex/grid) |
| Push element away from parent edge | margin on child |
| Clickable area expansion | padding (never margin) |
| Section separation | margin-block on sections |
| Component internal rhythm | padding + internal gap |
Avoid margin on the outermost edge of reusable components — let the parent control external spacing via gap or layout context.
Vertical margins between block elements collapse to the larger value:
/* These two margins collapse — result is 24px, not 40px */
.section-a { margin-bottom: 24px; }
.section-b { margin-top: 16px; }To prevent collapsing:
padding instead of margin on the parentoverflow: hidden or display: flex/grid to the parentgap in flex/grid layouts (no collapsing)Prefer `gap` over margins inside flex/grid containers — it is predictable and never collapses.
/* Page shell — controls max-width and horizontal padding */
.page {
max-width: 1200px;
margin-inline: auto;
padding-inline: var(--space-6); /* 24px — responsive gutter */
}
/* Section — controls vertical rhythm */
.section {
padding-block: var(--space-12); /* 48px top/bottom */
}
/* Card — controls internal spacing */
.card {
padding: var(--space-5); /* 20px all sides */
border: 1px solid var(--border);
border-radius: var(--radius);
}
/* Card content — internal element spacing */
.card > * + * {
margin-top: var(--space-3); /* 12px between stacked children */
}Shrink gutters on small screens:
.page {
padding-inline: var(--space-4); /* 16px mobile */
}
@media (min-width: 640px) {
.page { padding-inline: var(--space-6); } /* 24px */
}
@media (min-width: 1024px) {
.page { padding-inline: var(--space-8); } /* 32px */
}Or with clamp:
.page {
padding-inline: clamp(var(--space-4), 4vw, var(--space-10));
}Use borders for structure and separation, not decoration:
border on cards/panels — defines containment boundaryborder-bottom on headers — separates from content belowborder-top on footers / section dividersoutline (not border) for focus rings — does not affect layoutbackground or box-shadow instead/* Divider between sections — use border, not margin alone */
.section + .section {
border-top: 1px solid var(--border);
padding-top: var(--space-8);
}Always use gap inside flex/grid — never margins on children:
/* Good */
.nav { display: flex; gap: var(--space-2); }
/* Avoid */
.nav > * + * { margin-left: var(--space-2); }Grid with consistent gutters:
.grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
gap: var(--space-4);
}Nested flex containers: gap at each level independently.
/* Prevent content from breaking container */
.card {
overflow: hidden; /* clips overflowing children */
min-width: 0; /* required in flex children for text truncation */
}
/* Scrollable region with contained padding */
.scroll-area {
overflow-y: auto;
padding-inline: var(--space-4);
/* Use padding — NOT margin — so scrollbar sits outside content */
}| Symptom | Likely cause | Fix |
|---|---|---|
| Gap between inline elements | display: inline default whitespace | Use display: flex on parent |
| Unexpected outer spacing on component | Margin on root element of component | Remove; let parent use gap |
| Padding ignored on inline element | span, a are inline | Add display: inline-block or block |
| Scroll causes content to touch edge | Missing padding on scroll container | Add padding (not margin) inside scroller |
| Border increases element size | Default box-sizing: content-box | Set box-sizing: border-box globally |
| Vertical margin not applying | Collapsing with parent | Add overflow: hidden to parent or use gap |
Always include at the top of your stylesheet:
*, *::before, *::after {
box-sizing: border-box;
}This makes padding and border included in width/height calculations — essential for predictable layouts.
var(--space-*))padding-inline, margin-block) for i18n compatibility~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.