During the paint of the document by the browser the order of the properties of the CSS classes can interfere in how we perceive the "assembly" of the page?
Especially on slower connections, we literally see the styles being applied to the elements, so the order of the properties we use in the classes should be something to take into consideration when writing CSS? I mean, does the order of attributes in classes interfere with CSSOM and how does the Rendering Tree build from the browser?
I saw this image and wondered if the order of CSS styles could interfere with the paint of the page ...
Example:(consideringtherendertree/slowconnections/performanceandUX/UI)
Let'ssaywehavethefollowingCSSthatwasspelled"randomly" without any concern about the attributes.
.container {
background: rgba(0,0,0,0.25);
width: 100%;
height: 100%;
text-align: center;
padding-top: 100px;
display: block;
position: absolute;
z-index: 2;
font-family: consola;
font-size: 1rem;
}
And we have another CSS that was written thinking in the order that the layout of the elements is constructed:
.container {
display: block;
position: absolute;
width: 100%;
height: 100%;
padding-top: 100px;
z-index: 2;
background: rgba(0,0,0,0.25);
font-family: consola;
font-size: 1rem;
text-align: center;
}
There should be care in ordering these attributes within the classes, do they influence how the Rendering Tree and page paint work? Is there any good practice?
What attributes are more important than others in CSS and which ones are interpreted with priority or not?
Or does not it exist, is it totally irrelevant and should not waste time on it?
OBS: I know that most likely each browser can understand this in a different way, so I do not make any distinction about a browser or another one ok, any information is valid.