CSS optimizations
CSS optimizations are extremely easy and kind of obvious if you have experience developing with any preprocessor frameworks, such as SCSS/LESS. When we discuss CSS optimization, we are really talking about two different yet dependent things:
- Loading the style sheets
- Rendering and applying styles
Coding practices
There are a number of coding practices that we can adapt and learn to make our application perform better. Most of them might seem insignificant, but they do matter when scaled to a large application. We will discuss a few of these techniques with examples.
Using smaller values for common ENUM
As we are talking about reducing the page load time, one quick way to do so is by removing redundancies in the CSS file itself:Â
- Using
#FFFFFF
 ? Switch to#FFF
, which is the same RGB value represented in short. - Do not add
px
after a properties value if the value is0
. - Use minification if not being used already. This concatenates all the CSS files in use and removes all the whitespace...