una / CSSgram

CSS library for Instagram filters
http://una.github.io/CSSgram/
MIT License
5.39k stars 398 forks source link

Prefix class names with `filter-`? #159

Open tomByrer opened 8 years ago

tomByrer commented 8 years ago

Advantages:

Disadvantages:

Could prefix with cssgram- also, less clear, but helps in finding this repo.

henryruhs commented 8 years ago

1+

una commented 8 years ago

Hey @tomByrer -- I agree with namespacing being a good idea for semantic understanding. My biggest concern with this is that it would be a breaking change to the previous workflow and would affect everyone who has already implemented the library. The question here is -- is that tradeoff worth it?

Effeilo commented 8 years ago

1+ Another advantage, it will ease the code. for example


[class*="cssgram-"] {
  position: relative;
}

[class*="cssgram-"]:before, 
[class*="cssgram-"]:after {
  content: '';
  display: block;
  height: 100%;
  width: 100%;
  top: 0;
  left: 0;
  position: absolute;
  pointer-events: none;
}

[class*="cssgram-"] > img {
  width: 100%;
  z-index: 1;
}

[class*="cssgram-"]:before {
  z-index: 2;
}

[class*="cssgram-"]:after {
  z-index: 3;
}
tomByrer commented 8 years ago

@una Could keep the old class names, & make *.prefix.css|scss` files. @Effeilo good ideas

una commented 8 years ago

@Effeilo I really like what you did there -- it would reduce redundant code. This is definitely swaying me toward the prefixed version