Where CSS tricks come from
Creating a CSS trick feels less like invention and more like discovery: features documented in separate corners of MDN quietly pair up in ways nobody has tried before.
Pairing features that shouldn't get along
One technique is to think recursively, borrowing the mindset used to build recursive logic. That work requires an escape hatch to avoid infinite recursion, and the same habit helps surface CSS combinations that seem contradictory but work well together:
- What if
view-timelinecould control the very thing that triggers it? That question produced a pairing ofview-timelinewithposition: fixed, the unlikely engine behind theweb-slinger.csslibrary for scroll-triggered animations in pure CSS. - What if one keyframe animation could trigger another? Keyframe animations, style queries and
animation-play-statetogether form a trio that can simulate collision detection in CSS. - What if
scroll-state:(scrollable: value)could govern which directions are scrollable? That led to a scrollytelling "Choose Your Own Adventure" that has yet to be published.
Negatives worth proving
Web design mixes art and science, and both disciplines question assumed cause and effect. Contrary to the folk saying, a negative can be proven, and often it is no harder than proving a positive. Many trick ideas therefore challenge the assumption that one thing is required to produce another:
- Maybe no JavaScript is needed for a Sudoku solver, a Tinder-style swiper or a classic scroll-driven animation demo.
- Maybe CSS games don't need checkbox hacks.
- Maybe effects comparable to those possible with the CSS
if()function can be recreated without hacking CSS at all. - Maybe web development wisdom can be shared without any CSS at all.
Pushing familiar features to the edge
Seth Godin's term "edgecraft" describes generating ideas by pushing a competitive advantage as far as the market dares. The CSS equivalent is taking a well-worn feature further than anyone has.
CSS-Tricks covered checkbox and radio button hacks back in 2011. In 2021, the experiment was to build a working Sudoku app from hundreds of radio button hacks with HTML generated by Pug. Feeding too much generated CSS to Chrome DevTools surfaced its infinite spinner of death, forcing a 4×4 board — but it also taught more about what CSS can and cannot do.
The :target selector dates back to the 2000s. In 2024 it was stretched by using HAML to render the thousands of possible Tic Tac Toe states, producing a game with a computer opponent in pure CSS. CodePen refused to output the requested amount of HTML at one point, but the result is a livelier introduction to an important feature than a table-of-contents demo.
An outsider's advantage
Chris Coyier has written about the gatekeeping behind the question of whether CSS is a programming language; treating it as not "real" programming can be used to justify lower pay and toxic dynamics. From the other direction, a full-stack engineer with a computer science degree can feel left out of front-end conversations, and putting "full stack developer" on a résumé sits badly when everything users see in a web app remains mysterious.
The difficulty of CSS may be more than psychological. fMRI research on design tasks indicates design cognition shows a unique cognitive profile compared with conventional problem-solving, and studies show the brain's structure changes as people improve at different kinds of work — structural plasticity reminiscent of how different muscles respond to different exercise. For a brain trained for decades on imperative logic, doing what CSS-savvy colleagues did felt like lifting a car overhead.
That changed with the checkbox hack, because hiding and showing divs based on checkboxes was routine in back-of-the-front-end work. Challenged by a designer workmate to build a game overnight with only CSS, the answer was a pure text adventure assembled from radio button hacks. Creative and curious people are more sensitive to novel stimuli, so the designers on the team were captivated by a primitive demo simply because it was something they had never seen. The engineering background became an asset: an outsider perspective. The rewiring tactic was to map unfamiliar CSS onto familiar problem-solving patterns:
- CSS custom properties resemble reactive variables in Vue.
- The
:targetselector resembles client-side routing in a single-page application. - The
min()andmax()functions can simulate some logical operations taken for granted in imperative programming.
Anyone still learning web development — which is everyone — should treat the thing that makes them feel like an outsider as the source of something unique in their CSS.
Purpose, and bringing others along
The first comment on the first hack published on CSS-Tricks was a defeatist "Why would you do that?", while the rest were supportive. Not everyone will like everything; that's been made peace with. But the question of a trick's relevance and purpose is fair. If a trick is discovered rather than made, it resembles finding a beautiful feather on a walk — picked up just because you can, with its significance decided together: perhaps it makes a fine quill, perhaps it proves a rare bird lives nearby.
Sharing the failures, compromises and limitations met while pushing CSS's boundaries is a journey-versus-destination matter. Showing the route to the curious find, not just the find, lets others retrace the steps and take a different fork — and maybe discover a trick of their own. The critical comment also helped channel inspiration: committing to CSS hacking that enables accessibility became a source of ideas, a reminder to empathize with screen reader users even in wacky experiments, embracing the limits not only of CSS but of the audience.
The lesson in short
Understanding what creators actually do — combining existing ideas, accepting constraints, removing the superfluous until a design reveals itself — is the foundation for cracking the combination that opens somewhere new. CSS constraints breed creativity, just as poetry's tighter rules force unexpected connections, and as Phil Hansen found after permanent nerve damage left his hand jittering: his early experiments with limitation included a work made from 80 cents' worth of supplies. It dovetails with the Antoine de Saint-Exupéry line often cited in web design — perfection is achieved not when there is nothing more to add, but when there is nothing left to take away.



