Comments (2)
I forgot to provide a quick demo of how I am quickly handling this right now for a prototype I am trying to whip out.
Right after I programmatically call the notifier, I select the container element and add a class name to the element. Obviously, this repositions the container for all active toasts, which is not ideal.
// positioning override
.toast-top-left {
left: 0;
}
.toast-bottom-left {
bottom: 0;
left: 0;
}
// and so on...
notifier.success('Notifications work!', 5000)
const el = document.querySelector('.toasts')
// replace existing overrides
el.className = el.className.replace(/ toast-bottom-right/g, '')
el.className = el.className.replace(/ toast-bottom-left/g, '')
el.className = el.className.replace(/ toast-top-left/g, '')
// add new class override
el.className += ' toast-bottom-left'
from svelte-notifications.
Hi @joelhickok - I've not really had need for re-positioning, so I've not done any work to this effect. Also most of the CSS was rewritten by a contributor, so I'm not 100% sure how it works - but it looks like you've figured some of it out!
Happy to accept a PR on this if you get a chance!
from svelte-notifications.
Related Issues (20)
- Browser compatibility? HOT 4
- Tweaked animations? HOT 8
- Could not find a declaration file for module '@beyonk/svelte-notifications'.
- Option to close manually. HOT 1
- sveltekit support HOT 2
- Does it support typescript? HOT 3
- Demo is broken
- Toast does not work HOT 3
- Timeout parameter for notifications shouldn't be required HOT 2
- SSR | Unknown file extension ".svelte" HOT 4
- Option to disable persisting on page reload HOT 1
- Allow custom component HOT 1
- Wrong number of arguments (4 for 3) for `rgb' HOT 3
- Toast displays 2 times | SvelteKit HOT 2
- new version tag
- Provide a demo HOT 1
- vite-plug-in warning: resolve config in packaage json can causa problems HOT 1
- Variable width HOT 2
- Is there a way to disable time progress bar? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from svelte-notifications.