<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Miles Malerba on Medium]]></title>
        <description><![CDATA[Stories by Miles Malerba on Medium]]></description>
        <link>https://medium.com/@malerba89?source=rss-bef3ef6588b5------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*WgvQqqTBK_oTlTkIo8tsRQ.jpeg</url>
            <title>Stories by Miles Malerba on Medium</title>
            <link>https://medium.com/@malerba89?source=rss-bef3ef6588b5------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 03:50:07 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@malerba89/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Material 3 Experimental Support in Angular 17.2]]></title>
            <link>https://blog.angular.dev/material-3-experimental-support-in-angular-17-2-8e681dde650e?source=rss-bef3ef6588b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/8e681dde650e</guid>
            <category><![CDATA[design-systems]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[material-design]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Miles Malerba]]></dc:creator>
            <pubDate>Thu, 15 Feb 2024 00:23:34 GMT</pubDate>
            <atom:updated>2024-02-15T13:31:31.988Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/960/0*bk7G15E22LSN8QoG" /></figure><p>We’re thrilled to announce that Angular 17.2 features experimental support for Material 3 theming in Angular Material.</p><p>In this blog post we’re updating you on the latest news about this feature and providing a preview of what’s next for Material 3 support.</p><h3>What is Material 3</h3><p>Material 3 is the latest evolution of <a href="https://m3.material.io/">Material Design</a>, Google’s open-source design system. Material 3 for Angular is implemented as an alternate theme, compatible with the same <a href="https://material.angular.io/components/categories">Angular Material components</a> and Sass mixins you use today.</p><p>Material 3 themes are based on design tokens (implemented as CSS custom properties). This allows you to more easily override the theme without increasing CSS selector specificity. It also enables you to granularly override specific properties without the need to target CSS selectors at internal Angular Material elements.</p><h3>Using Material 3 in your application</h3><p>To use Material 3 in your app, create an M3 theme in Sass using matx.define-theme and pass it to the same Angular Material Sass mixins you’re using currently:</p><pre>@use &#39;@angular/material&#39; as mat;<br>@use &#39;@angular/material-experimental&#39; as matx;<br><br>$m3-dark-theme: matx.define-theme((<br>  color: (<br>    theme-type: dark,<br>    primary: matx.$m3-indigo-palette,<br>    tertiary: matx.$m3-blue-palette,<br>  )<br>));<br><br>$m3-light-theme: matx.define-theme((<br>  color: (<br>    primary: matx.$m3-indigo-palette,<br>    tertiary: matx.$m3-blue-palette,<br>    )<br>));<br><br>.dark-theme {<br>  @include mat.all-component-themes($m3-dark-theme);<br>}<br><br>.light-theme {<br>  @include mat.all-component-themes($m3-light-theme);<br>}</pre><p>Because M3 themes are fully based on CSS custom properties, all of the theme, color, typography, and density mixins are guaranteed to only output CSS custom properties with no additional selector specificity. This means you can define the custom properties at the highest level and have them flow down to the components that rely on them. You can override the theme for a section of your app without worrying about selector specificity. For example, both of the following layouts work as expected, regardless of the order `.dark-theme` and `.light-theme` are defined in your Sass.</p><pre>&lt;body class=&quot;light-theme&quot;&gt;<br>  Light theme<br>  &lt;sidenav class=&quot;dark-theme&quot;&gt;With a dark sidenav!&lt;/sidenav&gt;<br>&lt;/body&gt;</pre><pre>&lt;body class=&quot;dark-theme&quot;&gt;<br>  Dark theme<br>  &lt;sidenav class=&quot;light-theme&quot;&gt;With a light sidenav!&lt;/sidenav&gt;<br>&lt;/body&gt;</pre><p>Granular customizations beyond the Sass API are possible by setting the CSS custom properties directly. For example, you may want to emphasize a checkbox that the user should be particularly careful about enabling:</p><pre>&lt;mat-checkbox class=&quot;scary-setting&quot;&gt;Delete my account&lt;/mat-checkbox&gt;</pre><pre>.scary-setting {<br>  // No need to target any internal checkbox selectors! 🎉<br>  - mdc-checkbox-unselected-hover-state-layer-color: red;<br>  - mdc-checkbox-unselected-hover-icon-color: red;<br>}</pre><p>As with the official Sass mixins, these properties flow down to where they’re used, so if you have a whole section of scary checkboxes, you don’t need to apply this class to all of them, you can just apply it to the highest level element where the customizations should apply.</p><pre>&lt;section class=&quot;scary-setting&quot;&gt;<br>  &lt;mat-checkbox&gt;Delete my account&lt;/mat-checkbox&gt;<br>  &lt;mat-checkbox&gt;Also drain my bank account&lt;/mat-checkbox&gt;<br>&lt;/section&gt;</pre><h3>Material 2 support</h3><p>While we’re incredibly excited to introduce Material 3 and can’t wait for you to give it a try, Material 2 themes are still fully supported.</p><p>There are a few differences in how M2 and M3 themes are handled, most notably with respect to component color variants. You can read more about these differences in our <a href="https://material.angular.io/guide/material-3">guide to using Material 3</a>.</p><h3>Get Started Today</h3><p>We are so excited to share this update with all of you in the Angular community. We can’t wait to hear your feedback — leave comments on this post to let us know what you think. You can try this feature today by heading over to our <a href="https://material.angular.io/guide/material-3">guide to Material 3</a>. We’ll continue to work on custom color palette generation, CSS variables for system-level tokens, and polishing the API in order to graduate it to stable.</p><p>Thanks for reading and [END OF TRANSMISSION]</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8e681dde650e" width="1" height="1" alt=""><hr><p><a href="https://blog.angular.dev/material-3-experimental-support-in-angular-17-2-8e681dde650e">Material 3 Experimental Support in Angular 17.2</a> was originally published in <a href="https://blog.angular.dev/">Angular Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Taking Advantage of the Angular Material Datepicker]]></title>
            <link>https://blog.angular.dev/taking-advantage-of-the-angular-material-datepicker-237e80fa14b3?source=rss-bef3ef6588b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/237e80fa14b3</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[material-design]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[angular]]></category>
            <dc:creator><![CDATA[Miles Malerba]]></dc:creator>
            <pubDate>Fri, 11 Aug 2017 15:19:58 GMT</pubDate>
            <atom:updated>2017-08-11T15:19:58.967Z</atom:updated>
            <content:encoded><![CDATA[<p>The datepicker is one of the newest components in Angular Material (added in May 2017). Our goal in creating the Angular Material datepicker is to create a datepicker that adheres to Material Design principles and is flexible enough to work across different applications and in different locales. The datepicker is still a relatively new component and there is plenty more work to be done, but we believe that the current design is a solid foundation to build on.</p><h3>Overview</h3><p>The datepicker consists of three main parts.</p><ol><li>The input</li><li>The popup trigger</li><li>The calendar popup</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/440/0*Nu5RJ8x0vUkvFTr2." /></figure><p>This is reflected in the API:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/42843df68f3d0ca0d638349a3188eee3/href">https://medium.com/media/42843df68f3d0ca0d638349a3188eee3/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0bff30bef3fede6ed635f69b64ce3393/href">https://medium.com/media/0bff30bef3fede6ed635f69b64ce3393/href</a></iframe><p>The md-datepicker component is the core of the datepicker, we then connect an Input to it using the [mdDatepicker] directive. The md-datepicker-toggleis completely optional. It’s an easy way to create a md-icon-button and automatically hook it up to the datepicker, but you can always create a custom toggle by connecting the (click) event on any element to call picker.toggle().</p><p>The datepicker input supports the usual min, max, and required attributes to add validation as well as an additional mdDatepickerFilter attribute which allows for finer grained control of what’s considered a valid date. Adding validation to the input also automatically disabled invalid dates on the calendar.</p><p>The md-datepicker element has a startDate attribute to set the date the calendar starts at and a startView attribute that can be used to set the initial calendar view to either month or year mode.</p><p>To improve usability on mobile devices where screen real estate is limited there is a boolean attribute, touchUi, that can be used to enable or disable a touch UI mode. Currently the only difference is that the touch UI mode opens in a fullscreen dialog whereas the normal mode opens in a popup attached to the input. In the future we expect these UIs to diverge further as we continue to optimize each mode for its respective use case. Rather than prescribing what counts as a touch device, the datepicker leaves this decision up the developer. We recommend setting up a dynamic binding: [touchUi]=&quot;isTouch&quot;.</p><h3>i18n</h3><p>One of the <a href="https://www.youtube.com/watch?v=-5wpm-gesOY">most challenging</a> aspects of designing a datepicker is making sure that it works in all locales. This is difficult because different locales may have different date formats, calendar conventions (e.g. which day is the first day of the week), or even completely different calendars.</p><p>Because of the differences in date format across locales, even choosing a date representation is difficult. The native JavaScript Date object offers very limited parsing capabilities. For example, regardless of your locale, 1/2/2017 will always be parsed as January 2nd, 2017, even though in many locales it actually means February 1st, 2017.</p><p>Because of these limitations we can’t always rely on the native Date object. Maintaining our own date parsing and formatting logic is outside the scope of Angular Material. At the same time we don’t want to introduce a dependency on a third party date library, this could bloat people’s apps, and they may already have a date solution they’re happy with.</p><h3>The DateAdapter</h3><p>Our solution to this problem was to allow developers to choose the date representation that works best for them. We accomplished this by removing all knowledge of how dates actually work from the datepicker and moving it instead into a DateAdapter class. DateAdapter is an abstract class that requires a concrete subclass to actually fill in the details of to work with dates. Angular Material includes one such subclass NativeDateAdapter. By providing the NativeDateAdapter as the application’s DateAdapter the datepicker can be made to work with the native JavaScript Date. However this means that your application will have the date parsing limitations discussed above. If your application needs to work with locales other than en-US, we recommend creating your own adapter instead, by extending either DateAdapter or NativeDateAdapter.</p><p>One of the coolest things about the DateAdapter design is that it allows the entire datepicker to be generic and work with any kind of date object you like. For example, say you’re already using <a href="https://momentjs.com/">Moment.js</a> throughout your app, you can create a MomentDateAdapter:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d07045133889f8e1a15e3665fbdded45/href">https://medium.com/media/d07045133889f8e1a15e3665fbdded45/href</a></iframe><p>Specify the formats to use for various pieces of the datepicker (e.g. the month header that normally says something like “Jul 2017” and the parsing format for the input):</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/892c45e283816760f34053ea069da34e/href">https://medium.com/media/892c45e283816760f34053ea069da34e/href</a></iframe><p>And finally provide both of these things in your application module:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d13266436c260eca54993a5b2e177855/href">https://medium.com/media/d13266436c260eca54993a5b2e177855/href</a></iframe><p>Now when you go to use the datepicker, instead of passing it Date objects you just directly pass it Moment objects:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/61b8a80e88522d02ac61658cd4e4930d/href">https://medium.com/media/61b8a80e88522d02ac61658cd4e4930d/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/bbdf6acbb495c4744670b98f51e887f0/href">https://medium.com/media/bbdf6acbb495c4744670b98f51e887f0/href</a></iframe><h3>Future work</h3><p>As the datepicker has only just been released there are still a number of features we want to add:</p><ul><li>Additional pre-made date adapters for libraries like Moment.js, date-fns <a href="https://github.com/angular/material2/issues/5972">#5972</a></li><li>Infinite scrolling through months/years <a href="https://github.com/angular/material2/issues/5973">#5973</a></li><li>Ability to select a month rather than a specific date <a href="https://github.com/angular/material2/issues/4853">#4853</a></li><li>Ability to select a date &amp; time <a href="https://github.com/angular/material2/issues/5648">#5648</a></li><li>Ability to select a range of dates <a href="https://github.com/angular/material2/issues/4763">#4763</a></li><li>Support for non-Gregorian calendars <a href="https://github.com/angular/material2/issues/2519">#2519</a></li><li>General UX enhancements <a href="https://github.com/angular/material2/issues/5974">#5974</a></li></ul><h3>Conclusion</h3><p>To try it out, go grab the latest version of Angular Material from <a href="https://www.npmjs.com/package/@angular/material">npm</a> and check out the <a href="https://material.angular.io/components/datepicker/overview">datepicker documentation</a>. The quickest way to get up and running is to import the MdNativeDateModule in your app’s root module. This will allow the datepicker to work with native Date objects, but beware the MdNativeDateModule doesn’t support input formats other than mm/dd/yyyy. If you want it to work in locales that use other formats you’ll probably want to write your own DateAdapter or wait for the official <a href="https://momentjs.com/">Moment.js</a> or <a href="https://date-fns.org/">date-fns</a> DateAdapters. We also have plans to significantly improve the native date experience using Angular’s upcoming new i18n API (<a href="https://github.com/angular/material2/issues/6030">#6030</a>).</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=237e80fa14b3" width="1" height="1" alt=""><hr><p><a href="https://blog.angular.dev/taking-advantage-of-the-angular-material-datepicker-237e80fa14b3">Taking Advantage of the Angular Material Datepicker</a> was originally published in <a href="https://blog.angular.dev/">Angular Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>