Giter Club home page Giter Club logo

Comments (3)

acjay avatar acjay commented on August 17, 2024

It's not a good idea to have elements create their own block scopes in general. BEM really shines when elements are "portable", meaning that you can move them around and change their nesting without modifying the styles.

But an important BEM concept is to allow for the same tag to be an element of a block and its own block root:

<div class="my-big-component">
  <div class="my-big-component__submit-control special-button">
    <div class="special-button__label"></div>
    <div class="special-button__other-label"></div>
  </div>
</div>

from bemto.

ocoka avatar ocoka commented on August 17, 2024

But for now we already can make this:

+b.some-block
  +b.scoped-elt.__element
    +e.sub-element

And we will get:

<div class="some-block">
  <div class="scoped-elt some-block__element">
      <span class="scoped-elt__sub-element"

from bemto.

kizu avatar kizu commented on August 17, 2024

The basics for this was made in rc-1.0 using a special option and a syntax for making an element to be a root of the following elements:

- set_bemto_settings({ flat_elements: false })

+b.foo
  +e.bar__
    +e.taz

producing

<div class="foo">
  <div class="foo__bar">
    <div class="foo__bar__taz">
    </div>
  </div>
</div>

There are still some cases for elements of elements left, but they'll be implemented in later versions.

from bemto.

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.