• Using an Angular Service to Read Sass Variables

    1 month ago - By HTML Goodies

    Sass - short for Syntactically Awesome Style Sheets - is a CSS compiler that simplifies the writing CSS. It's a popular choice among Angular developers because, besides greatly reducing the amount of redundancy in CSS rules, Sass is also natively supported by the Angular CLI. In fact, it's one of your choices whenever you create a new project:
    In the Binding CSS Styles to Events in Angular Applications tutorial, we learned how to set vanilla CSS variables using the setProperty method. You can think of today's article as a sort of companion piece in that it will cover how to read variables...
    Read more ...

     

  • Manage Theme Colors in Angular Using an Object Map

    Manage Theme Colors in Angular Using an Object Map

    1 month ago - By HTML Goodies

    In the Using an Angular Service to Read Sass Variables tutorial we learned how to fetch theme colors that are defined in a Sass .scss file using a service. The associated demo app provided radio buttons to select between standard theme colors and a lighter or darker variation. Here is an example of how that looked.
    While the previous article described how the app loaded the colors from the Sass .scss file, this one will cover how to store color and variation combinations for easy access from the ColorService .
    Mapping Loaded Color Properties to a Specific Theme
    Recall that the...
    Read more ...