Micromodal icon indicating copy to clipboard operation
Micromodal copied to clipboard

Allow adding multiple space-separated classes for `openClass`

Open liamtarpey opened this issue 5 years ago • 0 comments

Thanks for this library - great solution for us and really lightweight!

Small suggestion here - to allow passing multiple classes to openClass config option.

This would be useful to pass modifier classes such as modal--s for small modal content for eg:

{
  openClass: 'modal--open modal--s'
}

Solution splits this space-separated string into a comma-separated array that we spread into add() and remove().

A long term solution might be to have something like openClasses as the param and the ability to pass an array of classes here rather than a string.

Thanks!

PS. Untested in the lib as I'm still setting it up and might break your Cypress tests for now. Will update if you're interested in this suggestion and when I've set up the project 👍

liamtarpey avatar Oct 21 '20 12:10 liamtarpey