Sassy dark mode

Backward compatible dark mode

The easiest way to implement dark mode these days is with CSS3 custom properties (variables). Just have a :root element with default colors, and then another one under a media query, and let the user preference do the work. Something like this:

:root {
    --bkg:          white;
    --txt:          black;
}

@media ( prefers-color-scheme: dark ) {
    :root {
        --bkg:      black;
        --txt:      white;
    }
}

body {
    background:     var(--bkg);
    color:          var(--txt);
}

And if the browser doesn’t understand or have the preference, it would take the first set of variables. But if it doesn’t understand variables at all, that’s a problem.

I really hope there is a better solution, because mine feels very silly, but it works. Sass variables. Bare minumum primer: Sass is a preprocessor, it creates a regular CSS file and all the magic happens before that. Also, there’s a pain point if you’re adapting an existing stylesheet: it’s better if the color information has its own section. Lucky for me, I have been doing this since time immemorial.

Ok, to get to the point, we need 6 files. Did I mention it’s silly? style.scss is our main file, which would be our actual style.css at the end. _colors.scss is our color information where we will write it with our variables. Two files for the light and dark variables themselves and two to make a magic trick work.

So, the magic trick is this: we import two files into our main file, and both of those files import a set of variables and our colors file:

_vars_light.scss + _colors.scss → _magic_light.scss

_vars_dark.scss + _colors.scss → _magic_dark.scss

_magic_light.scss + _magic_dark.scss → style.scss

So style.scss would have this:

@import "magic_light";
@media ( prefers-color-scheme: dark ) {
    @import "magic_dark";
}

_magic_light.scss would have this:

@import "vars_light";
@import "colors";

_vars_light.scss would have this:

$bkg:               white;
$txt:               black;

And _colors.scss would have this:

body {
    background:     $bkg;
    color:          $txt;
}

_magic_dark.scss and _vars_dark.scss would “mirror” _magic_light.scss and _vars_light.scss.

BTW, there may be different requirements for how Sass files are handled, I just go by what Hugo does with them and what works for me.

In the end, we have a rather large style.css file with a default light style and a dark style under a media query. Kind of like what we did with CSS3 variables, but that works without them. Silly!


A bit more about Sass.

Summary for February 2025

Spooky, scary skeletons

I fineshed the Dark Souls trilogy, all four of them.

Anor Londo, large Gothic castle of light stone, with planety of towers, arches and bridges. It is backlit by a bright low sun at dusk or dawn, but with dark and ominous clouds above.
[Praise the Sun \o/]

For me, as for most people, I bet, it started with the first Dark Souls. But I was also scared by basically everyone not to go online, for fear that cheaters would destroy my equipment or even corrupt my save. Playing on a PC, where saves (allegedly) could corrupt themselves, didn’t help either. So even though I was hooked, I never made it past the famous pair of bosses. But I did everything else and really enjoyed my time.

When the second one was released, I decided to participate in the jolly co-operation, and with the help of strangers on some particularly annoying bosses, I finish it. The third was even smoother in that regard, and I even played a bit on a certain gaming publication’s stream (streamer was my buddy). I finished Demon’s Souls just last year.

Since I’m playing horror games for a foreseeable future, I used that as an excuse to go back and finish the first one. Dark Souls: Remastered, to be precise.

Calling it a remaster is a bit of a stretch, to be honest. On PC, it’s a much smoother experience than the Prepare to Die Edition was, but you’re not getting anything beyond that.

I don’t think I have anything special to add to what I said about Demon’s Souls. I still think that the discussion about the whole soulslike subgenre is full of misunderstandings, to say the least. I still think there is a lot to like about them besides the combat. I still like them, a lot.

You really made it when a game mechanic from your genre is an entire game. Save Room is that. There’s not much to add, but anyone who’s played a survival horror game – or any game with inventory Tetris, really – would know what’s going on.

Small figure of an olive-skinned woman with dark hair in a ponytail standing in a forest. She is wearing gray jumpsuit bottoms, a dark tanktop, a harness, and a backpack with a blocky looking weapon attached to it. Forest, lit by a dim, cold light, full of twisted trees and less earth-like stuff on a perimeter. In the middle of it is a square stone column with the central part chiselled out in a shape that makes it look somewhat organic.

Scars Above was a pleasant surprise, I never heard any kind of buzz about it. Which might mean that I like it a bit more because there were no expectations. But it is good! It takes the structure of a soulslike and mixes it with arcade shooter mechanics where enemies have weak points and different elements (water, fire, etc.) play a role. It’s relatively short and straightforward, so not too much complexity, but what’s there is pretty good. It is a bit on the “budget indie title” side, especially the dead eyes of the characters are jarring, but overall not bad looking. A decent sci-fi story and characters also help.


I also played some other games and watched some movies, but I hope to finish the series they belong to and write about them as a whole.

Summary for January 2025

Grim grinning ghosts come out to socialize

A woman with long dark hair, wearing a white shirt, sweater vest and khakis, stands with her back to the camera in a dilapidated school hall. There is a flashlight on the ground shining on a humanoid figure in the distance. The overall style is inspired by PlaysStation One, with low-poly models, simple textures and a lot of noise.

Fear the Spotlight is great. It’s a pretty focused, mostly puzzle game with some stealth elements. An interesting take on a particular story that doesn’t do anything drastic, but isn’t afraid to play with tropes and themes.

Not much to say about the next three games. Not bad, above average for sure. I really liked the British post-apocalyptic atmosphere of Hollowbody. Go Home Annie is not only interested in spooky stuff, but in the SCP Foundation itself, much like Remedy’s Control, and that’s fun. I don’t think The Chant is particularly good at criticizing what it wants to criticize, but overall just a solid game.

A platinum blonde woman in a hot pink coat stands near two escalators in a subway station. The whole world is divided: in a circle around the woman, there’s dirty tile floor, some scattered around luggage. Outside the circle, it is rusted metal floor and walls, and large, plant-like torns. The graphics are also very PlayStation-esque.

Sorry We’re Closed does a lot. From its take on survival horror combat (action games where you have to feel powerless), to great visuals, to… dating sim, eh, flavor?.. The story goes places, too. Very good.

Ok, calling PixelJunk Shooter Ultimate a horror game is a stretch, but there are two stages that are clearly horror themed. So, there. It is a twin-stick shooter with an emphasis on physics based puzzles. What happens when you drop water on magma? What if you drop a block on an enemy? Stuff like that. Can be quite challenging, especially bosses, but still very enjoyable.

A small spaceship hovers over the cloudy surface of a planet. There are red lights shining through the clouds, a sun rising above the horizon, and Saturn-like rings hangs around the planet.

On the one hand, Alien: Romulus justifies itself by introducing very interesting character dynamics, and that’s the highest praise a movie in a long-running franchise, where it is a sequel, after prequel, after reboot, can ever get. On the other hand, does it? Why is the neurodivergent character an android? Why is there a CGI You-Know-Who? Do you have to throw direct quotes?

I honestly don’t know if I like the movie or not. It is very beautiful, in that “corporate future is terrible” kind of way. Good acting, minus the aforementioned You-Know-Who. But yeah, maybe the Alien series has said everything there is to say at this point.

Summary for December 2024

Picturesque

Sophie is sitting on some stones on a grassy hill. We only see her back, wearing a cloak and a straw hat. She is looking into the distance where there is a river with trees covering the bank, green fields and rolling hills separated by rows of trees. Far away, closer to snow-covered mountains under a blue sky with some fluffy clouds, is a city – only small dots of buildings.

I didn’t like Howl’s Moving Castle that much. While Kiki is more or less the same, Nausicaä is a clear expansion, the story of the book and the movie are very different, in a way that reading the book first made watching the movie very confusing for me. What they have in common is that I don’t think they sold the romance that well, if at all. The characters were… eh. I wasn’t on board with the themes.

There is a valid criticism of Miyazaki’s handling of war that I won’t go into here, and Howl’s is a great example for that discussion.

Ponyo on the other hand is simply adorable. In a way, it is a return to My Neighbor Totoro, in a slightly bigger way. And that’s alone is enough for me.

Humanoid hands holding a sword, the hilt of the witch is a large circle, inside it is another smaller circle with a plate that looks like Pac-Man: “pie” with a triangle piece missing.
[The dark and gritty Pac-Man reboot.]

I don’t think I had a choice not to see Secret Level. So I did. The best episodes are the ones where the story has to deal with a game mechanic, so it is very disappointing that most of them chose the same one: respawn. The others just chose to tell the story in a world of a game, and for 10 minute episodes, sometimes even less, they were fine stories. Ultimately, not a disappointment, not by a long shot, but overall just not a memorable anthology.

Summary for November 2024

Resistance is not futile

Star Trek, the MCU before the MCU. Superheroes. Characters jumping between shows. A bunch of actor appearances where you go “that one too?”. Endgame.

Closeups of the crew, from left: Seven of Nine, white Borg/human blonde woman with a metallic implant above her eye; Tuvac, dark-haired dark-skinned Vilkan; Kes, white blonde Ocampa woman; Kathryn Janeway, brown-haired white woman; Neelix, Talaxian man with a mixture of cat-like and lizard-like features: leathery skin, spots around his face, fur-like hair and sideburns; Harry Kim, dark-haired Asian man; Chakotay, dark-haired indigenous man from Central America.
[Part of the Voyager crew.]

My ovearll view on all the old Star Trek shows – at this point I’ve watched The Original Series with movies, The Animated Series, The Next Generation with movies, Deep Space Nine and now finished Voyager, – is that they are important as a cultural step, but also still mostly relevant.

Which is kind of sad, when you think about it: surely we should have fixed a lot of the problems those shows explored by now, right? Nope, some of them are just coming up now, sometimes in eerily familiar ways.

Also, all of these shows, and Voyager is no exception, have an annoying tendency to take two steps forward and one step back. Which, admittedly, still makes them progressive, and, as I mentioned, to this day – there are shows that came after that were worse.

I’m not sure what is worth mentioning about Voyager specifically. It did some cool things: the first woman captain, another interesting take on the human condition via holograms and the Borg, etc. But I can’t really say something like “if you want to explore this particular take on a theme by a Star Trek show and you can only watch one, watch Voyager”. It’s not that unique in my mind. As good all the others.

Small Parisian square with a fountain, surrounded by two and three story buildings. There is a pure black sky with the Eiffel Tower in the background. It is a first-person view with a hand of the protagonist holding a gun, a compass and a health circle in the upper left corner and an ammunition counter in the upper right corner.
[The first level, set in Paris.]

Sometimes you just want to shoot some Nazis. It’s hard to mistake Medal of Honor: Underground for a modern game, mainly because of the visuals, but it is interesting how it is pretty much a modern military shooter in every other way. From the controls (twin-stick and even aiming down sights, kinda), to the cut-scenes, from the mission objectives, to the variety of those missions (they even had a turret section). And while there are rough edges, it still pretty enjoyable experience!