DEV Community

Discussion on: CSS Structure

Collapse
 
madsstoumann profile image
Mads Stoumann

I used to group my CSS in a similar way, but as more and more properties were introduced, I switched to alphabetic sorting, and have never looked back! By the way, the position example can use the new inset property, to set all 4 sides with a single value:

.element {
  inset: 0;
  position: absolute;
}
Enter fullscreen mode Exit fullscreen mode
Collapse
 
eljayadobe profile image
Eljay-Adobe

Alphabetic sorting for the win!

But, in the few cases where alphabetic sorting can't be done because the order is important... please comment the code!

Collapse
 
alextsalg profile image
Alex Salgado

@madsstoumann yess! inset is an awesome property, I saved that one to another post along with other properties that saves time and are awesome.