TopGit
GitHub Repo Review

CSS Protips: a curated collection of CSS tips and tricks

AllThingsSmitty/css-protips
CTopGit review image for AllThingsSmitty/css-protips
Review by Topgit.dev for AllThingsSmitty/css-protips, with GitHub repository stats and README context.
Quick verdict

CSS Protips is a single-file collection of 29 CSS tricks, from inheriting box-sizing to the newer margin-inline property, each with a code snippet and usually a CodePen demo. It's worth bookmarking as a scannable reference for a specific problem, not a tutorial to read start to finish. It's a cheat sheet, not a course. Most tips still hold up in modern CSS, though a couple carry accessibility caveats the README itself flags.

Stars
★ 30.3k
Forks
⑂ 2.2k
Language
—
License
CC0-1.0
Topic
Frontend
Updated
Sep 2026
Homepage
—
GitHub

What CSS Protips Is

CSS Protips is a curated, single-page list of 29 CSS techniques from the AllThingsSmitty GitHub repository, covering box-model resets, selector tricks like :is() and :not(), and layout fixes such as vertical centering and aspect-ratio. Each tip is a short writeup with a code block and, for most entries, a linked CodePen demo. It's licensed CC0-1.0, so every snippet is public domain.

The 29 CSS Techniques

  • ✓Box-model fundamentals: a compact CSS reset, inheriting box-sizing from html instead of resetting it everywhere, and the all: unset shorthand instead of resetting properties one by one.
  • ✓Selector tricks: :not() to drop the last border in a nav list, negative nth-child to grab the first n items, and :is() to collapse a long list of heading selectors into one rule.
  • ✓Layout tips covering flexbox and CSS Grid centering, aspect-ratio for images, margin-inline/margin-block, and table-layout: fixed for equal-width table cells.
  • ✓Type and form tips: :root-based fluid font sizing with calc(vw + vh), rem for global sizing paired with em for local sizing, and a 16px minimum on inputs to stop iOS Safari from zooming in on focus.
  • ✓Small UX and accessibility fixes — visible :focus outlines on form elements, hiding unmuted autoplay video, styling broken images with a fallback message, and disabling pointer-events on a disabled button.
  • ✓A handful of one-off selector tricks: the 'lobotomized owl' (* + *) for consistent vertical rhythm, :empty to hide elements with no content, and a CSS-only slider built from max-height and overflow.
How this repository's GitHub stars have grown over time. Source: star-history.com.View the star history ↗

When to Use These Tips

  • •Pulling up a quick fix when a nav border, a centered modal, or a broken-image placeholder needs a CSS-only answer instead of writing custom code from scratch.
  • •Code review or mentoring — pointing a junior dev at the :not() or :is() tip instead of re-explaining specificity from scratch.
  • •Auditing an existing stylesheet for margin-hack workarounds (nth-child chains for gutters) that flexbox's justify-content: space-between replaces outright.
  • •Learning a handful of newer CSS properties — aspect-ratio, margin-inline, :is() — that predate most bootcamp curricula but show up in modern codebases.

Strengths

  • ✓Every tip ships a working code block, and most link to a live CodePen demo you can fork and poke at immediately.
  • ✓Short, single-purpose entries — read one in under a minute instead of scrolling a 2,000-word blog post to find the CSS.
  • ✓Licensed CC0-1.0, so you can lift any snippet into a commercial project with zero attribution paperwork.
  • ✓Covers current-ish CSS (aspect-ratio, :is(), margin-inline) alongside older workarounds, so it's not stuck in a 2015 time capsule.
  • ✓The numbered table of contents links straight to each tip, so it works as a real reference, not just a wall of text.

What CSS Protips Doesn't Cover

  • △Two tips (comma-separated lists via ::after, and empty-link attribute selectors) come with the README's own warning that they can break screen readers and copy/paste — you have to read the caveat, not just copy the snippet.
  • △Non-English versions often fall out of sync: according to the README, adding a tip requires updating more than a dozen-plus translation files, and warns that the non-English READMEs may not contain every tip listed in the primary version.
  • △It's one long scrollable page with no search, filter, or tagging by CSS feature — finding a specific tip means Ctrl+F or scanning the numbered contents list.
  • △No dates or CSS-baseline notes attached to individual tips, so nothing tells you whether a given trick is still current best practice or has since been superseded.

Other CSS Learning Resources

30-seconds-of-code — a broader curated snippet library covering JS and CSS alike, in the same short-entry, code-first format, if you want tips outside CSS too. ↗CSS-Tricks (css-tricks.com) — the site CSS Protips itself links out to for several tips' deeper explainers, a natural next stop when you need more depth on one technique.MDN Web Docs' CSS reference — for the full spec-level detail behind a property like aspect-ratio or :is() that CSS Protips only summarizes in a few lines.

Frequently Asked Questions

How many CSS tips are in the CSS Protips collection?

CSS Protips lists 29 numbered CSS tips and tricks in its README, covering everything from a basic CSS reset and box-sizing inheritance to newer additions like aspect-ratio and margin-inline, with a short code snippet attached to each one.

Is CSS Protips still updated for modern CSS?

CSS Protips does include newer CSS features like aspect-ratio, :is(), and margin-inline alongside older tricks, so it isn't frozen in an early-2010s snapshot, though individual tips aren't dated so you can't tell how recently each one was added.

What level of CSS knowledge do I need to use CSS Protips?

CSS Protips assumes you already know CSS fundamentals — selectors, the box model, flexbox basics — since each tip is a short shortcut or refinement, not an explanation of the underlying concept from scratch.

Can I contribute a new tip to CSS Protips?

CSS Protips accepts contributions through the CONTRIBUTING.md guidelines linked in its README; the maintainer notes that adding a new tip means updating it across all the translated versions too, which is why translations can lag.

What CSS pseudo-classes and selectors are featured in the tips?

CSS Protips features :not(), :is(), :root, :empty, :focus, and nth-child among the pseudo-classes it covers, plus attribute selectors on empty links and the universal-plus-adjacent-sibling '* + *' combinator used in the 'lobotomized owl' layout trick.

Is CSS Protips free to use in commercial projects?

CSS Protips is licensed CC0-1.0, which places it in the public domain, so every code snippet in the collection is free to copy into a commercial project without attribution or a licensing fee.

Who should try it — and who should skip

Front-end developers who already know CSS basics and want a fast reference for specific problems — centering a div, killing a margin hack, styling a broken image — get the most out of CSS Protips. Beginners still learning selectors or the box model should start with a structured course instead, since the tips assume you already know what box-sizing and flexbox are and just want the shorthand. Anyone maintaining a design system should also cross-check the two accessibility-flagged tips before shipping them.

Related repositories

Source & attribution

Based on the AllThingsSmitty/css-protips GitHub repository, its README, and its CC0-1.0 license file.

GitHub data · last synced Aug 15, 2026Reviewed by Henry
← Back to TopGit

Want a second opinion on css-protips?

Ask an AI that can read this page — one click and you get its take on css-protips.

GitHub