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

re-write with color-mix #2

Open
loreanvictor opened this issue Feb 4, 2024 · 0 comments
Open

re-write with color-mix #2

loreanvictor opened this issue Feb 4, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@loreanvictor
Copy link
Owner

current implementation uses filters and brightness to create subtly different colors. for example, buttons have subtly brighter borders compared to their own color, and this is, atm, implemented with pseudo elements that have a brightness filter on them (source):

&::before {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  right: 0;
  content: '';
  border: 1px solid var(--primary-color);
  border-radius: calc(min(var(--roundness), var(--button-height) / 2));
  filter: brightness(var(--primary-button-border-brightness));
  transition: background 0.1s, filter 0.15s;
}

most of these can be implemented with color-mix(). it has reached enough usage coverage that can be relied on for a relatively new project like nokss. this change would:

  • reduce bundle size (potentially drastically),
  • simplify the code
  • increase performance (browsers sometimes have a hard time animating all the filters),
  • increase predictability (e.g. --brightness variables make more sense)

this will of course affect the whole code base.

@loreanvictor loreanvictor added the enhancement New feature or request label Feb 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant