0

is there any way to do this (without SASS, LESS etc..):

.main_class{

   .subclass_1{
      property: value;
   }
   .subclass_2{
      property: value;
   }
   .subclass_3{
      property: value;
   }

}

instead of this (4 declarations of main_class):

   .main_class .subclass_1{
        property: value;
    }
    .main_class .subclass_2{
        property: value;
    }
   .main_class .subclass_3{
        property: value;
    }
arodriguezdonaire
  • 5,396
  • 1
  • 26
  • 50
  • 1
    Why would you want to use the main class anyway? You should use an ID if the element really needs its unique css properties – BBQ. Aug 13 '15 at 13:53
  • This is exactly what `SASS` and `LESS` are for... It's like your asking 'Can I make a phone call... Without using a phone?'... You asking us to come up with a solution whilst casually mentioning the solution and then saying 'no this please' :) – somethinghere Aug 13 '15 at 13:55
  • @BBQ. I need "main_class" fore example because of mobile-devices recognization. somethinghere I wanted to know for sure that this is not possible. :) – user2997914 Aug 13 '15 at 13:56
  • @user2997914 [Media queries](https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Media_queries) exist for this purpose. – BBQ. Aug 13 '15 at 13:57
  • This is css, not any programming language like js to use nesting. You have to use less or scss – Laxmikant Dange Aug 13 '15 at 13:59
  • @BBQ. Thank you.Of course I use media-queries but I need more specific classing than media queries can offer. – user2997914 Aug 13 '15 at 14:01

0 Answers0