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

Autoload custom palettes #18102

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

cconard96
Copy link
Contributor

Checklist before requesting a review

  • I have read the CONTRIBUTING document.
  • I have performed a self-review of my code.

Description

Automatically load custom palettes the same way core palettes are so they can be easily swapped based on root element attributes.

Example custom palette SCSS (mycustomtheme.scss):

:root[data-glpi-theme="mycustomtheme"] {
    --tblr-primary-rgb: 142, 197, 71;
    --tblr-secondary: #768363;
    --tblr-secondary-fg: #fcfcfc;
    --tblr-link-color-rgb: 69, 148, 54;
    --glpi-mainmenu-bg: #459436;
    --glpi-mainmenu-fg: #f4f6fa;
}

Copy link
Member

@cedric-anne cedric-anne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a good solution if we consider that people will only use CSS vars for their custom themes, but if their custom themes contains CSS styles (e.g. body{ color:#a2a2a2; }), then they will be applied to everyone, even for users that selected another theme in their preferences.

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

Successfully merging this pull request may close these issues.

3 participants