Copyright by Inayaili de León, Antony Kennedy

Safari, the world’s most comprehensive technology and business learning platform.

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required

O'Reilly logo

Chapter 9. Dynamic CSS

Up until now, this book has considered CSS files to be static assets. That is, what is requested from the server and delivered to visitors of your site is exactly the same in every instance. Although this is almost always the expected behavior and most performant way to implement CSS, it is possible to tailor the output of our CSS dependent on other factors and deliver different CSS to different users.

There are several reasons you might like to do this, some for the benefit of developers and some for the benefit of users. From the developer's perspective, it can be useful to use variables[84] or to dynamically populate CSS. For any repetitive code, such as colors or particular blocks of CSS, storing this once and maintaining ...

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required