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
Accelerating Angular Development with Ivy

You're reading from   Accelerating Angular Development with Ivy A practical guide to building faster and more testable Angular apps with the new Ivy engine

Arrow left icon
Product type Paperback
Published in Oct 2021
Publisher Packt
ISBN-13 9781800205215
Length 242 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Authors (3):
Arrow left icon
Lars Gyrup Brink Nielsen Lars Gyrup Brink Nielsen
Author Profile Icon Lars Gyrup Brink Nielsen
Lars Gyrup Brink Nielsen
Jacob Andresen Jacob Andresen
Author Profile Icon Jacob Andresen
Jacob Andresen
Mateus Carniatto Mateus Carniatto
Author Profile Icon Mateus Carniatto
Mateus Carniatto
Arrow right icon
View More author details
Toc

Table of Contents (14) Chapters Close

Preface 1. Chapter 1: Discovering New APIs and Language Syntax 2. Chapter 2: Boosting Developer Productivity Through Tooling, Configuration, and Convenience FREE CHAPTER 3. Chapter 3: Introducing CSS Custom Properties and New Provider Scopes 4. Chapter 4: Exploring Angular Components Features 5. Chapter 5: Using CSS Custom Properties 6. Chapter 6: Using Angular Components 7. Chapter 7: Component Harnesses 8. Chapter 8: Additional Provider Scopes 9. Chapter 9: Debugging with the New Ivy Runtime APIs 10. Chapter 10: Using the Angular Compatibility Compiler 11. Chapter 11: Migrating Your Angular Application from View Engine to Ivy 12. Chapter 12: Embracing Ahead-of-Time Compilation 13. Other Books You May Enjoy

Building a theme picker using custom CSS properties

Having a theme available for your application is a common and important use case that is already covered by popular Angular libraries. You may be aware that Angular Material already supports several available themes (for example, the popular deeppurple-amber and indigo-pink). The common approach of using preprocessor variables when using SCSS has been available for some time. But now, you can support dynamic theming using custom CSS properties without having to generate the CSS files using a preprocessor. This adds new options for interactive theming that we will cover in this section.

Given that further CSS rules can be built using CSS Custom Properties, we can now change several styling rules in one go, directly from one of the components in the application. Here, one or more CSS classes can be calculated on the fly via the --headerbackground custom property or simply by attaching the value of the property as the CSS class, like...

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