code-blocks icon indicating copy to clipboard operation
code-blocks copied to clipboard

Allow custom styles

Open cliffckerr opened this issue 3 years ago • 2 comments

Firstly: wonderful package, I use it daily!

I was wondering if it would be possible to add "Upload style" or "Edit style" features. The highlightjs source style files are pretty simple and I think a fair proportion of users would be able to make use of this functionality (I certainly would!). I'm not a JavaScript expert but it looks like it wouldn't be too hard to append additional styles to the array, and I believe any uploaded/edited styles could be made to persist via the userProps variable. While the sky's the limit in terms of providing a nice CSS editor and validation, I don't think either of those things would be necessary in the first instance: just the ability to upload a CSS file, with a simple try-catch preventing the new style from being loaded if the user munged it up and it can't be parsed, is probably enough to still be useful.

It'd be stretching the limits of my JavaScript/apps script fluency to try to make a PR for this myself, but otherwise I would!

cliffckerr avatar Apr 04 '21 20:04 cliffckerr

Or at least being able to have a custom theme so we can change certain things such as the background or the base text color would be nice...

YawLighthouse avatar Jan 02 '22 01:01 YawLighthouse

that would be nice. I like the VS code dark hi-contrast so much it has like 5 colors. but mine is not even formatting correctly it just cant makeup its mind on what things to color or what not to color.

shavatek avatar Sep 19 '22 17:09 shavatek