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

WIP: Allow plugins to register themes #2647

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

WIP: Allow plugins to register themes #2647

wants to merge 4 commits into from

Conversation

joaquimrocha
Copy link
Collaborator

@joaquimrocha joaquimrocha commented Dec 7, 2024

This is a WIP PR for registering themes from plugins.
It's still very rough, but it's working...

Screenshot showing the theme changed

fixes #2150

How to test:

  1. Go to plugins/headlamp-plugin and run npm run build
  2. Then run npm pack
  3. Then go to the new plugins/examples/theme and install the headlamp-plugin we packed there: npm i ../../headlamp-plugin/kinvolk-headlamp-plugin...tar.gz
  4. Run the plugin with npm i ; npm run start
  5. Go to the Headlamp settings to see new themes

Progress:

  • Add proper typing for themes
  • Abstract themes into their own definition/module
  • Sanitize the themes to not have stuff like somethingBg but also something: { background: ... }
  • Replace the primaryColor usage by something more appropriate
  • Allow plugins to register themes
  • Allow to change the theme from settings
  • Create a proper theme button which previews the colors for the theme
  • Allow to associate a logo with the theme

Signed-off-by: Joaquim Rocha <joaquim.rocha@microsoft.com>
Signed-off-by: Joaquim Rocha <joaquim.rocha@microsoft.com>
Signed-off-by: Joaquim Rocha <joaquim.rocha@microsoft.com>
Signed-off-by: Joaquim Rocha <joaquim.rocha@microsoft.com>
@dosubot dosubot bot added the size:XXL This PR changes 1000+ lines, ignoring generated files. label Dec 7, 2024
@joaquimrocha joaquimrocha requested a review from sniok December 7, 2024 00:25
@joaquimrocha
Copy link
Collaborator Author

I am fine if the team continues this PR BTW.

@joaquimrocha
Copy link
Collaborator Author

FTR, @sniok had suggested we go with a thinner version of the theme that plugins may override for now. I agree with that and the Design team is working on getting us these higher level theme concepts for us to set up and share in our theme and for the plugins to override.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:XXL This PR changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Change Theme
1 participant