Custom Properties That Earn Their Keep
We deleted half our custom properties and the site got easier to change.
The ones we kept
If you build something with this, send it to us. We collect good examples and share the best ones in our reading lists.
- The shadow offset
- The border width
- The three accent colours
We tried this on a client site first, because a real deadline is the only honest test. It held up better than we expected, and the handover notes were half as long as usual.
A variable used once is just a longer way to write a value.
The trick is to decide once and write it down. Most messy stylesheets are not badly written; they are a record of the same decision being made twenty different ways.
Nothing here needs a framework. A few lines of plain CSS and a template that prints clean markup will get you most of the way.
We checked every page at 390 pixels wide before calling it done. Phones are where layouts break first, and where most of our readers are.
It is tempting to add one more variation. Resist it. Every option you add is one more thing to test, document and eventually delete.
Our rule of thumb: if we cannot explain a choice in one sentence to a client, we probably should not ship it.
8 thoughts on “Custom Properties That Earn Their Keep”
Finally someone says it plainly. Thank you.
It holds up, as long as the gap stays consistent.
Seconded. More posts like this.
Saving this for the next time someone asks for rounded corners.
Ha, we had the exact same argument.
How long did the whole redesign take you?
Saving this for the next time someone asks for rounded corners.
We shipped something similar last month. Can confirm it holds up.