<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Peter Øvergård Clausen</title>
    <description>The latest articles on Forem by Peter Øvergård Clausen (@peteroeclausen).</description>
    <link>https://forem.com/peteroeclausen</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F473234%2F6efe6f60-9ac2-424e-b95b-134bbfc4aeeb.jpeg</url>
      <title>Forem: Peter Øvergård Clausen</title>
      <link>https://forem.com/peteroeclausen</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/peteroeclausen"/>
    <language>en</language>
    <item>
      <title>9 quick tips for keeping development velocity high within a software development team</title>
      <dc:creator>Peter Øvergård Clausen</dc:creator>
      <pubDate>Mon, 21 Feb 2022 12:23:32 +0000</pubDate>
      <link>https://forem.com/itminds/9-quick-tips-for-keeping-development-velocity-high-within-a-software-development-team-38ob</link>
      <guid>https://forem.com/itminds/9-quick-tips-for-keeping-development-velocity-high-within-a-software-development-team-38ob</guid>
      <description>&lt;p&gt;Throughout the 2 years and 7 months I've been a software development consultant at IT Minds, I've been at three different companies. This has provided me with insight into developing software when working in teams, and I would therefore like to share these following 9 tips for keeping development velocity high within a team.&lt;/p&gt;

&lt;p&gt;Consider trying them out in your development team, and let us know in the comments what you think about our tips, and whether you have any tips that you would add to the list. 😊&lt;/p&gt;

&lt;h2&gt;
  
  
  1 - Refactor often to keep software quality high and technical debt low
&lt;/h2&gt;

&lt;p&gt;It is unavoidable to gain technical debt as features grow and requirements change, hence dealing with technical debt before it slows you down is important. A well refactored codebase is more prepared for change and new features. Developers and project managers alike should prioritize refactoring as it keeps the software clean and prepared for change.&lt;/p&gt;

&lt;h2&gt;
  
  
  2 - Rely on external libraries
&lt;/h2&gt;

&lt;p&gt;Rather than developing own libraries from scratch, and having to document and maintain these, one should rather spend a day researching whether there’s an existing external library that solves the problem at hand. Less time will be spent on maintaining the library, less time will be spent on documenting the library, and team members will have a place to read and learn about the library rather than having to ask the person who made it. There is no reason to reinvent the wheel, unless the wheel is your product.&lt;/p&gt;

&lt;h2&gt;
  
  
  3 - Have a shared Wiki for team documentation
&lt;/h2&gt;

&lt;p&gt;When a new team member joins a development team, a lot of time and confusion can be saved if the new team member has access to documentation which allows them to gain knowledge on how to set up the system locally as well as on the choices that have been made thus far. Furthermore, a wiki helps knowledge sharing  within the team, making it easier for team members to help each other out.&lt;/p&gt;

&lt;h2&gt;
  
  
  4 - Plan ahead, at least one sprint in advance
&lt;/h2&gt;

&lt;p&gt;Always knowing where the product is headed, keeps the motor running. Sometimes a feature is implemented faster than expected, and moving on to the next feature can be quick. Likewise, if something takes longer than expected, you can assess the priority and know which other features are postponed.&lt;/p&gt;

&lt;h2&gt;
  
  
  5 - Prioritize what’s essential, and avoid frequent scope changes
&lt;/h2&gt;

&lt;p&gt;Make it clear which feature requests are need-to-have and which are nice-to-have, and always have tasks in the sprint prioritized on what is most important. Seek to break down large tasks into smaller subtasks, and try to estimate how long they’ll take. In this way, the team will know which tasks are heavy and highly prioritized and which tasks should be focused on within the sprint, while the project manager can monitor progress.&lt;/p&gt;

&lt;h2&gt;
  
  
  6 - Divide responsibilities among team members, but also allow team members to help each other across responsibilities
&lt;/h2&gt;

&lt;p&gt;Letting a team member work on other team members' responsibilities speeds up development and knowledge sharing. Instead of two team members having to coordinate tightly, smaller adjustments to the backend could be carried out by a frontend developer and subsequently reviewed by backend developers as a pull request. If the implementation needs adjustment, backend developers can help out. The same goes for backend developers making small changes in the frontend. For smaller software products, it may be the case that everyone can work with everything, but for larger software products it becomes infeasible for one person to know and work on everything. For this reason, my advice is to divide responsibilities, but also to let the team members help each other out across responsibilities.&lt;/p&gt;

&lt;h2&gt;
  
  
  7 - Invest in your teammates
&lt;/h2&gt;

&lt;p&gt;You may have a lot on your plate right now, but it’s never a bad idea to help out a teammate and share your knowledge of the codebase and technologies used. You may not get as much work done at first when your teammate starts, but sharing your responsibilities and knowledge will greatly improve development velocity when your teammate is up to speed, and it’ll lift some weight off your shoulders. The faster that can happen, the faster you’ll get the benefit of your teammate. Also, I’m sure your manager understands that you’re spending time onboarding and investing time in your teammate.&lt;/p&gt;

&lt;h2&gt;
  
  
  8 - Automate as much as possible
&lt;/h2&gt;

&lt;p&gt;Build, Test, and Release pipelines makes sure that the software is in a consistent state and that new features can quickly be tried out by the product owner in the DEV environment. Implementing scripts to do mundane common tasks can also save a lot of time.&lt;/p&gt;

&lt;h2&gt;
  
  
  9 - Conduct Engineering meetings
&lt;/h2&gt;

&lt;p&gt;I was at a company as a consultant that conducted a one-hour Engineering meeting every Friday. Developers could submit topics throughout the week to be discussed at the engineering meeting. We pointed out parts of the product that needed refactoring, discussed problems and solutions, and introduced new libraries that could help us tremendously. The meetings also helped with knowledge sharing and improved team members' joy for the project and team spirit. Also, a lot of cross-team-communication could be done efficiently within this hour. I highly recommend these meetings.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;We have explained the following 9 tips for keeping software velocity high within a team:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Refactor often to keep software quality high and technical debt low&lt;/li&gt;
&lt;li&gt;Rely on external libraries&lt;/li&gt;
&lt;li&gt;Have a shared Wiki for team documentation&lt;/li&gt;
&lt;li&gt;Plan ahead, at least one sprint in advance&lt;/li&gt;
&lt;li&gt;Prioritize what’s essential, and avoid frequent scope changes&lt;/li&gt;
&lt;li&gt;Divide responsibilities among team members, but also allow team members to help each other across responsibilities&lt;/li&gt;
&lt;li&gt;Invest in your teammates&lt;/li&gt;
&lt;li&gt;Automate as much as possible&lt;/li&gt;
&lt;li&gt;Conduct Engineering meetings&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Let us know in the comments if you have any additional tips for keeping development velocity high within a team - or simply if you have tried out any of our tips within your team, and whether it was a success or not. 😊&lt;/p&gt;

</description>
      <category>agile</category>
      <category>team</category>
      <category>productivity</category>
      <category>management</category>
    </item>
    <item>
      <title>Build beautiful websites with Angular and Material Design</title>
      <dc:creator>Peter Øvergård Clausen</dc:creator>
      <pubDate>Fri, 02 Oct 2020 07:16:55 +0000</pubDate>
      <link>https://forem.com/itminds/build-beautiful-websites-with-angular-and-material-design-35eg</link>
      <guid>https://forem.com/itminds/build-beautiful-websites-with-angular-and-material-design-35eg</guid>
      <description>&lt;p&gt;Making stunning websites with a coherent design, colors, typography and animations has never been easier than now. &lt;/p&gt;

&lt;p&gt;In this blog post we will take a quick dive into &lt;a href="https://angular.io/" rel="noopener noreferrer"&gt;Angular&lt;/a&gt; and &lt;a href="https://material.angular.io/" rel="noopener noreferrer"&gt;Angular Material&lt;/a&gt; to illustrate how easy it is to get started. We will show the strengths of using Angular Material theming and create our own theme. We will also highlight other benefits of using &lt;a href="https://material.io/" rel="noopener noreferrer"&gt;Material Design&lt;/a&gt; such as the design kits that comes for eg. &lt;a href="https://www.adobe.com/products/xd.html" rel="noopener noreferrer"&gt;Adobe XD&lt;/a&gt; for effectively designing mockups and prototyping, as well as mention common used helpers that comes with Angular Material.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://angular.io/" rel="noopener noreferrer"&gt;Angular&lt;/a&gt; is one of the most popular web frameworks used right now, it is type-script based, open-source, and it is led by the Angular Team at Google.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://material.io/" rel="noopener noreferrer"&gt;Material Design&lt;/a&gt; is a design framework also developed by Google, which contains guidelines, components and tools that support best practices of user interface design.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://material.angular.io/" rel="noopener noreferrer"&gt;Angular Material&lt;/a&gt; is an implementation of Material Design for Angular. It features many &lt;a href="https://material.angular.io/components/categories" rel="noopener noreferrer"&gt;plug-and-play components and styling&lt;/a&gt; for buttons, input fields, tables, date pickers, cards and much more, as well as offer a way to create and customize the theme of your website.&lt;/p&gt;

&lt;p&gt;What we'll end up with in this blog post is a login page implemented in Angular that utilizes Angular Material thus using the Material Design specification. I'll show how quick you can get started with Angular and Angular Material, and how you can build your Angular application such that changes in the theme will also update all your components themes at once:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F37aaalrshn6xihacoj2k.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F37aaalrshn6xihacoj2k.gif" alt="dark-theme"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You may choose to follow along yourself or look at the final code &lt;a href="https://github.com/PeterOeClausen/angular-material-design-components-example-app" rel="noopener noreferrer"&gt;here&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;Finally, I will also include some ressources that can go hand-in-hand with your Angular application and Material Design.&lt;/p&gt;

&lt;p&gt;Sidenote: If you're using React, &lt;a href="https://material-ui.com/" rel="noopener noreferrer"&gt;Material-UI&lt;/a&gt; is another implementation of Material Design made for React. Material Design is also available for &lt;a href="https://material.io/develop" rel="noopener noreferrer"&gt;Android, iOS, Flutter and as CDN&lt;/a&gt;, but today we'll only be looking at Angular Material.&lt;/p&gt;

&lt;p&gt;Let's dive in! 🏊&lt;/p&gt;

&lt;h2&gt;
  
  
  Setup
&lt;/h2&gt;

&lt;p&gt;In the following 3 easy steps, we will install Node and Angular, create and run an Angular application, and enable Angular Material.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1 - Install NodeJS:
&lt;/h3&gt;

&lt;p&gt;Install NodeJS: &lt;a href="https://nodejs.org/" rel="noopener noreferrer"&gt;https://nodejs.org/&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2 - Install Angular and create an Angular project:
&lt;/h3&gt;

&lt;p&gt;In your OS terminal execute the following commands:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

&lt;span class="c"&gt;# Install Angular using the Node Package Manager:&lt;/span&gt;
npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; @angular/cli
&lt;span class="c"&gt;# Create a new Angular application named "example-app" using the Angular CLI using scss as stylesheet and with Angular routing enabled:&lt;/span&gt;
ng new example-app &lt;span class="nt"&gt;--style&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;scss &lt;span class="nt"&gt;--routing&lt;/span&gt;
&lt;span class="c"&gt;# Change directory into the project directory:&lt;/span&gt;
&lt;span class="nb"&gt;cd &lt;/span&gt;example-app
&lt;span class="c"&gt;# Run the Angular development server locally:&lt;/span&gt;
ng serve


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;I prefer SCSS, which is similar to CSS, so I picked that, but you can remove &lt;code&gt;--style=scss&lt;/code&gt; and use CSS instead if you want, but note that we'll be using SCSS in this guide.&lt;/p&gt;

&lt;p&gt;After running &lt;code&gt;ng serve&lt;/code&gt; we should now have an Angular project running on &lt;code&gt;localhost:4200&lt;/code&gt; that we can access in our web browser, eg. Google Chrome. You can stop the development server again by typing "ctrl + c" in the terminal running the server or by closing the terminal window.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F7317gb12iqus48x1uou3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F7317gb12iqus48x1uou3.png" alt="chrome_E4dSTIVUau"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3 - Add Angular Material:
&lt;/h3&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

ng add @angular/material


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Angular Material comes with the Indigo/Pink theme by default which is the one you're seeing on the &lt;a href="https://material.angular.io/" rel="noopener noreferrer"&gt;Angular Material homepage&lt;/a&gt;. More on Angular Material theming later.&lt;/p&gt;

&lt;p&gt;This concludes our 3-step setup.&lt;/p&gt;

&lt;p&gt;We now have an Angular application with Angular Material installed using the default indigo/pink theme, and we can run it with the &lt;code&gt;ng serve&lt;/code&gt; command.&lt;/p&gt;

&lt;h2&gt;
  
  
  Using Angular Material Components
&lt;/h2&gt;

&lt;p&gt;Angular Material comes with many Angular components and styling, each type of component in their own module.&lt;/p&gt;

&lt;p&gt;In Angular, a component usually consists of 3 files: The &lt;code&gt;name.component.html&lt;/code&gt; file called the "template", the &lt;code&gt;name.component.scss&lt;/code&gt; file containing styling for your template, and the &lt;code&gt;name.component.ts&lt;/code&gt; file which contains a typescript class, which references the HTML and SCSS.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;name.component.spec.ts&lt;/code&gt; contains tests for the component but is not part of the component itself.&lt;/p&gt;

&lt;p&gt;You can think of an Angular Material component as a button with a default style, which you can easily customize and use in your Angular application. In Angular, you can build components with components, eg. a login page component consisting of a button component and several input components.&lt;/p&gt;

&lt;p&gt;A module in Angular is a lazy-loaded collection of components. You can import an Angular Material module in your applications module (&lt;code&gt;app.module.ts&lt;/code&gt;) to get access to all the Angular Material components which it contains and use these Angular Material components in your application components.&lt;/p&gt;

&lt;p&gt;You can get an overview of all Angular Material components &lt;a href="https://material.angular.io/components/categories" rel="noopener noreferrer"&gt;here&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;For now, let's make a component in Angular that uses a Material raised button &lt;code&gt;mat-raised-button&lt;/code&gt;:&lt;/p&gt;

&lt;h3&gt;
  
  
  Creating a new component in Angular
&lt;/h3&gt;

&lt;p&gt;First we make a component:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

ng generate component login


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;We'll eventually end up making a login page, so for now we've named our component "login".&lt;/p&gt;

&lt;p&gt;This Angular CLI command generates 4 files: &lt;code&gt;login.component.html&lt;/code&gt;, &lt;code&gt;login.component.scss&lt;/code&gt;, &lt;code&gt;login.component.ts&lt;/code&gt; and &lt;code&gt;login.component.spec.ts&lt;/code&gt; for us.&lt;/p&gt;

&lt;p&gt;In &lt;code&gt;app.component.html&lt;/code&gt; I got rid of the Angular template html so it looks like this:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;

&lt;span class="nt"&gt;&amp;lt;router-outlet&amp;gt;&amp;lt;/router-outlet&amp;gt;&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The &lt;code&gt;&amp;lt;router-outlet&amp;gt;&lt;/code&gt; will render the component which we specify in &lt;code&gt;app-routing-module.ts&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;We don't want to show the template html above our login component, that is why we remove the template code above it.&lt;/p&gt;

&lt;p&gt;Next, we add a route to &lt;code&gt;app-routing.module.ts&lt;/code&gt; that points to our newly created &lt;code&gt;Login&lt;/code&gt; component when our url path is &lt;code&gt;localhost:4200/login&lt;/code&gt;:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;routes&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Routes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;login&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;component&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;LoginComponent&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="p"&gt;...&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;We can check that our component is rendered by accessing &lt;code&gt;localhost:4200/login&lt;/code&gt; while our local development server is running. We should be seeing "login works" displayed:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fdg0xd558g2zh4f2sbfs3.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fdg0xd558g2zh4f2sbfs3.PNG" alt="login-works"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Adding a raised Material button
&lt;/h3&gt;

&lt;p&gt;To add a Material button we consult the &lt;a href="https://material.angular.io/components/button/api" rel="noopener noreferrer"&gt;Angular Material documentation on buttons&lt;/a&gt;. Under the API tab it says we need to add the &lt;code&gt;MatButtonModule&lt;/code&gt;. And we'll do that in &lt;code&gt;app.module.ts&lt;/code&gt;:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;

&lt;span class="p"&gt;...&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;MatButtonModule&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@angular/material/button&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;NgModule&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;declarations&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="p"&gt;...&lt;/span&gt;
  &lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="na"&gt;imports&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="p"&gt;...&lt;/span&gt;
    &lt;span class="nx"&gt;MatButtonModule&lt;/span&gt;
  &lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="p"&gt;...&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;AppModule&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Then we can add a button to our &lt;code&gt;login.component.html&lt;/code&gt; like so:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;

&lt;span class="nt"&gt;&amp;lt;button&lt;/span&gt; &lt;span class="na"&gt;mat-raised-button&lt;/span&gt; &lt;span class="na"&gt;color=&lt;/span&gt;&lt;span class="s"&gt;"primary"&lt;/span&gt; &lt;span class="na"&gt;(click)=&lt;/span&gt;&lt;span class="s"&gt;"onButtonClick()"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Click me!&lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;And a button handler in &lt;code&gt;login.component.ts&lt;/code&gt; like so:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;LoginComponent&lt;/span&gt; &lt;span class="k"&gt;implements&lt;/span&gt; &lt;span class="nx"&gt;OnInit&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="p"&gt;...&lt;/span&gt;
  &lt;span class="nf"&gt;onButtonClick&lt;/span&gt;&lt;span class="p"&gt;(){&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Clicked&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;When we go to &lt;code&gt;localhost:4200/login&lt;/code&gt; in our browser we should see the login component. We now have a button that plays a ripple animation when we click on it:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F7qjb3zsot789yh30jk0d.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F7qjb3zsot789yh30jk0d.gif" alt="GMN6BRyQLn"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Not only that, as we used the &lt;code&gt;mat-raised-button&lt;/code&gt; attribute, the button is "raised" having a box-shadow to stand out more on the page. And the color of the button is the selected theme's primary color. Awesome!&lt;/p&gt;

&lt;p&gt;Alternatively, we could have used &lt;code&gt;mat-button&lt;/code&gt; or &lt;code&gt;mat-stroked-button&lt;/code&gt; to change the appearance of the button. And we could have used &lt;code&gt;color="accent"&lt;/code&gt; to make the button pink (our secondary theme color) or &lt;code&gt;color="warn"&lt;/code&gt; to make it red. For an overview of different button designs &lt;a href="https://material.angular.io/components/button/overview" rel="noopener noreferrer"&gt;see examples in the documentation&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Adding input fields
&lt;/h3&gt;

&lt;p&gt;Let's add some input fields for a username and password:&lt;/p&gt;

&lt;p&gt;We import &lt;code&gt;MatInputModule&lt;/code&gt; and &lt;code&gt;MatFormFieldModule&lt;/code&gt; into &lt;code&gt;app.module.ts&lt;/code&gt; and begin using &lt;a href="https://material.angular.io/components/form-field/overview" rel="noopener noreferrer"&gt;Angular Material form fields&lt;/a&gt;:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;

&lt;span class="p"&gt;...&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;MatInputModule&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@angular/material/input&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;MatFormFieldModule&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@angular/material/form-field&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;NgModule&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;declarations&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="p"&gt;...&lt;/span&gt;
  &lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="na"&gt;imports&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="p"&gt;...&lt;/span&gt;
    &lt;span class="nx"&gt;MatInputModule&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nx"&gt;MatFormFieldModule&lt;/span&gt;
  &lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="p"&gt;...&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;AppModule&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;And now we can start using the Angular Material components in our &lt;code&gt;login.component.html&lt;/code&gt; like so:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;

&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"wrapper"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;Login&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;

    &lt;span class="nt"&gt;&amp;lt;mat-form-field&lt;/span&gt; &lt;span class="na"&gt;appearance=&lt;/span&gt;&lt;span class="s"&gt;"outline"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;mat-label&amp;gt;&lt;/span&gt;Username&lt;span class="nt"&gt;&amp;lt;/mat-label&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;input&lt;/span&gt; &lt;span class="na"&gt;matInput&lt;/span&gt; &lt;span class="na"&gt;placeholder=&lt;/span&gt;&lt;span class="s"&gt;"x@it-minds.dk"&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"text"&lt;/span&gt; 
            &lt;span class="na"&gt;autocomplete=&lt;/span&gt;&lt;span class="s"&gt;"off"&lt;/span&gt; &lt;span class="na"&gt;[(value)]=&lt;/span&gt;&lt;span class="s"&gt;"username"&lt;/span&gt; &lt;span class="na"&gt;required&lt;/span&gt;&lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/mat-form-field&amp;gt;&lt;/span&gt;

    &lt;span class="nt"&gt;&amp;lt;mat-form-field&lt;/span&gt; &lt;span class="na"&gt;appearance=&lt;/span&gt;&lt;span class="s"&gt;"outline"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;mat-label&amp;gt;&lt;/span&gt;Password&lt;span class="nt"&gt;&amp;lt;/mat-label&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;input&lt;/span&gt; &lt;span class="na"&gt;matInput&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"password"&lt;/span&gt; &lt;span class="na"&gt;[(value)]=&lt;/span&gt;&lt;span class="s"&gt;"password"&lt;/span&gt; &lt;span class="na"&gt;required&lt;/span&gt;&lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/mat-form-field&amp;gt;&lt;/span&gt;

    &lt;span class="nt"&gt;&amp;lt;button&lt;/span&gt; &lt;span class="na"&gt;mat-raised-button&lt;/span&gt; &lt;span class="na"&gt;color=&lt;/span&gt;&lt;span class="s"&gt;"primary"&lt;/span&gt; &lt;span class="na"&gt;(click)=&lt;/span&gt;&lt;span class="s"&gt;"onButtonClick()"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Log in&lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;I also added &lt;code&gt;username&lt;/code&gt; and &lt;code&gt;password&lt;/code&gt; variables to &lt;code&gt;login.component.ts&lt;/code&gt;:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;

&lt;span class="p"&gt;...&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;LoginComponent&lt;/span&gt; &lt;span class="k"&gt;implements&lt;/span&gt; &lt;span class="nx"&gt;OnInit&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="p"&gt;...&lt;/span&gt;
  &lt;span class="nx"&gt;username&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;""&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nx"&gt;password&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;""&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;...&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;And using &lt;a href="https://css-tricks.com/snippets/css/a-guide-to-flexbox/" rel="noopener noreferrer"&gt;flexbox&lt;/a&gt; in &lt;code&gt;login.component.scss&lt;/code&gt; to center our content on the page, as well as put the contents in a column order:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight scss"&gt;&lt;code&gt;

&lt;span class="c1"&gt;// Center content vertically and horizontally:&lt;/span&gt;
&lt;span class="nd"&gt;:host&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;100%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;flex&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;flex-direction&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;column&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;align-items&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;justify-content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;// Display content in a column&lt;/span&gt;
&lt;span class="nc"&gt;.wrapper&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;flex&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;flex-direction&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;column&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nt"&gt;h1&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;// Adjust margin-bottom:&lt;/span&gt;
        &lt;span class="nl"&gt;margin-bottom&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The result can be seen below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fgx9lw19kgi3lz6sufuap.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fgx9lw19kgi3lz6sufuap.gif" alt="login"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As you can see, adding and using new material components is really easy. They look fantastic, and can easily be customized to fit the look and feel of the website you're working on.&lt;/p&gt;

&lt;p&gt;The value that the user enters in Username and Password input fields is available in the &lt;code&gt;username&lt;/code&gt; and &lt;code&gt;password&lt;/code&gt; variables in the component class. But in this blog post we're only focusing on appearance.&lt;/p&gt;

&lt;h2&gt;
  
  
  Enter Angular Material Theming 🎨
&lt;/h2&gt;

&lt;p&gt;Now we know how to import Angular Material modules and use them in our components, but what if we wanted to use values from theming to style our own components, say we wanted the "Login" &lt;code&gt;&amp;lt;h1&amp;gt;&lt;/code&gt; to be the primary color of our theme. Is that possible? Yes! Let's do it:&lt;/p&gt;

&lt;h3&gt;
  
  
  Extracting SCSS values from current theme
&lt;/h3&gt;

&lt;p&gt;In our global styling stylesheet &lt;code&gt;styles.scss&lt;/code&gt; we can add:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight scss"&gt;&lt;code&gt;

&lt;span class="k"&gt;@import&lt;/span&gt; &lt;span class="s1"&gt;'~@angular/material/theming'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nv"&gt;$primary-palette&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;mat-palette&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$mat-indigo&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nc"&gt;...&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;I'm using the &lt;code&gt;$mat-indigo&lt;/code&gt; SCSS variable because I know we're using the default indigo-pink theme.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$mat-indigo&lt;/code&gt; is a SCSS variable containing a color palette we import from Material theming (more on palettes soon).&lt;/p&gt;

&lt;p&gt;&lt;code&gt;mat-palette()&lt;/code&gt; is a SCSS function that we import from Material theming.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;$primary-palette&lt;/code&gt; SCSS variable is now assigned to the color palette of &lt;code&gt;$mat-indigo&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Now we need to extract the primary color (indigo) from our &lt;code&gt;$primary-palette&lt;/code&gt; variable. And we can do that in &lt;code&gt;login.component.scss&lt;/code&gt; like so:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight scss"&gt;&lt;code&gt;

&lt;span class="k"&gt;@import&lt;/span&gt; &lt;span class="s1"&gt;'../../styles.scss'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nt"&gt;h1&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;mat-color&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$primary-palette&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;code&gt;mat-color()&lt;/code&gt; is a SCSS function for extracting colors from palettes, imported from material theming through our &lt;code&gt;styles.scss&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;And look, our "Login" &lt;code&gt;&amp;lt;h1&amp;gt;&lt;/code&gt; is now using the primary color of our theme (indigo):&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fs8size8y3h39q7kvo4iz.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fs8size8y3h39q7kvo4iz.PNG" alt="login-using-theming"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Making our own theme - Enter dark theme 😎
&lt;/h3&gt;

&lt;p&gt;Material design works with color palettes. If we navigate to &lt;code&gt;~@angular/material/theming&lt;/code&gt; (ctrl + left-mouse-click in VS CODE) we enter Angular Material's SCSS styling from where we imported our functions and variables before, and we can see that the &lt;code&gt;$mat-indigo&lt;/code&gt; palette is defined as: &lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight scss"&gt;&lt;code&gt;

&lt;span class="nv"&gt;$mat-indigo&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="m"&gt;50&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="mh"&gt;#e8eaf6&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
  &lt;span class="m"&gt;100&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="mh"&gt;#c5cae9&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
  &lt;span class="m"&gt;200&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="mh"&gt;#9fa8da&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
  &lt;span class="m"&gt;300&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="mh"&gt;#7986cb&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
  &lt;span class="m"&gt;400&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="mh"&gt;#5c6bc0&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
  &lt;span class="m"&gt;500&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="mh"&gt;#3f51b5&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
  &lt;span class="m"&gt;600&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="mh"&gt;#3949ab&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
  &lt;span class="m"&gt;700&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="mh"&gt;#303f9f&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
  &lt;span class="m"&gt;800&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="mh"&gt;#283593&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
  &lt;span class="m"&gt;900&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="mh"&gt;#1a237e&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;A100&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="mh"&gt;#8c9eff&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;A200&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="mh"&gt;#536dfe&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;A400&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="mh"&gt;#3d5afe&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;A700&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="mh"&gt;#304ffe&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;contrast&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="m"&gt;50&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nv"&gt;$dark-primary-text&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
    &lt;span class="m"&gt;100&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nv"&gt;$dark-primary-text&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
    &lt;span class="m"&gt;200&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nv"&gt;$dark-primary-text&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
    &lt;span class="m"&gt;300&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nv"&gt;$light-primary-text&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
    &lt;span class="m"&gt;400&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nv"&gt;$light-primary-text&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
    &lt;span class="m"&gt;500&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nv"&gt;$light-primary-text&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
    &lt;span class="m"&gt;600&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nv"&gt;$light-primary-text&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
    &lt;span class="m"&gt;700&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nv"&gt;$light-primary-text&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
    &lt;span class="m"&gt;800&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nv"&gt;$light-primary-text&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
    &lt;span class="m"&gt;900&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nv"&gt;$light-primary-text&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;A100&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nv"&gt;$dark-primary-text&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;A200&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nv"&gt;$light-primary-text&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;A400&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nv"&gt;$light-primary-text&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;A700&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nv"&gt;$light-primary-text&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;There are many color palettes like it to choose from.&lt;/p&gt;

&lt;p&gt;Say we wanted to create a dark theme for our website, is it hard to change? Well, let's try:&lt;/p&gt;

&lt;p&gt;In our global &lt;code&gt;styles.scss&lt;/code&gt; we add:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight scss"&gt;&lt;code&gt;

&lt;span class="k"&gt;@import&lt;/span&gt; &lt;span class="s1"&gt;'~@angular/material/theming'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// Includes all common styles that are used by multiple Angular Material components&lt;/span&gt;
&lt;span class="k"&gt;@include&lt;/span&gt; &lt;span class="nd"&gt;mat-core&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="c1"&gt;// Define your application's custom theme.&lt;/span&gt;
&lt;span class="nv"&gt;$primary-palette&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;mat-palette&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$mat-teal&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;//Note: Changed from mat-indigo&lt;/span&gt;
&lt;span class="nv"&gt;$accent-palette&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;  &lt;span class="nf"&gt;mat-palette&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$mat-pink&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;A200&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;A100&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;A400&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nv"&gt;$theme&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;mat-dark-theme&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;  
  &lt;span class="nv"&gt;$primary-palette&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
  &lt;span class="nv"&gt;$accent-palette&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;  
&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// Include theme styles for Angular Material components and each component used in your app.&lt;/span&gt;
&lt;span class="k"&gt;@include&lt;/span&gt; &lt;span class="nd"&gt;angular-material-theme&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$theme&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nc"&gt;...&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;And to make the background of our website respond to the dark-theme we also need to add the class &lt;code&gt;mat-app-background&lt;/code&gt; to our &lt;code&gt;&amp;lt;body&amp;gt;&lt;/code&gt; tag in index.html:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;

&lt;span class="nt"&gt;&amp;lt;body&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"mat-typography mat-app-background"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;app-root&amp;gt;&amp;lt;/app-root&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;And voila! Dark theme:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F37aaalrshn6xihacoj2k.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F37aaalrshn6xihacoj2k.gif" alt="dark-theme"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Notice - as we used the primary palette when styling our "Login" &lt;code&gt;&amp;lt;h1&amp;gt;&lt;/code&gt;, it also changed color to teal as we changed from the &lt;code&gt;$mat-indigo&lt;/code&gt; palette to the &lt;code&gt;$mat-teal&lt;/code&gt; palette. That means as long as we "tab into" our theming when styling our components, our components will also update with changes to the theme. Very cool.&lt;/p&gt;

&lt;p&gt;With Angular Material we can even have multiple themes and have the user switch between them - all components (including our own) which uses Material theming (like our &lt;code&gt;&amp;lt;h1&amp;gt;&lt;/code&gt;) will update with the change. The Angular Material documentation have a theme switcher in the top right of the website if you want to see an example of switching between themes.&lt;/p&gt;

&lt;p&gt;Similarly, you are also able to &lt;a href="https://material.angular.io/guide/typography" rel="noopener noreferrer"&gt;customize typography&lt;/a&gt;, or eg. customize the shape of buttons (with eg. css &lt;code&gt;border-radius&lt;/code&gt;) in component styling or globally in &lt;code&gt;styles.scss&lt;/code&gt;. For more information about theme customization, check the &lt;a href="https://material.angular.io/guides" rel="noopener noreferrer"&gt;documentation&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Helpers
&lt;/h2&gt;

&lt;p&gt;In addition to all the components offered by Angular Material, &lt;a href="https://material.angular.io/cdk/categories" rel="noopener noreferrer"&gt;various helpers&lt;/a&gt; are also given such as &lt;a href="https://material.angular.io/cdk/drag-drop/overview" rel="noopener noreferrer"&gt;drag-and-drop&lt;/a&gt;, &lt;a href="https://material.angular.io/cdk/scrolling/overview" rel="noopener noreferrer"&gt;virtual scroll for large lists&lt;/a&gt;, &lt;a href="https://material.angular.io/cdk/platform/overview" rel="noopener noreferrer"&gt;platform information utilities&lt;/a&gt; and more.&lt;/p&gt;

&lt;p&gt;These are easy to use as well, however we will not make an example in this post, but make you aware that they exist.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ffjh8o50yfj6357zj4a3b.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ffjh8o50yfj6357zj4a3b.gif" alt="drag-drop"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Design mockup resources
&lt;/h2&gt;

&lt;p&gt;Another cool thing about Material Design is that they offer &lt;a href="https://material.io/resources" rel="noopener noreferrer"&gt;many resources and tools&lt;/a&gt; such as design kits for various design tools like Adobe XD, Sketch, Figma and others. I happen to like &lt;a href="https://www.adobe.com/products/xd.html" rel="noopener noreferrer"&gt;Adobe XD&lt;/a&gt; which is a user interface design and prototyping tool. &lt;/p&gt;

&lt;p&gt;With the design kit comes components like buttons, input fields and more, and a developer or a UX designer can use the design kit to quickly build user interface mockups for desktop, tablet and phones using the tool.&lt;/p&gt;

&lt;p&gt;With an Adobe XD you can define assets, and use them in your design mockups. Adjusting the assets (such as palette colors) will also change your mockups:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fwbcdu0u47671lwyg13ip.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fwbcdu0u47671lwyg13ip.PNG" alt="materil-design-adobe-xd"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Material Design also offers other resources and tools for theme palette picking, color tools, shapes, animation and much more.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;To summarize, Angular Material is easy to install and setup. It offers a wide variety of customizable components and styling. Using Angular Material theming we can customize colors, typography and shapes of our components. We showed how you can make your own theme light or dark. Making changes to the theme also updates all components using the theme. Additionally, Angular Material offers helpers for many common actions such as re-ordering lists. Material Design also offers resources and tools for designing mockups that utilizes Material Design directly in your favorite design tool such as Adobe XD.&lt;/p&gt;

&lt;h2&gt;
  
  
  Links and resources:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://angular.io/" rel="noopener noreferrer"&gt;The Angular Framework&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://material.angular.io/" rel="noopener noreferrer"&gt;Angular Material&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://material.io/" rel="noopener noreferrer"&gt;The Material Design Specification&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://material.angular.io/components/categories" rel="noopener noreferrer"&gt;Overview of Angar Material components&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://material.io/resources" rel="noopener noreferrer"&gt;Material Design Resources&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://css-tricks.com/snippets/css/a-guide-to-flexbox/" rel="noopener noreferrer"&gt;An awesome guide on CSS FlexBox&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.chartjs.org/" rel="noopener noreferrer"&gt;ChartJS - an awesome framework for making charts&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;If Material Icons aren't enough for you, then take a look at &lt;a href="https://fontawesome.com/" rel="noopener noreferrer"&gt;Font Awesome&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;If Material animations aren't enough for you, then take a look at &lt;a href="https://animejs.com/" rel="noopener noreferrer"&gt;AnimeJS&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>angular</category>
      <category>material</category>
      <category>design</category>
      <category>scss</category>
    </item>
  </channel>
</rss>
