I came up with a clean JavaScript solution for this
You can use bootstrap data attributes for buttons and make sure your buttons and modals have their own unique identifiers.
Before using this JavaScript, you must use Material Design Lite JS
Check the code. Any feedback is welcome. :)
<button class="mdl-button mdl-js-button" id="show-dialog" data-toggle="modal" data-target="#upload-pic"> Show Modal </button> <dialog id="upload-pic" class="mdl-dialog mdl-typography--text-center"> <span class="close">×</span> <h4 class="mdl-dialog__title">Hello World</h4> <div class="mdl-dialog__content"> <p>This is some content</p> </div> </dialog>
source share