Skip to content

[feat] customizable theme #481

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

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

Conversation

zaaakher
Copy link
Contributor

Closes #190

The user can customize the theme however they like in the settings. And when they click save changes it will save a theme.css file in the repo which will persist anytime they connect that same repo.

just a crazy sample
image

- Introduced CustomThemeVariable interface for managing theme variables.
- Added customThemeVariablesAtom for state management of custom theme variables.
- Updated ThemeSection to include ThemeCustomizer for enhanced theme customization options.
- Replaced useAtom with useSetAtom for managing theme state.
- Integrated functionality to generate and save theme.css with updated color values.
- Added useLoadTheme hook in RouteComponent to load custom themes on app initialization.
@zaaakher zaaakher requested a review from colebemis as a code owner April 10, 2025 06:38
Copy link

netlify bot commented Apr 10, 2025

👷 Deploy request for lumen-notes pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 2f94f63

Copy link

netlify bot commented Apr 10, 2025

Deploy Preview for lumen-storybook ready!

Name Link
🔨 Latest commit 2f94f63
🔍 Latest deploy log https://app.netlify.com/sites/lumen-storybook/deploys/67f8864799243b0008566b5b
😎 Deploy Preview https://deploy-preview-481--lumen-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Member

@colebemis colebemis left a comment

Choose a reason for hiding this comment

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

Thanks for your work on this, but I'm hesitant to support theming like this for a couple reasons:

  1. It exposes the underlying theming API which will make it more difficult to add/remove/rename variables in the future.

  2. With this approach, it will be difficult for users to make a theme that looks nice and easy for them to make themes that look bad. I'd rather having a theming system that makes it easy to make good looking themes and hard to make bad looking themes. Does that make sense?

    In practice, that might look like allowing users to choose a primary and secondary accent color and generating a theme based on those values.

@zaaakher
Copy link
Contributor Author

Thanks for your work on this, but I'm hesitant to support theming like this for a couple reasons:

  1. It exposes the underlying theming API which will make it more difficult to add/remove/rename variables in the future.
  2. With this approach, it will be difficult for users to make a theme that looks nice and easy for them to make themes that look bad. I'd rather having a theming system that makes it easy to make good looking themes and hard to make bad looking themes. Does that make sense?
    In practice, that might look like allowing users to choose a primary and secondary accent color and generating a theme based on those values.

Gotcha! like a middle ground between Apple's closeness and Android openness (in terms of UX/DX). I agree, opening up all the vars could lead to crazy designs that could degrade the design ethos of Lumen.

I'll play around to find the 1 or 2 vars that can be used as accent/primary.

On a different note, I'm excited about the possibilities of having lumen files in the repo to persist things. Like the theme.css and there could perhaps be a lumen.config.js/lumen.json that contains certain metadata and configuration (potentially in the future)

@colebemis
Copy link
Member

colebemis commented Apr 11, 2025

On a different note, I'm excited about the possibilities of having lumen files in the repo to persist things. Like the theme.css and there could perhaps be a lumen.config.js/lumen.json that contains certain metadata and configuration (potentially in the future)

Totally. I think we can use use a .lumen directory to persist lumen-specific config.

@colebemis
Copy link
Member

colebemis commented Apr 11, 2025

Lumen uses Radix Colors so we could allow people to choose their base+accent color scales.

As an example, here I've swapped the base "sand" color scale for "cyan":

image

@zaaakher
Copy link
Contributor Author

Oh yes that's definitly the best approach!

Screenity.video.-.Apr.11.2025.mp4

I'm getting the colors from radix-colors.css, I'll just make sure everything is fine and I'll push

@zaaakher
Copy link
Contributor Author

✅ use radix colors
✅ save the theme.css in .lumen folder

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.

Themes!
2 participants