Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editor CSS #39

Open
vizardkill opened this issue Apr 22, 2022 · 11 comments
Open

Editor CSS #39

vizardkill opened this issue Apr 22, 2022 · 11 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@vizardkill
Copy link

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?

@Ju99ernaut
Copy link
Owner

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

@vizardkill
Copy link
Author

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

@Ju99ernaut
Copy link
Owner

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.

@vizardkill
Copy link
Author

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.

@Ju99ernaut
Copy link
Owner

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 Ju99ernaut transferred this issue from Ju99ernaut/grapesjs-tailwind Apr 23, 2022
@Ju99ernaut Ju99ernaut added the enhancement New feature or request label Apr 23, 2022
@vizardkill
Copy link
Author

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

@Ju99ernaut
Copy link
Owner

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

@vizardkill
Copy link
Author

Do you have any example of viewOptions?

@Ju99ernaut
Copy link
Owner

These options are basically merged with the defaults

return editor.CodeManager.createViewer({
codeName: type === 'html' ? 'htmlmixed' : 'css',
theme: 'hopscotch',
readOnly: 0,
autoBeautify: 1,
autoCloseTags: 1,
autoCloseBrackets: 1,
styleActiveLine: 1,
smartIndent: 1,
...opts.codeViewOptions
});

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

@vizardkill
Copy link
Author

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

@Ju99ernaut
Copy link
Owner

Awesome, look forward to following your progress!

@Ju99ernaut Ju99ernaut added the help wanted Extra attention is needed label May 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants