Chess.com Piece Numbers

Adds piece number data to pieces in the chess board

Autor
theusaf
Installationen heute
0
Installationen gesamt
97
Bewertungen
0 0 0
Version
0.0.5
Erstellt am
28.10.2021
Letzte Aktualisierung
28.10.2021
Lizenz
MIT
Wird angewandt auf

Chess.com Chess Piece Numbers for Custom Styles

This user script automatically adds numbers to the pieces in chess.com boards, so you can customize your pieces.

Instructions/How to Use:

  1. Install this user script
  2. Install a user style extension like Stylus
  3. Create or install custom chess piece styles
  4. For examples/links to custom piece styles, see here
  5. For examples on how to create your own style, see here

Creating a Custom Style

Each piece on chess.com has a 2 character class with the team (w or b) and the piece type (p, n, r, b, q, k).

For example, a black knight piece has the class .bn

In addition, all pawns start at the number '3,' so pawns that are promoted can be given their own styles as well.

To style all pieces of a certain type and color, you can do:

chess-board .piece.wp {
  background-image: url(/* some url */) !important;
}

To style a specific piece, you can do:

chess-board .piece.bb[piece-number="1"] {
  background-image: url(/* another url */) !important;
}

Example User Styles

Known Issues

  • Pawn promotion can cause inconsistencies in styling