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

feat: simplify theme config #3363

Merged
merged 2 commits into from
Nov 9, 2023
Merged

feat: simplify theme config #3363

merged 2 commits into from
Nov 9, 2023

Conversation

anxolin
Copy link
Contributor

@anxolin anxolin commented Nov 8, 2023

Summary

This PR is just a proposal. I like it more, but I want to get the temperature of the squad.

I feel that in order to control the theme, is easier if we just have a single theme parameter.

In this PR I propose to:

  • 🔪 kill palette parameter
  • 🤩 Enhance theme to allow more control

Basically you would use it like this:

// Dark theme
{ theme: 'dark' }

// Light theme
{ theme: 'light' }

// Full control, based on a theme, you override some colors
{
theme: {
        baseTheme: 'light',
        primaryColor: '#d9258e',
        screenBackground: '#ee00cd',
        widgetBackground: '#b900ff',
        textColor: '#b348cc',
   }
}

Test

it should work as before, its just, we don't have 2 properties. Just one theme
image

You can uncomment this to see the new colors: https://github.com/cowprotocol/cowswap/blob/simplify-theme/apps/widget-configurator/src/app/configurator/hooks/useWidgetParamsAndSettings.ts#L45

Copy link

vercel bot commented Nov 8, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
cosmos ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 8, 2023 6:46pm
swap-dev ✅ Ready (Inspect) Visit Preview Nov 8, 2023 6:46pm
widget-configurator ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 8, 2023 6:46pm

Copy link
Collaborator

@shoom3301 shoom3301 left a comment

Choose a reason for hiding this comment

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

That is really simple and laconic!

@anxolin anxolin merged commit 6b262ab into release/1.49.0 Nov 9, 2023
4 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Nov 9, 2023
@alfetopito alfetopito deleted the simplify-theme branch November 9, 2023 10:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants