pugtemplate-enginepugjs

How to use the dot short form for class when class name has hyphens?


The following:

span.M

generates nicely into:

<span class='M'>

However,

span.glyphicon glyphicon-book

does not work.

Is that a way to save typing and shifting for class names similar to the latter?


Solution

  • The pug engine does render code blocks of the type:

    span.glyphicon-glyphicon-book
    

    However, I think when you say not working, you mean that the glyphicon is not being replace. For that, you need to have two different classes like so:

    span.glyphicon.glyphicon-book