Giter VIP home page Giter VIP logo

Comments (9)

gkopylov avatar gkopylov commented on August 11, 2024

@bartosz-zawada "html :AttributeMerger" was added earlier and this was made for support this feature https://github.com/judofyr/temple/blob/master/lib/temple/html/attribute_merger.rb

For your case I think it would be better and cleaner to write this:

- class_name = 'ruby'
div class = "hello #{ class_name }" Hello Ruby!

So that case class is defined only in one place.

Btw, I think it would be better to create github organization("skim" for example) though because otherwise there will many forks and nobody will support this in actual state.

from skim.

amenzhinsky avatar amenzhinsky commented on August 11, 2024

I'm getting the same error using code like this:

button.btn class=('active' if @active)

I suppose it's not a new feature 😄

from skim.

gkopylov avatar gkopylov commented on August 11, 2024

@amenzhinsky why not just to use this code:

button class = "btn #{ 'active' if @active }"

from skim.

gkopylov avatar gkopylov commented on August 11, 2024

Using class name after dot and with class directive simultaneously is confusing. I think it would be better to use it either with dot or with class directive only.

from skim.

amenzhinsky avatar amenzhinsky commented on August 11, 2024

@gkopylov I do understand in some cases it's confusing, but in examples like I posted above it would be nice to have. Maybe you're right 👍

from skim.

alubbe avatar alubbe commented on August 11, 2024

It's unfortunate because

.staticClass class=@dynamicClassName

is valid slim. Why deviate?

from skim.

hgani avatar hgani commented on August 11, 2024

I agree with @alubbe

We should maintain compatibility with slim because the main reason people use this gem is that they want to use slim for JS templating.

from skim.

pavelkomiagin avatar pavelkomiagin commented on August 11, 2024

I agree with @bartosz-zawada that we shouldn't use "html :AttributeMerger". Could you make a pull request with it?

from skim.

ryanwood avatar ryanwood commented on August 11, 2024

Any progress on merging @pavelkomiagin's PR?

from skim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.