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 CSS vars to homogenize UI style #466

Draft
wants to merge 16 commits into
base: master
Choose a base branch
from
Draft

Conversation

le-jeu
Copy link
Contributor

@le-jeu le-jeu commented Mar 16, 2021

Thanks to CSS, we can use variables to:

  • avoid repetition of a color with the same semantic in IITC style
  • expose colors for plugins to use instead of copy/paste
  • make style (color) customization simpler (from plugins or in order to make a darktheme)

a purple lover could use

:root {
  --ui-background-color: purple;
  --highlight-text-color: yellow;
}

image

while a dark mode could looks like

@media (prefers-color-scheme: dark) {
 :root {
  --ui-background-color: #000e;
  --highlight-text-color: #ccc;
  --ui-border-color: #000;
  --ui-background-color-no-alpha: #000;
  --ui-title-background-color: #0008;
  --highlight-border-color: #fff;
  --arrow-toggle-color: #fff; 
 }
}

image

@johnd0e johnd0e added development general development issue enhancement New feature or request labels Mar 17, 2021
@johnd0e
Copy link
Contributor

johnd0e commented Mar 17, 2021

https://caniuse.com/css-variables

Android 4.4 (KitKat) WebView does not support it.
As well as PhanthomJS (not sure that we still care though).

In general: I'd prefer to refactor whole css from scratch first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core development general development issue enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants