F
F
fantazerno2016-08-09 13:01:19
HTML
fantazerno, 2016-08-09 13:01:19

How to implement such an approach in EMMET + JADE?

Good afternoon!
Tell me if there is such an implementation possibility in EMMET + JADE (those who use BEM will understand me)
Standard option:
block > block__header > block__content > block__footer
I would like:
block > #__header > #__content > #__footer
But everything would unfold according to the standard JADE scheme

block
  block__header
    block__content
      block__footer

Sublime Text 3 Editor

Answer the question

In order to leave comments, you need to log in

2 answer(s)
B
bagahunda, 2016-08-09
@fantazerno

Emmet has built-in filters that appear at the end of a line after |.
It's strange, but many do not know about them.
In your case, you need to use two filters at once: bem and jade.
This will unfold into familiar JADE

article.post
              .post__header
              .post__content
              .post__footer

You can configure the output of filters here:
Preferences -> Package settings -> Emmet -> Settings - User

Here is an example setup:
{
  "syntaxProfiles": {
    "html" : {
      "filters" : "html, bem"
    }
  },
  "preferences": {
    "bem.elementSeparator":"__",
    "bem.modifierSeparator":"--",
    "bem.shortElementPrefix":"-"
  }
}

There is also a great thing Bemto

F
fantazerno, 2016-08-09
@fantazerno

Config for setting up sublime

{
  "preferences": {
          "bem.elementSeparator": "__",
          "bem.modifierSeparator": "_",
          "bem.shortElementPrefix": "-"
  },
  "snippets": {
          "jade" : {
              "filters" : "bem,jade",
    }
  }
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question