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

[Feature Request] Support & + & in @element or @modifier #7

Closed
fengyuanchen opened this issue Nov 25, 2017 · 3 comments
Closed

[Feature Request] Support & + & in @element or @modifier #7

fengyuanchen opened this issue Nov 25, 2017 · 3 comments

Comments

@fengyuanchen
Copy link

Current:

@block list {
  margin: 0;

  @element item {
    padding: .5rem 1rem;

    & + .list__item {
      margin-left: .5rem;
    }
  }
}

Feature:

@block list {
  margin: 0;

  @element item {
    padding: .5rem 1rem;
    
    & + & {
      margin-left: .5rem;
    }
  }
}
@tbremer
Copy link
Owner

tbremer commented Nov 27, 2017

I don't plan on enabling this type of feature, there is postcss-nested plugin in which this output would be fully supported.

@tbremer tbremer closed this as completed Nov 27, 2017
@fengyuanchen
Copy link
Author

Actually, I use postcss-cssnext which includes postcss-nesting, but it seems the postcss-nesting plugin not support this feature (csstools/postcss-nesting#17), so I will turn to use postcss-nested now. Thanks!

@fengyuanchen
Copy link
Author

Works fine with the following config (postcss.config.js):

module.exports = {
  plugins: {
    'postcss-atrule-bem': {},
    'postcss-cssnext': {},
    'postcss-nested': {},
  },
};

Or:

module.exports = {
  plugins: {
    'postcss-atrule-bem': {},
    'postcss-nested': {},
    'postcss-cssnext': {},
  },
};

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

2 participants