Active-CSS / active-css-code-editor-component

An embeddable Active CSS code editor component for playing with Active CSS, HTML and CSS.
MIT License
2 stars 0 forks source link

Add in the ability to edit code from template tags instead of external files #4

Closed bob2517 closed 3 years ago

bob2517 commented 3 years ago

This is already done offline and is part of the 2.5.1 release. It is needed in order to get the code editor working inside a local offline SPA, where XHR requests are forbidden per the CORS policies. It's used for the upcoming docs SPA download for 2.5.1.

bob2517 commented 3 years ago

The new alternative syntax is this:

<acss-editor
    acss-template-selector="#acss-active-css-wack-a-mole"
    html-template-selector="#html-active-css-wack-a-mole"
    css-template-selector="#css-active-css-wack-a-mole"
    core="activecss/activecss-2-5-1.min.js"
    editor-css="css/activecss-editor.css">
</acss-editor>

Having general selectors as above allows for the most flexibility.

CSS inside a template must be surrounded by tags. ACSS inside a template must be surrounded by tags.