slime-lang / phoenix_slime

Phoenix Template Engine for Slime
MIT License
310 stars 65 forks source link

Support Embedded Engines with HTML Tags #88

Open johns10 opened 3 years ago

johns10 commented 3 years ago

I attempted to create a scoped style tag using the css: prefix. Based on what I've read about slim, it should support css class="myClass", but when I attempt to use it like this:

css class="test":
    p { background-color: blue; }

it renders like this:

 <css class="test">:
p { background-color: blue; }
</css>
Rakoth commented 3 years ago

Hello @johns10! Attributes on css: is not supported right now.

You can do it with inline html like this:

<style class="test" type="text/css">
  p { background-color: blue; }
</style>
johns10 commented 3 years ago

I thought I tried this, but I'll give it another go.

johns10 commented 3 years ago

When I use this method, I get:

** (Slime.TemplateSyntaxError) Unexpected indent
INPUT, Line 2, Column 0
  p { background-color: blue; }

I tried it like this:

<style class="test" type="text/css">
  p { background-color: blue; }
</style>

And like this:

style class="test" type="text/css"
  p { background-color: blue; }

I get the same error either way.