3

I'm creating my site using MaterializeCSS, and like other frameworks, i usually has to put multiple classes in my elements to achieve what i want. For example, all my buttons will be like this:

<button class="waves-effect waves-light btn red darken-4">My button</button>

I'd like not to have to put this classes in every button, it would be great to do this only in css and it would by applied to every button in my site.

I've discovered that with LESS mixin I could do this:

.bordered {
    border-top: dotted 1px black;
    border-bottom: solid 2px black;
}

div {
    .bordered();
} 

So i tried the code bellow, but that didn't worked with classes outside the less file.

btn {
    .waves-effect();
    .waves-light();
    .btn();
    .red(); 
    .darken-4();
}

Is there a way to do that, with LESS or other tool?

Marlon
  • 1,719
  • 3
  • 20
  • 42

0 Answers0