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

Use light/dark class instead of colors #4

Open
ppo opened this issue Jan 7, 2021 · 0 comments
Open

Use light/dark class instead of colors #4

ppo opened this issue Jan 7, 2021 · 0 comments

Comments

@ppo
Copy link

ppo commented Jan 7, 2021

Add options custom(Light|Dark)Class to add a CSS class instead of defining color styles on the element.

let contrast = new Contrast({
  customLightClass: 'contrast-el-light',
  customDarkClass: 'contrast-el-dark',
  // …
});

So in your example:

<h1 class="color-block contrast-el">Resize and watch my color change</h1>

On dark backgrounds, the element would become:

<h1 class="color-block contrast-el contrast-el-light">Resize and watch my color change</h1>
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

No branches or pull requests

1 participant