LESS css group selectors for using pseudo-class

Let's say I have a group of elements to which I want to apply pseudo-classes, is there a way to define multi-petal elements in a variable, and then apply the pseudo-class to each of them at once? For instance:

@inputs: input[type=text], input[type=email], input[type=password], textarea; @inputs { //some styles; } @inputs:focus{ //some focus-specific styles; } 

Sorry if this is too obvious, I'm not new to LESS again

+4
source share
1 answer

I'm not sure you can do this, but it works too. I assume that you just want to write a long pseudo-class once.

 input[type=text], input[type=email], input[type=password], textarea { // styles for normal &:focus { // styles for focus } &:hover { } } 
+11
source

Source: https://habr.com/ru/post/1491504/


All Articles