Ostrowski Maciej
A blog of the software engineering part of life
{
iconIndex += 1;
if (iconIndex > 3) {
iconIndex = 1;
}
switch (iconIndex) {
case 1:
if (window.matchMedia ( '(prefers-color-scheme: dark)' ).matches) {
document.documentElement.classList.remove ( 'light' );
document.documentElement.classList.add ( 'dark' );
} else {
document.documentElement.classList.remove ( 'dark', 'light' );
}
localStorage.removeItem('colorMode');
break;
case 2:
document.documentElement.classList.remove ( 'dark' );
document.documentElement.classList.add ( 'light' );
localStorage.colorMode = 'light';
break;
case 3:
document.documentElement.classList.remove ( 'light' );
document.documentElement.classList.add ( 'dark' );
localStorage.colorMode = 'dark';
break;
}
}"
title="Color mode switcher"
>
Here you have a list of all articles available on the blog. Both those written by me and those I linked from other authors.
Anyone who has launched even a single project-website has had to ask themselves this question at least a
thousand times. In this article, I present the last few days right before launching this blog. I wonder how
many of you have experienced something similar.
Full article
© 2025 Ostrowski Maciej.
You are allowed to use the mentioned code or train your "almighty" AI with the content.