concept selector group in category css

appears as: selector groups, selector group
Sass and Compass in Action

This is an excerpt from Manning's book Sass and Compass in Action.

Sass is smart about selector nesting even beyond the parent selector. When it encounters selector groups—multiple selectors separated by commas—it figures out what it has to do to nest them correctly.

2.2.2. Nesting selector groups

In CSS, the selector h1, h2, h3 matches h1 elements, h2 elements, and h3 elements. Similarly, .button, button matches button elements and elements with class .button. These are known as selector groups. A rule with a selector group applies to all the elements that match some selector in the group:

.button, button {
  margin: 0;
}

This is a welcome relief from repetition in CSS, but the relief is short-lived. Eventually, you need to have a selector group that only applies within a container. CSS makes you repeat the container’s selector for each selector in the group: