FIND YOUR NEXT FEW LINES
The snippet library.
Small, practical examples. Search by task or narrow things down below.
5 snippets foundClear filters
Include padding in element width
Use border-box to keep CSS padding and borders inside the declared width.
CSS✓ Tested
Respect dark color preference
Apply different CSS colors when the browser requests a dark theme.
CSS✓ Tested
Respect reduced motion
Disable a CSS animation when the user prefers reduced motion.
CSS✓ Tested
Reuse colors with custom properties
Define a CSS custom property and use it for text color.
CSS✓ Tested
Show keyboard focus
Use a visible CSS outline when an input receives keyboard focus.
CSS✓ Tested