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

Private class names #100

Open
denis-sokolov opened this issue Dec 30, 2015 · 4 comments
Open

Private class names #100

denis-sokolov opened this issue Dec 30, 2015 · 4 comments

Comments

@denis-sokolov
Copy link

._myBlock {
  display: block;
  border-radius: 5px;
}

.myButton {
  composes: _myBlock;
  cursor: pointer;
}

.myForm {
  composes: _myBlock;
  border: 3px solid blue;
}

Here _myBlock is an implementation detail that I would like not to publish for my consumers. This is not about minification, this is about encapsulation. I did not find such a feature, and although an underline in the beginning of a file name helps, a native solution would be best.

Possible syntax:

:private .myBlock {
}
@CubedEye
Copy link

CubedEye commented Jan 7, 2016

👍 +1

@safareli
Copy link

safareli commented Mar 2, 2016

+1

@ai
Copy link

ai commented Jul 9, 2016

In CSS : uses for pseudo-selectors like :hover. So, they are more like filters. I think :private .myBlock not in CSS philosophy. Maybe we should add at-rule:

@private {
  .myBlock {
  }
}

But anyway in my opinion it is over-engeniring. You don’t need a class in this example,l, because you can do same without .base:

.myButton, .myForm {
}
.myButton {
}
.myForm {
}

@ryanblakeley
Copy link

By "private", do you mean you don't want that CSS class to show up in the stylesheet? Like just copy the styles into any classes that compose it, but don't include it in the final stylesheet?

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

No branches or pull requests

6 participants