dtn9197 / herocard

this repository uses web components to make a herocard
MIT License
0 stars 0 forks source link

rename css variables #11

Closed btopro closed 4 years ago

btopro commented 4 years ago

We like to use a convention of --hero-card-description-background-color : var(--simple-colors-default-theme-accent-12, #000000); and then leverage hero-card-description-background-color in the right spot. If it was a generic like "accent we use internal to the element" sort of scope, then we'd do something like:

--hero-card-primary : var(--simple-colors-default-theme-accent-12, #000000);
--hero-card-secondary : var(--simple-colors-default-theme-accent-1, #FFFFFF);

The reason we do it this way:

  1. semantic naming of variables
  2. the default-theme-accent style naming of simple colors allows for using the accent-color and dark property successfully
  3. makes it more readable downstream
  4. leveraging the default-theme-accent methodology allows us to be able to gaurentee a certain design / color pallet while maintaining accessibility (color contrast ratio)

https://github.com/dtn9197/herocard/blob/6672dc674a57a37de3c8076e355fe3ed443f2540/src/HeroCard.js#L29