PrismJS / live

Prism Live: Lightweight, extensible editable code editors. A work in progress, try it out at your own risk (and report bugs!) :)
https://live.prismjs.com
MIT License
105 stars 28 forks source link

Add support for Prism.js toolbar plugin #14

Open tempris opened 3 years ago

tempris commented 3 years ago

I have found that simply adding the following will enable the toolbar plugin for Prism.js to work with Prism-Live.js:

/* Add support for prism toolbar. */

div.prism-live:hover .toolbar {
  opacity: 1;
}

div.prism-live .toolbar, 
.code-toolbar .toolbar /* Added because <pre> initiated variant has different structure than normal */
{
  z-index: 2;
}

I have added it as prism-live-toolbar.css to a branch on my own fork but is small so I am not sure if it justifies it being in its own file, unless it is better for people to be able to choose whether or not they want to include it into their own projects.

If you have time please let me know if this is acceptable for a merge request. Also should it be in a separate css file or in the main one?

Thanks for your time! #