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

Issue: Pico.CSS styling leaked into Toast Styling #82

Open
ZombieChibiXD opened this issue Jun 21, 2023 · 2 comments
Open

Issue: Pico.CSS styling leaked into Toast Styling #82

ZombieChibiXD opened this issue Jun 21, 2023 · 2 comments

Comments

@ZombieChibiXD
Copy link

Hi, I wanted to use this toast package, but because I'm using PicoCSS, there's issue where the main styling leaked into this package.

Is there a way to make sure this toast's styling is scoped to itself?

@ZombieChibiXD
Copy link
Author

ZombieChibiXD commented Jun 21, 2023

So far my workaround is by making a component and styling it manually.

<script>
	import { SvelteToast } from '@zerodevx/svelte-toast';
</script>

<div class="toast">
	<SvelteToast
		options={{
			classes: ['something']
		}}
	/>
</div>

<style>
	:global(ul._toastContainer>li) {
		list-style: none;
	}
	:global(._toastBtn) {
		--background-color: none;
		--border-color: none;
		--color: none;
		--box-shadow: none;
        --primary-hover: none;
		padding: var(--form-element-spacing-vertical) var(--form-element-spacing-horizontal);
		border: none;
		border-radius: 0;
		outline: 0;
	}
	:global(._toastBar) {
        border-radius: 0;
        margin-bottom: auto;
	}
</style>

@zerodevx
Copy link
Owner

Hey, unfortunately I don't think there's a straightforward solution (unless the toast component is set up as a custom element - which it's not right now). The drawback of using a CSS framework like PicoCSS is it's a bit like a sledgehammer.

Your workaround is probably fine.

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

No branches or pull requests

2 participants