Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Hands-On Data Structures and Algorithms with JavaScript

You're reading from   Hands-On Data Structures and Algorithms with JavaScript Write efficient code that is highly performant, scalable, and easily testable using JavaScript

Arrow left icon
Product type Paperback
Published in Jan 2018
Publisher Packt
ISBN-13 9781788398558
Length 332 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Kashyap Mukkamala Kashyap Mukkamala
Author Profile Icon Kashyap Mukkamala
Kashyap Mukkamala
Arrow right icon
View More author details
Toc

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 is 0.
  • Use minification if not being used already. This concatenates all the CSS files in use and removes all the whitespace...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime