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

Better Approach to Global Theming #1488

Open
JosipDomazetHKS opened this issue Nov 18, 2024 · 3 comments
Open

Better Approach to Global Theming #1488

JosipDomazetHKS opened this issue Nov 18, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@JosipDomazetHKS
Copy link

JosipDomazetHKS commented Nov 18, 2024

Is there a way to globally set the text color of all buttons in Flowbite Svelte using themes? Currently, the only method I’m aware of is this approach, which involves creating custom components. However, this requires manually creating custom buttons, tables, headers, etc., to apply global changes to specific components. This approach feels like reinventing the framework, which seems inefficient for simple global customizations.

@JosipDomazetHKS JosipDomazetHKS added the enhancement New feature or request label Nov 18, 2024
@shinokada
Copy link
Collaborator

You can change the primary color in tailwindcss config file, https://github.com/themesberg/flowbite-svelte/blob/main/tailwind.config.ts.

@JosipDomazetHKS
Copy link
Author

@shinokada Thanks for the quick reply. The primary color only affects certain buttons tho and let's say my primary color is some blue and I want a generic button with black text as a default for many actions. I do not think that creating a new component for that is a solution that scales well. Imo there would need to be a extended theme for svelte components themselves just like there is a theme for tailwind.

@shinokada
Copy link
Collaborator

If you are using you can try https://svelte-5-ui-lib.codewithshin.com/.

  1. It has more colors.
  2. You need to deepmerge theme. For example, https://github.com/shinokada/svelte-5-ui-lib/blob/main/src/lib/buttons/theme.ts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants