0

I have several CSS classes with elements that always use the same combo.
Is there a way in CSS (Not LESS or similar systems) to bundle several classes into one rule?
Pseudo code:

.a{
   margin 30px 0;
}

.b{ 
  padding:0 4px;
}

@bob{
  .a;
  .b;
}

...
...
<div class='bob'>...</div>
Itay Moav -Malimovka
  • 52,579
  • 61
  • 190
  • 278
  • Is there a reason why you can't use the classes `.a` and `.b` in the same element? `
    ...
    ` ... Alternatively you can do something like `.a, .bob { ... } .b,.bob { ... }` and just use `.bob` in your element.
    – Ricky Ruiz Dec 07 '16 at 17:34
  • 1
    Possible duplicate of [Can we include common css class in another css class?](http://stackoverflow.com/questions/1576147/can-we-include-common-css-class-in-another-css-class) – fstanis Dec 07 '16 at 17:35
  • @Ricky the classes I want to bundle are coming from bootstrap. I can't use LESS (or similar) in this project. – Itay Moav -Malimovka Dec 07 '16 at 17:40

1 Answers1

0

No, CSS does not allow for this (which is one of the reasons why LESS and Sass were created in the first place).

fstanis
  • 5,234
  • 1
  • 23
  • 42