Skip to content

Templating based on block/element names? #50

@kizu

Description

@kizu

Is it possible to add a way to declare templates based on block/elements' names and modifiers?

Jade already have a way to call mixins using an interpolation:

+#{'b'}.block
  +#{'e'}.element

Would this be enough to allow defining custom templates, so things like this:

mixin bemto_block()
  +b.block-wrapper
    +b.block
      +b.element
        block

+b.block
  = "Whatever"

would be treated as:

+b.block-wrapper
  +b.block
    +b.element
      = "Whatever"

One of the problems is how to stop it being recursive, when the +b.block can be used inside bemto_block mixin?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions