Hi,
Love the library - thanks!
One of my use-cases is to create a css-editor for inline styling alone (no selectors).
Of cource, the css-tokenizer requires a selector to be able to correctly parse the css. I could work around this by prepopulate the editor with an empty selector ({}
)
<textarea>{
}</textarea>
This is clearly a rather ugly “hack”, and the user could easily remove the braces and disable the parsing.
I can see a couple of solutions:
- Hook into CodeMirror and preprocess the text before it is parsed
- Create a new
inline-css
-mode and take advantage of the exisingcss
-mode - Create a new
inline-css
.mode using code from the existingcss
-mode - Something obvious that I have missed
Option 1 seems like the easiest to implement but requires that there is some extension points.
What would you recommend?