Open-source project
AllThingsSmitty/css-protips avatar
AllThingsSmitty/css-protips

css-protips: A Curated CSS Tips List and What It Does Not Give You

A collection of tips to help take your CSS skills pro. 🕹

30,275 stars2,203 forksUnknownCC0-1.0

At a glance

What is it?
AllThingsSmitty/css-protips is a CC0-licensed collection of 29 short CSS tips, each with a code block and often a CodePen demo. It is a reference to read, not a package to install, and its value depends on whether you want snippets or a maintained reset file.
Who is it for?
Adopt css-protips as a reading list if you write CSS by hand and want short, checkable snippets for things like :not() navigation borders, local() font fallbacks, or margin-inline. Do not adopt it if you need an installable dependency, a build-time lint rule, or a versioned reset you can bump.
Can I use it commercially?
Yes. CC0-1.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 22 days ago.
What is it written in?
GitHub does not report a main language for this repository.

Answers come from the project's GitHub data, last synced on September 15, 2026, and from our analysis. They are not legal advice.

DEEP OPEN-SOURCE ANALYSIS

What css-protips Is, and What It Is Not

The README calls it "a collection of tips to help take your CSS skills pro," and the table of contents lists 29 numbered entries. Each entry is a short heading, a fenced CSS block, and in most cases a link to a CodePen demo hosted on the author's account. There is no build step, no package manifest shown in the supplied material, and no releases. The repository is a document with a CONTRIBUTING.md and a Translations section.

That framing matters for adoption. You do not add css-protips to a project the way you add a reset stylesheet or a PostCSS plugin. You read a tip, decide whether it fits your codebase, and paste the rule. The primary language field is listed as unknown, which is consistent with a repository whose main artifact is Markdown. If you arrived looking for an npm install line, the material does not provide one.

The audience is narrow and specific: people writing CSS directly, who already know the box model and specificity, and who want a short reminder of an idiom they may have forgotten. It is not a teaching course. Several tips assume you know why the rule works, and the explanation is often a single sentence.

The Reset Tip and the box-sizing Inheritance Split

The first two entries are related and the README acknowledges the overlap. The reset tip proposes a universal selector block that sets box-sizing, margin, and padding on every element and both pseudo-elements. The second tip instead sets box-sizing: border-box on html and then box-sizing: inherit on the universal selector, so components can opt into a different model. A note under the first tip says that if you follow the second tip you might leave box-sizing out of the reset.

This is the most consequential pair in the list, because it is the part you would apply across an entire codebase rather than in one component. The inheritance approach is the one that composes with third-party widgets: a plugin that needs content-box can set it on its own root and its descendants follow. The flat reset cannot do that without an override.

The trade-off the README does not spell out is that the universal selector block touches every element on the page. For small documents that is irrelevant. For very large DOM trees it is a rule the browser evaluates broadly, and it is the kind of thing worth measuring in your own page rather than assuming. The README offers no performance claim either way, and none should be inferred from it.

Modern Selectors: :not(), :is(), and the Lobotomized Owl

Several tips exist to replace two-rule patterns with one. The navigation border example is the clearest: instead of putting a right border on every list item and removing it from the last child, you write .nav li:not(:last-child) and apply the border once. The README's justification is readability, noting the selector "is read as a human would describe it." That is a fair summary, and it also removes one declaration that can be forgotten when the markup changes.

The :is() tip addresses specificity directly. Where :not() takes a simple selector in older syntax, :is() accepts a selector list, and the README positions it as a way to control specificity better. If you have ever fought a rule that would not override, this is the entry to read first.

The lobotomized owl selector, * + *, applies a top margin to every element that follows a sibling. It is a spacing strategy rather than a one-off fix, and it interacts badly with elements whose spacing comes from elsewhere. The README presents it without caveats. Treat it as a pattern to test against your actual markup, not a default.

Layout Tips: Centering, aspect-ratio, and Logical Properties

The centering entry gives two complete answers. The flexbox version sets height: 100% on html and body, then uses align-items and justify-content on body. The grid version sets display: grid, height: 100vh, and place-items: center. Both are self-contained, which is the useful part: you can paste either into a demo and see it work.

The aspect-ratio tip replaces the older padding-top percentage trick with the aspect-ratio property. The README lists intrinsic ratio boxes as a separate tip, so the two entries cover the old and new approaches to the same problem. If you maintain code that predates aspect-ratio, the older entry is the one you will find in your files.

Two entries deal with writing direction. The margin-inline tip replaces margin with margin-inline for horizontal spacing, which flips correctly under a right-to-left document. The rem/em tip sets global sizing in rem and component-local sizing in em, so a component scales with its own font-size rather than the root. Both are small changes with wide blast radius. Applying margin-inline across an existing stylesheet is a mechanical edit, but it changes behaviour in any context where writing-mode or direction is set, so it is not a find-and-replace you should run without review.

Accessibility and Media Tips That Are Easy to Get Wrong

The :focus entry is the one with the strongest stated rationale. The README explains that "sighted keyboard users rely on focus to determine where keyboard events go in the page," then gives a rule that removes the box-shadow, sets a dotted outline, and adds outline-offset. The intent is a focus indicator that is more consistent than the browser default.

The risk here is the outline: none pattern that appears elsewhere in the list. The unset tip resets a button with all: unset, which strips the default focus ring along with everything else. If you apply that tip to interactive elements without adding the :focus rule from the other entry, you have removed a keyboard affordance. The README presents these as independent tips and does not cross-reference them. That is a real gap in a list that otherwise reads carefully.

The autoplay video tip hides videos that are not muted, using the :not() selector against the muted attribute. It is a reasonable default for a page that embeds third-party video. It is not a substitute for controlling autoplay at the player level, since the rule only affects display.

Fonts, Type Scale, and the :root Variable Tip

The local font check uses the local() function inside @font-face, listing the full name and the Postscript name before the url() fallback. The README credits Adam Argyle for the tip and links his demo. The mechanism is straightforward: if the font is already on the machine, the browser skips the network request. The README frames this as "a good performance tip, too," which is the extent of the claim.

Two entries concern type defaults. Adding line-height to body lets text elements inherit a single value instead of repeating it per tag. Setting font-size on form elements addresses the mobile behaviour where a small input font triggers zoom on focus. Both are one-line changes with visible effects, which is the shape most of this list takes.

The :root tip covers flexible type through custom properties. The README does not include the full code block in the portion available here, so the exact pattern is not confirmed by the material. What is confirmed is the placement: :root as the declaration site for values that other rules consume. That is standard practice now, and the entry reads as a reminder rather than a discovery.

How You Actually Use It, and What It Costs to Maintain

There is no install command in the supplied material. The workflow the repository implies is: open the README, find the tip by its anchor in the contents list, copy the CSS block, and check the linked CodePen. The contents list is a set of in-page links, and each entry ends with a back-to-top link, so navigation is entirely within the document.

Maintenance cost sits with you, not the project. Because there is no package, there is nothing to upgrade and no version to pin. That cuts both ways: you will never get a breaking change, and you will also never get a fix pushed to your codebase. The last push recorded is 2026-08-24, so the list is being touched, but with no releases retrieved there is no changelog to read to find out what changed. If you copy a snippet, you own it.

The licence is CC0-1.0, which the repository states. CC0 is a public domain dedication rather than a permissive software licence, and it is unusual for a code collection. It removes attribution requirements for the snippets, but it also means there is no warranty language of the kind you get with MIT. This is a description of the licence text, not legal advice; if your organisation has rules about which licences are approved for copied code, CC0 is the identifier to check against that list.

Where It Fits Against a Reset Library Like normalize.css

The obvious comparison is normalize.css, which is a stylesheet you install and import. It targets cross-browser rendering differences in HTML elements and ships as a versioned artifact you can update. css-protips does the opposite: it hands you a set of decisions and expects you to make them. The reset tip in this repository is a four-property universal block, not a survey of browser quirks.

That difference decides the use case. If your problem is that a form control renders differently across engines and you want that handled for you, a reset library is the right tool and css-protips is not. If your problem is that you keep rewriting the same last-child border rule or forgetting to set line-height on body, this list is faster than searching.

The two are not exclusive. You can import a reset library and still take the :is() and margin-inline tips from here. What you should not do is treat the four-line universal reset as a replacement for a maintained normalization stylesheet, because it addresses a different problem: it clears defaults rather than reconciling them.

Editorial conclusion

Adopt css-protips as a reading list if you write CSS by hand and want short, checkable snippets for things like :not() navigation borders, local() font fallbacks, or margin-inline. Do not adopt it if you need an installable dependency, a build-time lint rule, or a versioned reset you can bump. Before copying anything, open the CodePen demo linked under that tip and confirm the behaviour in the browsers you actually support, because the repository ships no test suite and no release tags.

Official sources

  1. AllThingsSmitty/css-protips on GitHub
  2. Issues
  3. License: CC0-1.0
  4. README
Community notes

Community notes