Explain CSS code
Paste CSS and Vibe explains which rule wins, why the layout lands where it does and where each value comes from.
Up to 1,500 characters (about 60 lines). Your code is sent to Unvibe and Google Gemini to write the explanation. Don't paste keys or passwords. Common key formats are refused.
Vibe24 lines selected
Press Explain it for the sample, or paste your own code first.
What this CSS sample shows
- grid
repeat(auto-fill, minmax(220px, 1fr))makes as many columns at least 220px wide as fit, then shares out the leftover space. A 960px container gets 4 columns of 228px, and one narrower than 456px gets a single column, with no media query.- flexbox
- Each
.cardis a flex column, andmargin-top: autoon its.buybutton takes all the free space above it. The grid stretches the cards in a row to one height, so the buttons in that row line up along the bottom, however long the text above them. - custom properties
.card.salesets--accent, and the button inside inherits it, so a sale card's button is red. Other cards don't set--accent, sovar(--accent, #2563eb)falls back to blue.- the cascade
- Inside a card,
.card .buybeats the.buyrule even though.buycomes later, because two classes are more specific than one. Source order only decides between equally specific selectors: a later.card .buy { background: gray; }would win.
Good to know
- A
.buybutton outside any card matches only the last rule, so it is gray and has no auto margin. gap: 16pxadds space between the cards only, never around the outside of the grid.- With
auto-fitin place ofauto-fill, empty columns collapse: two cards in a 960px container stretch to 472px each, whereauto-fillkeeps them at 228px. - Items in a flex column stretch across by default, so each
.buybutton fills its card's width. Addalign-self: startto the button to keep it its natural size. margin-top: autopushes only because.cardis a flex container. Make.carda plain block and it computes to 0, and the buttons no longer line up.
Watch out: The fallback in var(--accent, #2563eb) is used only when --accent isn't set at all. A card that sets --accent: 12px gets a button with no background: not red, not blue and not the gray from .buy, because the browser can't tell the value is wrong until it uses it.
Explain CSS code beside your editor
Unvibe is a free app for Mac and Windows. In the app there is no pasting: select code in any app and press Control+U (Ctrl+Alt+U on Windows).