Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for different types of components #129

Open
OriR opened this issue Mar 5, 2018 · 0 comments
Open

Add support for different types of components #129

OriR opened this issue Mar 5, 2018 · 0 comments

Comments

@OriR
Copy link

OriR commented Mar 5, 2018

If I understand the docs correctly then componentName may refer to either (I'm using BEM terminology here) block, element or modifier.
What I have is kind of a different style than the classic BEM where we write MultiNamedBlock__contained-element--with-modifier.

This means that I can't really differentiate between blocks, elements or modifiers.
Event if I supply something like this (?:block_pattern|element_pattern|modifier_pattern) it might be able to match invalid-block-name__WithElement--AndModifier in initial or combined even though we consider it invalid.

I'm proposing a way to supply different patterns that can be interpolated in initial and combined.
Something like this:

{
  componentName: {
    block: "block-pattern",
    element: "element-pattern",
    modifier: "modifier-pattern"
  },
  componentSelectors: {
    initial: "{componentName.block}__{componentName.element}--{componentName.modifier}"
  }
}

The structure of componentName can be dynamic to support for SUIT terminology, unless there's a way to categorize both of them in a way that makes sense to everyone 😃

Again, if there's a way to achieve this right now and I'm missing something I'd be happy to know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant