Adjoining classes, or class chaining Good, Bad?

I would Like to get everyone’s thought’s on this.


.wrapa.activea::before,
.wrapa.activea::after {
  content: "";
  position: absolute;
  top: 0;
  width: 198px;
  height: 44px;
}

.wrapa.activea::before {
  left: 0;
  background-color: #00ffff;
}

.wrapa.activea::after {
  right: 0;
  background-color: #ff00ff;
}

.wrapb.active::before {
  opacity: 1;
  border: 3px solid #e77d19;
}

.wrapb.active .lines::before,
.wrapb.active .lines::after {
  background: #e77d19;
}

.wrape.inactive .cover {
  display: block;
}

.wrape.inactive a {
  display: none;
}

.wrape.inactive .playButtone {
  display: none;
}

.wrape.active .playButtone {
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  margin: auto;
  width: 50px;
  height: 50px;
  background: rgba(0, 0, 0, .7);
  cursor: pointer;
  fill: #aaff00;
}
.wrape.active {
  background: url("https://i.imgur.com/dCneQvW.png") no-repeat -260px 0;
}

Adjoining classes

According to CSSLint…

these aren’t handled properly by Internet Explorer 6 and earlier.

I don’t think you need to worry. We don’t care about IE6 anymore, so this lint rule seems out of date.

4 Likes

Yes that article is outdated and nonsense in terms of today’s browsers.

There is nothing at all wrong with adjoining classes when used properly and are an important concept.

If we disallow everything that doesn’t work in IE6 then that would be 90% of current css I think.

3 Likes

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.