Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Ramus Lite in pure CSS

A topic by No Time To Play created Jun 29, 2022 Views: 85
Viewing posts 1 to 1
Developer

How did I not know about this?! Turns out there's a CSS pseudo-class called :target, that always matches at most one element: whatever document fragment is currently pointed at in the URL. Which means you can have links pointing at parts of the page <a href="#there">like so</a>, and only have the element with id="there" be visible, while all its siblings are not, with only a two-line stylesheet:

	main article { Display: none; }
 	main article:target { Display: block; }

What can you do with it? Why, stateless CYOA, of course! In other words, Ramus lite. Which is exactly what I'm calling it for now.

Stay tuned for details; meanwhile, many thanks to Snail Legs for enlightening me.