0

I have a CSS like this:

.button-navigation-container button {
   /*some properties*/
}

        .button-navigation-container button.back-button,
        .button-navigation-container button.cancel-button {
            text-align: right;
            padding-right: 2%;
        }

But now I want to convert to LESS but I'm not sure which kind of selector should I use to get the back-button and cancel-button with the same style. Something like this:

.button-navigation-container button {
       /*some properties*/

            /*Selector for cancel-button and back-button ?*/{
                text-align: right;
                padding-right: 2%;
            }
}

Should I use extend()?

1
  • are you want to convert your css to less? Commented Apr 20, 2014 at 11:47

1 Answer 1

1

Less

.button-navigation-container {
    button {
        /*some properties for button*/
        &.back-button, &.cancel-button {
            text-align: right;
            padding-right: 2%;
        }
    }
}

StyleSheet (Generated from the LESS)

.button-navigation-container button {
  /*some properties for button*/

}
.button-navigation-container button.back-button,
.button-navigation-container button.cancel-button {
  text-align: right;
  padding-right: 2%;
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.