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

How should the rendering of the code work? #62

Closed
brianlee389 opened this issue Jun 11, 2015 · 3 comments
Closed

How should the rendering of the code work? #62

brianlee389 opened this issue Jun 11, 2015 · 3 comments
Assignees

Comments

@brianlee389
Copy link
Collaborator

I made the code change the preview part of the block, but then using the left side of the block will not work correctly if the css is changed. I'm not sure how this is supposed to work.

@brianlee389 brianlee389 self-assigned this Jun 11, 2015
@thomaspark
Copy link
Owner

That would be the expected behavior. If there's custom css code overriding the widgets, the widgets no longer take effect. But deleting the custom css code should make them active again.

@brianlee389
Copy link
Collaborator Author

Okay. For this would it make sense to have separate event handlers for each of the code sections because if the javascript is edited would that mean the admin block wouldn't work as well. Also I have created the read only sections of the code and html should be ignored, correct?

@thomaspark
Copy link
Owner

That's right, HTML should be ignored. Same with the read-only sections of CSS and JS.

Adding custom CSS or JS shouldn't affect the admin block directly. Instead, custom CSS should be appended to the block's style scoped element (creating the style scoped if it doesn't exist yet). So the custom CSS works in addition to the widget styles, and can override them as well. Similarly, the custom JS would be appended to the script tag (again creating it if it doesn't exist).

I don't know if it makes sense to have different event handlers, but it would to get the CSS part working first. There will be some tricky aspects of previewing custom JS that we may or may not want to take on (i.e., infinite loops, resetting to original state, etc.) CSS will be simpler.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants