Code Monkey home page Code Monkey logo

Comments (2)

joelhickok avatar joelhickok commented on June 3, 2024

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.

antony avatar antony commented on June 3, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.