web-mode icon indicating copy to clipboard operation
web-mode copied to clipboard

[Twig] Support CraftCMS css and js blocks

Open oles opened this issue 2 years ago • 0 comments

I'm doing some silly stuff with CraftCMS, and seemingly my best option now is some template generated inline css.

CraftCMS provides some custom Twig functionality, and two of them are tags for css and js;

  • https://craftcms.com/docs/3.x/dev/tags.html#css
  • https://craftcms.com/docs/3.x/dev/tags.html#js

Example:

{% css %}
    .content {
        color: {{ entry.textColor }};
    }
{% endcss %}

I did not expect web-mode to handle these, but I did some searches to see if there was something I could do.

And I found a similar issue: https://github.com/fxbois/web-mode/issues/805#issuecomment-276258707

If this quite niche thing is within scope as well, I'll try to get a PR rolling!

oles avatar Sep 03 '21 15:09 oles