grapesjs-component-code-editor icon indicating copy to clipboard operation
grapesjs-component-code-editor copied to clipboard

Editor CSS

Open vizardkill opened this issue 3 years ago • 11 comments

First of all bro, I love each of your projects as always I continue to learn a lot from you.

I wanted to ask you if it is possible in the future to implement a block to inject our own CSS styles as a CSS editor?

vizardkill avatar Apr 22 '22 02:04 vizardkill

I think this plugin already covers such a use case: https://github.com/artf/grapesjs-custom-code

Ju99ernaut avatar Apr 22 '22 04:04 Ju99ernaut

yes, it is similar to the code editor, suppose we wanted the entire canvas to be able to load a style sheet without having to add a block, a component would be interesting where you can manage what was html, style sheet and javascript independently of blocks and that could be injected throughout the site

vizardkill avatar Apr 22 '22 18:04 vizardkill

I doubt something like that would be a good fit for this plugin, it's quite difficult to manage styles outside of the style manager, as you'd end up with a lot of duplicate styles. But you could just modify the custom code plugin to do that.

Ju99ernaut avatar Apr 22 '22 20:04 Ju99ernaut

If it is a topic of conversation for another project outside of this one.

Another question bro, does the plugin inject tailwind or does it have to add the library through the cdn script?

We could file the issue as a discussion.

vizardkill avatar Apr 22 '22 20:04 vizardkill

Yeah, my thoughts are this would need to be a new plugin for managing global css and js or part of the code-editor plugin.

It's added through the cdn script.

Ju99ernaut avatar Apr 23 '22 05:04 Ju99ernaut

bro another question regarding this plugin, is it possible to activate codeMirror autocomplete?

vizardkill avatar Apr 25 '22 22:04 vizardkill

I'm not sure, haven't experimented with adding plugins, you could try something with codeViewOptions

Ju99ernaut avatar Apr 26 '22 06:04 Ju99ernaut

Do you have any example of viewOptions?

vizardkill avatar Apr 26 '22 18:04 vizardkill

These options are basically merged with the defaults https://github.com/Ju99ernaut/grapesjs-component-code-editor/blob/14844edeaf1fd76972e552547d8ceff6549198b1/src/code-editor/index.js#L33-L43

Also noticed that grapesjs exposes Codemirror so you could also try that

Ju99ernaut avatar Apr 26 '22 21:04 Ju99ernaut

my brother, thank you very much for answering all my questions, I admire how humble you are to share your knowledge, I think it is something that makes you unique and that makes all your projects so great, thank you very much for your help.

Thanks to you I have been able to learn a lot about Grapes js I will be telling you how the project I am working on is going

image

vizardkill avatar Apr 27 '22 03:04 vizardkill

Awesome, look forward to following your progress!

Ju99ernaut avatar Apr 27 '22 19:04 Ju99ernaut