You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Eliminating the unnecessary layout pass/update will improve the performance of the app.
Think about the layout pass when you are dealing with DOMs in the loop.
Layout pass is a complex procedure to apply the CSS style and other layout calculation to render the element. Even though it doesn't take long for one layout pass, it can be easily increased when it's been used in the loop.
Accessing the height or width of an element is one of the calls that trigger a layout pass.
Common symptom is the unexpected style change when navigating in and out in the single page navigation application.
Once the CSS style is loaded, it is not unloaded even when you navigate into the new page. If there's a style defined again using the same class name or same css selector, it'll override the current style. To Avoid the unwanted style change, use css nesting which can differentiate the style.
.CSSConflict .page-section .inner-section .css-conflict-div-1 {
/* defined with .CSSConflict class which can be used as the unique identifier */
}
.inner-section .css-conflict-div-2 {
/* this can be overridden easily*/
}
Don't apply this rule to the CSS style which is intended to be applied to elements in multiple pages.
Media Query - Put the media query section at the end of file. (if you want to define some style to override).
Define the media query at the end of CSS file. If not, the media query style will be over-written by the original style.
We usually define media query with some style we want to override. Because it's overriding the original style, it should be defined after the original style is defined.