Let's say you need to add a button to a subscription form.
<button style="background-color: red; width: 200px;">Subscribe</button>
<button class="big-red-button">Subscribe</button>
.big-red-button {
background-color: red;
width: 200px;
}
<button class="button-danger button-large">Subscribe</button>
.button-danger {
background-color: red;
}
.button-large {
width: 200px;
}
<button class="subscription-button">Subscribe</button>
Using custom property sets:
:root {
--button-danger: {
background-color: red;
}
--button-large: {
width: 200px;
}
}
.subscription-button {
@apply: --button-danger;
@apply: --button-large;
}
or using LESS syntax:
.button-danger () {
background-color: red;
}
.button-large () {
width: 200px;
}
.subscription-button {
.button-danger;
.button-large;
}
or