Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix board CSS class manipulation #504

Merged
merged 1 commit into from
Feb 15, 2024

Conversation

joanlopez
Copy link
Contributor

Similar to #476, but more generically, it fixes the board CSS class manipulation for the following (on top of piece style):

  • theme
  • layout
  • mode

If I'm not wrong, all of them are now using divBoard.classList.add, which makes it end up in a situation where more than one exclusive value is present (more details in the aforementioned pull request), breaking the application.

You'll see I did the trick with a some TypeScript generics, in order to re-use code, but I'd be happy to simplify if by copy-pasting one function for each type. Similar for the enums, and for the heuristics. I'll be happy to apply any code suggestion you have that achieves the same behavior, but that's the best I could do so far.

I hope it helps! At least, it would really unblock the use I'm planning to for this amazing library! 💟

Thanks!

@mliebelt
Copy link
Owner

Thank you for fixing that, it will go into the next minor version then. Don't know when that will be done ...

@mliebelt mliebelt merged commit 26955ed into mliebelt:main Feb 15, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants