Check out Glinski's Hexagonal Chess, our featured variant for May, 2024.


[ Help | Earliest Comments | Latest Comments ]
[ List All Subjects of Discussion | Create New Subject of Discussion ]
[ List Earliest Comments Only For Pages | Games | Rated Pages | Rated Games | Subjects of Discussion ]

Single Comment

Home page of The Chess Variant Pages. Homepage of The Chess Variant Pages.[All Comments] [Add Comment or Rating]
🕸📝Fergus Duniho wrote on Wed, May 1 09:17 PM UTC:

The color scheme code I was working on yesterday and into today is now on the site. As I mentioned before, it will now change the theme with JavaScript as long as JavaScript is enabled. This is done mainly as a backup for older browsers that do not support :has() in CSS. It uses both JavaScript and CSS to change the color scheme so that if one method fails, the other one might still work. Generally, the CSS method will fail on older browsers, and the JavaScript method will fail if someone has JavaScript disabled.

One new feature is the Print color scheme. This is a more minimalist version of the Light color scheme. I may make a logo for it with some of Tenniel's black and white illustrations from Through the Looking-Glass, though I'm open to other ideas. For now, it uses the same logos as the Light color scheme.

Internally, I have moved the color scheme CSS to colors.css, where it is better organized and more maintainable than before. First, it creates individual custom properties for each color in each color scheme. The light ones begin with --light-, the dark ones with --dark-, etc. Since it has to define each color scheme multiple times for different selectors, it defines them in terms of the individual custom properties already created. So if I decide to change a color, there is now only one place it has to be changed.

Also, this provides page authors with the ability to customize color schemes for a particular page. By adding a style section in which you add custom properties to :root, you can rewrite individual values for particular color schemes.