Skip to content

Improve theming  #1382

@pociej

Description

@pociej

What problem does this new feature solve?

Currently theming provides really limited palette of options.
Most important points

  • Color mix. If you want color to match main colour in your webpage then you have to something close to 100% which make UI completly unsuable. With '--w3m-colo-mix' : 100 no text is visible.
  • '--w3m-accent' documentation is unclear here 'color used for buttons, icons, labels, etc.'From this description it is not possible to predict what exactly will be touched. For testing purpose I used following config
createWeb3Modal({
  wagmiConfig,
  projectId,
  chains,
  themeMode: 'light',
  themeVariables: {
    '--w3m-accent': 'red',
  },
})

Here are screen shots
Screenshot 2023-10-09 at 09 31 49
Screenshot 2023-10-09 at 09 31 30
Only red I see is in network switch view, really inconsistent way.

Describe the solution you'd like

I see two possible approaches here.

  1. Follow something like presentational/container pattern. From the library level provide components responsible for logic and give user api to register presentational components. This is advanced and hard to use, so for sure shouldnt be default behaviour. However its best option for advanced users.

  2. Extend list of properties like '--w3m-background-color', '--w3m-button-color', '--w3m-font-size' etc. This could exists in parallel with 1.

Would you be open to accept PR?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions