Skip to content
This repository has been archived by the owner on Dec 22, 2023. It is now read-only.

Wrapped bemto block's modifiers are treated as block-starting #8

Open
kizu opened this issue Oct 30, 2017 · 2 comments
Open

Wrapped bemto block's modifiers are treated as block-starting #8

kizu opened this issue Oct 30, 2017 · 2 comments
Labels

Comments

@kizu
Copy link
Member

kizu commented Oct 30, 2017

Test case:

test('with a wrapped component', () => {
  const wrappedComponent = bemto('.wrappedComponent');
  testSnapshot(
    bemto(wrappedComponent),
    {
      className: 'newClassname',
      _mod: 'value'
    }
  );
});

Right now this would output:

exports[`with a wrapped component 1`] = `
<div
  className="newClassname newClassname_mod_value wrappedComponent newClassname_mod_value newClassname_mod_value_mod_value wrappedComponent_mod_value"
/>
`;

That's not that trivial to fix, as we can't tell just from the classNames alone that they're added by bemto. So when we pass a one bemto block to another, we don't have a way to tell which classes should be treated as block-starting.

@kizu
Copy link
Member Author

kizu commented Nov 17, 2017

That seems to be fixed, not perfectly, but better than nothing I guess, I'll need to investigate nested blocks more

kizu added a commit that referenced this issue Jun 13, 2018
@kizu
Copy link
Member Author

kizu commented Jun 13, 2018

Prevented some of the cases from happening, but still not perfect and could potentially prevent for some valid stuff from being created.

For now, the best show would be if it would be possible to store the names in the context, not sure if this would be viable though.

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

No branches or pull requests

1 participant