WordPress / better-code-editing

[✅ Merged into 4.9-alpha] Better Code Editing WordPress plugin
https://wordpress.org/plugins/better-code-editing/
37 stars 16 forks source link

Are color schemes modifiable? #27

Closed joyously closed 7 years ago

joyously commented 7 years ago

When I first went to the theme editor, I checked a small PHP file and saw that if I messed up an angle bracket for a HTML tag, it would show something in red.

Then I switched to look at the CodeMirror plugin file in the plugin editor, and saw lots of red. It looks like all strings are shown in red. But really it's not the same red. I just thought it was all red. Perhaps there shouldn't be several shades of either red or green used? I'm not color blind and it confused me. A lot of people are and they wouldn't be able to see the difference. I tried deleting key characters one at a time to see an error, but did not get one. (tried removing paren, quote, semicolon) When I removed one quote, it turned that section black, when I expected it to have the text between the remaining quotes the quote color. This is good in a way (the rest of the file is unaffected), but not quite right for the part it turned black.

westonruter commented 7 years ago

There are multiple themes included in CodeMirror, and #24 actually is to discuss which ones we should include in core. I think @melchoyce has some thoughts on improving the style as well.

melchoyce commented 7 years ago

Thanks for the feedback, it'll help as I look through the color schemes CodeMirror provides to find a default to include in core.

If you find any other weird style things, continue to post them in here — I am going to look at restyling minor parts to make them both more WordPress-y and more usable.

joyously commented 7 years ago

OK, but part of my question alluded to being able to change the color scheme with a plugin. I wondered if it is just a matter of loading a different file (like styles), or if it's more complicated. (just to make sure it's filterable)

melchoyce commented 7 years ago

Yeah, I think we should be able to swap out color schemes. I'd like to see us either make, or encourage someone else to make ( 😆 ), a plugin to do so.

westonruter commented 7 years ago

Yes, loading a different style is just a matter of enqueueing another stylesheet that supplies a theme. I've added a wp_enqueue_code_editor action in #68 for this purpose.