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

Consistent naming conventions for theme-color unmapping #39152

Closed
2 tasks done
roblevintennis opened this issue Sep 6, 2023 · 1 comment
Closed
2 tasks done

Consistent naming conventions for theme-color unmapping #39152

roblevintennis opened this issue Sep 6, 2023 · 1 comment
Labels

Comments

@roblevintennis
Copy link

Prerequisites

Proposal

This should have no functional consequences but would perhaps improve the quality and readability.

It appears there are two approaches and I think the later below is clearer:

@each $color, $value in $theme-colors {
  .btn-#{$color} {
  ....

vs

@each $state in map-keys($theme-colors) {
  .list-group-item-#{$state} {
...

Put differently, I feel $state better expresses that these are in fact color mode states e.g. "dark" state or "light" state or "my-custom-mode" state; NOT a color per se.

I know this is a nitpick but definitely felt my cognitive effort wasted attempting to figure this out the first perusal of the code. Happy to help if folks agree here. Feel free to close if it's a stupid idea ;)

Motivation and context

  • Less wasted cognitive effort to read the code
  • Easier onboarding understanding for folks new to the codebase
@roblevintennis
Copy link
Author

Realizing I actually misread the code and so this was just a "user error". Closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant