Categories
Articles

CSS Modules with Webpack 4

Ok, I know what you are going to say. We have heard of modules with Programming languages, but modules in CSS. Is that even possible? and why do you need it at first place? Well, I had a similar reaction when I heard about it. CSS Modules were born out of the idea of relentless hours spent in debugging issues caused by overlapping CSS selectors, class names. It is a common practice of having multiple style declarations spread across CSS files. The web projects include multiple CSS files to define common layout appearance, widgets etc. This sometimes becomes a nightmare when you have multiple CSS files sharing same class selector.