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

How to implement global style overriding or globally apply custom styles #462

Open
chenqianhe opened this issue Sep 20, 2023 · 3 comments
Open
Labels
bug Something isn't working

Comments

@chenqianhe
Copy link

What package has an issue

@svelteuidev/core

A clear and concise description of what the bug is

I hope to modify the primary in color through certain configurations, so that all places based on primary can automatically become the color I set. For example, after I change primary to red, buttons everywhere change to red.

I hope to make global modifications, rather than changing in every place where it is used.

I have tried Custom theme but it didn't work.

In which browser(s) did the problem occur?

Chrome, Other - list in description

Steps To Reproduce

+layout.svelte

const newTheme = createTheme("new-theme", {
	colors: {
		primary: "red",
	},
});
<SvelteUIProvider class={newTheme}>
	<NavBar {data} />
	<slot />
	<footer class="bg-white"></footer>
</SvelteUIProvider>

Do you know how to fix the issue

Yes

Are you willing to participate in fixing this issue and create a pull request with the fix

Yes

Relevant Assets

No response

@chenqianhe chenqianhe added the bug Something isn't working label Sep 20, 2023
@plrenaudin
Copy link

This would be indeed very helpful to be able to override the primary color once and have an easy way to customize the default color palette. But it looks like the blue is hardcoded in a few places (for the buttons at least)

@charlie-roosen
Copy link

I'm also completely lost on how to redefine the Svelte color scheme. I've looked over and over at the Svelte UI documentation and stitches.js documentation. I've tried using globalCss().

I'm not sure this is a bug, or just a documentation issue. If it's just a documentation issue, it would be great to have some documentation with a specific example of how to change the primary color globally.

Thanks

@BeeMargarida
Copy link
Member

Hey, right now we don't have a workaround besides setting the color prop in each component. We are moving away from our current styling solution, so this will definitely be changed in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants