The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS CSS Long Files Re: CSS Long Files


@TheDoc – using bgcover() and @include bgcover in your example above, is that also preprocessor only CSS or is that something you can do with plain old CSS? I was under the impression that stuff like that was not available in plain-jane CSS. Sorry for the noobish question. Currently, when multiple classes utilize the same properties, I’ve been doing something along the following lines:

.some-element, .other-element, .third-element {
/* Styles all three use */
border-bottom: 1px solid #000;
padding: 5px;
background-color: pink;

.other-element {
/* Styles unique to this element */
margin-left: 5px;

.third-element {
/* Styles unique to this element */
margin-left: 2px;

Using CSS like I do functions in PHP would be even better.

EDIT: After some googling, I’ve confirmed my original suspicions. So, I’d like to change my question a little bit. Short of adopting preprocessors, what other ways could I optimize my example?