GithubHelp home page GithubHelp logo

The Mod Field about bem-sdk HOT 9 CLOSED

bem avatar bem commented on May 12, 2024 2
The Mod Field

from bem-sdk.

Comments (9)

apsavin avatar apsavin commented on May 12, 2024

I did not get 2.
{ block: 'button', mod: { name: 'size', val: false } }
vs
{ block: 'button', modName: 'size', modVal: false }
Why less confusion?

from bem-sdk.

blond avatar blond commented on May 12, 2024

@apsavin I think that now { block: 'button', modName: 'size', modVal: false } will consider equivalent { block: 'button', modName: 'size' }.

If for boolean modifiers will the short form { block: 'button', mod: 'disabled' } then no one will want to write { block: 'button', mod: { name: 'disabled', value: true } or { block: 'button', mod: { name: 'disabled', value: false } and the full form will always be used for key-value modifiers.

from bem-sdk.

vithar avatar vithar commented on May 12, 2024

👍

from bem-sdk.

tadatuta avatar tadatuta commented on May 12, 2024

@blond isn't it just yet one more format for absolutely same purpose?

are there real places one must write such form manually (except for i-bem which you won't change anyways)?

from bem-sdk.

blond avatar blond commented on May 12, 2024

@tadatuta i-bem works with BEM entities, but bem-naming works with BEM entity parts. It's means that the syntax does not necessarily coincide.

For example, i-bem can use mods: { key: 'value' }.

In addition the i-bem and bem-naming have different users. It's means that the consistency of the formats is not important in this case.

In my opinion the mod field is better than modName + modVal fields. So I still want to make mod field.

from bem-sdk.

blond avatar blond commented on May 12, 2024

@tadatuta also i-bem can support mod field with old modName + modVal option

from bem-sdk.

tadatuta avatar tadatuta commented on May 12, 2024

also i-bem can support mod field with old modName + modVal option

?

from bem-sdk.

blond avatar blond commented on May 12, 2024

bem-entity-name use mod field and support modName and modVal for backward compatibility.

I think bem-naming must do the same.

from bem-sdk.

blond avatar blond commented on May 12, 2024

Fixed in #148

from bem-sdk.

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.