flekschas / svelte-simple-modal

A simple, small, and content-agnostic modal for Svelte v3 and v4
https://svelte.dev/repl/b95ce66b0ef34064a34afc5c0249f313
MIT License
422 stars 30 forks source link

Feature: Adds ID property #96

Closed ajmeese7 closed 1 year ago

ajmeese7 commented 1 year ago

Background

I use svelte-simple-modal with SvelteKit. In #92 the suggested implementation of my need to fade between content in the modal required a way to reference the Modal elsewhere in my codebase.

Currently Observed Behavior

There is no easy, clean way to reference a specific modal as it stands currently.

New Behavior

This PR introduces a way to set the modal ID, allowing for easy reference in any external CSS/JavaScript.

Demo: https://svelte.dev/repl/ab14f5620f10465b83150c132e361c57?version=3.55.1

ajmeese7 commented 1 year ago

Unfortunately GitHub doesn't allow me to have the maintainer checkbox since the PR was made from an organizational fork, I'll go back and revert the changes the autolinter made real quick.

flekschas commented 1 year ago

No worries. I'll merge this in and then fix it on master

flekschas commented 1 year ago

New version (v1.5.0) is pushed. Should be available in a few minutes.