<?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: Angela Damaso</title>
    <description>The latest articles on Forem by Angela Damaso (@adamaso).</description>
    <link>https://forem.com/adamaso</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%2F6808%2F959cf248-40e0-43e3-b239-a86708197936.jpg</url>
      <title>Forem: Angela Damaso</title>
      <link>https://forem.com/adamaso</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/adamaso"/>
    <language>en</language>
    <item>
      <title>Angular 6: Dynamic Themes Without a Library</title>
      <dc:creator>Angela Damaso</dc:creator>
      <pubDate>Sat, 02 Jun 2018 20:41:28 +0000</pubDate>
      <link>https://forem.com/adamaso/angular-6-dynamic-themes-without-a-library-2e9c</link>
      <guid>https://forem.com/adamaso/angular-6-dynamic-themes-without-a-library-2e9c</guid>
      <description>&lt;p&gt;The concept of theming has been around as long as I can remember. Giving users the ability to choose the look and feel of your product has incredible value — it creates a more localized experience and reduces developer maintenance time.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy3sdpv8u6vfvpy4f3k6z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy3sdpv8u6vfvpy4f3k6z.png" alt="tumblr" width="590" height="575"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;How can we create something like this in our Angular apps?&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Sass Alone Won’t Work
&lt;/h2&gt;

&lt;p&gt;Although Sass variables may work to create a preset themed experience, the biggest drawback is that it can’t be manipulated by JavaScript. We need JavaScript to dynamically change the value of our variable!&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Material Alone Won’t Work
&lt;/h2&gt;

&lt;p&gt;Ever since Angular Material was released, developers have been flocking to this library to utilize their reusable components (not to mention built-in accessibility)&lt;/p&gt;

&lt;p&gt;Material comes with built-in theming, but this may not work for two reasons:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;By default, Material comes with it’s own color palette that is optimized for accessibility. If you want to generate more colors, you’ll need to pass it into their mat-palette mixin or create a new theme file, using 3rd party tooling. This creates an external dependency and restricts the ability to switch themes without touching code.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Although it is a great option, not everyone wants to use Material! Many developers do not wish to import an entire library to utilize components and opt to create their own.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;The solution? Sass + CSS Variables!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you have never used native CSS Custom Properties (I call them variables), there is a great article (here) to help you get started. The reason this approach works is because CSS variables can manipulated by JavaScript! With this combination, you can use a form to pass CSS variables to a Sass map, which can be used throughout the app.&lt;/p&gt;

&lt;h2&gt;
  
  
  Let’s See It!
&lt;/h2&gt;

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

&lt;p&gt;&lt;strong&gt;This implementation:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Does not use any external libraries&lt;/li&gt;
&lt;li&gt;Allows multiple components to dynamically change styles through a form&lt;/li&gt;
&lt;li&gt;Saves the form as an object that can be saved in a database or local store&lt;/li&gt;
&lt;li&gt;Has the capability to load an external object as a preloaded or preset style&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Link to Demo: &lt;a href="https://native-theming-form-medium.stackblitz.io/" rel="noopener noreferrer"&gt;https://native-theming-form-medium.stackblitz.io/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Link to Stackblitz: &lt;a href="https://stackblitz.com/edit/native-theming-form-medium" rel="noopener noreferrer"&gt;https://stackblitz.com/edit/native-theming-form-medium&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The Magic
&lt;/h2&gt;

&lt;p&gt;The core principle behind this method is combining Sass maps and CSS Variables.&lt;/p&gt;

&lt;p&gt;In thetheme.scss file, the default values are set and passed into a Sass map&lt;/p&gt;

&lt;p&gt;theme.scss&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// default colors
.theme-wrapper {
    --cardColor: #CCC;
    --cardBackground: #FFF;
    --buttonColor: #FFF;
    --buttonBackground: #FFF;
    --navColor: #FFF;
    --navBackground: #FFF;
    --footerColor: #FFF;
    --footerBackground: #FFF;
    --footerAlignment: left;
}
// pass variables into a sass map
$variables: (
    --cardColor: var(--cardColor),
    --cardBackground: var(--cardBackground),
    --buttonColor: var(--buttonColor),
    --buttonBackground: var(--buttonBackground),
    --navColor: var(--navColor),
    --navBackground: var(--navBackground),
    --footerColor: var(--footerColor),
    --footerBackground: var(--footerBackground),
    --footerAlignment: var(--footerAlignment)
);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A function is created to return the native css variable from the global sass map&lt;/p&gt;

&lt;p&gt;function.scss&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@function var($variable) {
    @return map-get($variables, $variable);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The components can now read these two files to host a dynamic variable that changes upon form resubmit&lt;/p&gt;

&lt;p&gt;card.component.scss&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@import '../../theme';
@import '../../functions';
.card {
    background-color: var(--cardBackground);
    color: var(--cardColor);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The card’s background color is now #FFFFFF and text color is #CCCCCC&lt;/p&gt;

&lt;p&gt;But how do we change the values?&lt;/p&gt;

&lt;p&gt;Through the theme-picker component!&lt;/p&gt;

&lt;p&gt;In our theme-picker.component.html file, we are using template forms with ngModel to create an object with a unique key (style) and value (input). The object then gets passed to the TypeScript file which dynamically overwrites the variable.&lt;/p&gt;

&lt;p&gt;theme-picker.component.ts&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// searching the entire page for css variables
private themeWrapper = document.querySelector('body');
onSubmit(form) {
    this.globalOverride(form.value);
}
globalOverride(stylesheet) {
    if (stylesheet.globalNavColor) {
        this.themeWrapper.style.setProperty('--navColor',     stylesheet.globalNavColor);
    }
...
    if (stylesheet.globalButtonColor) {
        this.themeWrapper.style.setProperty('--buttonColor',     stylesheet.globalButtonColor);
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The globalOverride function checks to see if a value exists for that specific variable, then replaces each CSS Variable with the new inputted one.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Violá!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This code can be better optimized to scale (using preset style objects, saving/publishing styles on submit), so feel free to play around with it!&lt;/p&gt;

</description>
      <category>angular</category>
      <category>theme</category>
      <category>native</category>
    </item>
    <item>
      <title>Why You Should Give a S*** About Accessibility</title>
      <dc:creator>Angela Damaso</dc:creator>
      <pubDate>Wed, 31 Jan 2018 18:51:52 +0000</pubDate>
      <link>https://forem.com/adamaso/why-you-should-give-a-s-about-accessibility-l3e</link>
      <guid>https://forem.com/adamaso/why-you-should-give-a-s-about-accessibility-l3e</guid>
      <description>&lt;h2&gt;
  
  
  57,000,000 Americans have a disability.
&lt;/h2&gt;

&lt;p&gt;According to a 2012 Census report, 56.7 million Americans have some form of disability. As developers and designers, it is our responsibility to create websites and applications that cater to everyone. It is also our social responsibility to make the web accessible to more than just 80% of the population and to educate the public (especially other engineers and designers) about these issues.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Consider impairments that impact accessibility of online websites, applications, and documents. This survey estimates the number of people with specific impairments as follows:&lt;br&gt;
19.9 million (8.2%) have difficulty lifting or grasping. This could, for example impact their use of a mouse or keyboard.&lt;br&gt;
5.2 million (6.3%) have a cognitive, mental, or emotional impairment.&lt;br&gt;
8.1 million (3.3%) have a vision impairment. These people might rely on a screen magnifier or a screen reader, or might have a form of color blindness.&lt;br&gt;
7.6 million (3.1%) have a hearing impairment. They might rely on transcripts and / or captions for audio and video media &lt;a href="https://www.disabled-world.com/disability/accessibility/websitedesign/" rel="noopener noreferrer"&gt;(source)&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  How Accessibility Impacts Business
&lt;/h2&gt;

&lt;p&gt;Ignoring accessibility can create a loss in potential profit each year. Imagine something as small as text color choice alienating half of your potential customers. Even age-related conditions such as presbyopia (loss of the eyes’ ability to focus) hinders the capability to read small text or see colors with low-contrast.&lt;/p&gt;

&lt;p&gt;Top companies such as &lt;a href="https://www.w3.org/WAI/bcase/target-case-study" rel="noopener noreferrer"&gt;Target&lt;/a&gt;, &lt;a href="http://dignifiedflyingfordisabled.blogspot.com/2012/04/jetblue-airways-fined-for-inaccessible.html" rel="noopener noreferrer"&gt;JetBlue&lt;/a&gt;, and &lt;a href="http://www.forbes.com/sites/ericgoldman/2015/03/26/scribd-must-comply-with-the-americans-with-disabilities-act/" rel="noopener noreferrer"&gt;Scribd&lt;/a&gt; have been fined/sued over inaccessibility.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“The case, brought by the California Council of the Blind and three blind JetBlue customers, is about access barriers on JetBlue’s website and the inaccessibility of JetBlue’s airport check-in kiosks to people with visual impairments. JetBlue has designed its website in a way that prevents blind customers from independently and privately accessing information and using the site’s features. JetBlue’s airport kiosks cannot be used by blind customers because the machines do not have audio output or an accessible means to input information.” (source)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  The NFL Color Rush
&lt;/h3&gt;

&lt;p&gt;Another example of accessibility negligence is the 2015 NFL Color Rush campaign. To celebrate the league’s 50th anniversary of the first-ever TV game shown in color, the Bills were wearing all-red and the Jets were wearing all-green. Ironically, the NFL failed to account for the &lt;a href="http://www.forbes.com/sites/ericgoldman/2015/03/26/scribd-must-comply-with-the-americans-with-disabilities-act/" rel="noopener noreferrer"&gt;8% of men who are red/green color-blind&lt;/a&gt;.&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%2Fcdn-images-1.medium.com%2Fmax%2F1600%2F1%2Ac5tt25Dr6_XJvFgvnDAy6g.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%2Fcdn-images-1.medium.com%2Fmax%2F1600%2F1%2Ac5tt25Dr6_XJvFgvnDAy6g.png" title="What red/green color-blind fans saw on their TV." alt="NFL color rush image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Afterward, the NFL released a &lt;a href="http://www.cbssports.com/nfl/news/nfl-we-didnt-account-for-color-blindness-with-color-rush-jerseys/" rel="noopener noreferrer"&gt;statement&lt;/a&gt; claiming they “did test the jerseys this summer on field and on television. The standard television test did not account for color blindness for fans at home, that became apparent.”&lt;/p&gt;

&lt;p&gt;Hopefully, this instance highlights the importance of color choice and awareness of inclusive design.&lt;/p&gt;

&lt;h2&gt;
  
  
  What We Can Do About It
&lt;/h2&gt;

&lt;p&gt;Use the Web Content Accessibility Guidelines Checklist (WCAG)&lt;br&gt;
Use this for accessibility compliance — WCAG 2.0 is the current inclusive web standard. WCAG applies to all web content, including single page and dynamic web applications, multimedia, and mobile websites.&lt;/p&gt;

&lt;h3&gt;
  
  
  Use those tools!
&lt;/h3&gt;

&lt;p&gt;There are a variety of websites and browser plugins to help you check for accessibility.&lt;/p&gt;

&lt;p&gt;My favorites are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Chrome Developer Accessibility Tools&lt;/li&gt;
&lt;li&gt;WAVE (Web Accessibility Evaluation Tool)&lt;/li&gt;
&lt;li&gt;ChromeVox Screen Reader&lt;/li&gt;
&lt;li&gt;SEE Chrome Plugin&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  10 General Design &amp;amp; Development Considerations
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Use headings (h1, h2) properly&lt;/li&gt;
&lt;li&gt;Use ARIA landmarks (marking sections of a web page)&lt;/li&gt;
&lt;li&gt;Add labels to form fields&lt;/li&gt;
&lt;li&gt;Keep color contrast in mind&lt;/li&gt;
&lt;li&gt;Use live text, not pictures of text (this also helps with SEO!)&lt;/li&gt;
&lt;li&gt;Provide video descriptions and use closed captioning&lt;/li&gt;
&lt;li&gt;Choose dropdown menu that works for all users (someone may be unable to trigger or access a submenu)&lt;/li&gt;
&lt;li&gt;Test websites without a keyboard (many people don’t have a mouse)&lt;/li&gt;
&lt;li&gt;Test sites with assistive technologies on mobile and desktop&lt;/li&gt;
&lt;li&gt;Add proper alt-text to images &lt;a href="http://webaim.org/techniques/alttext/" rel="noopener noreferrer"&gt;(great article about alt-text)&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Accessibility is the new standard of web development and we must not fall behind.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>a11y</category>
      <category>javascript</category>
      <category>frontend</category>
    </item>
    <item>
      <title>Friends with BEM-efits</title>
      <dc:creator>Angela Damaso</dc:creator>
      <pubDate>Tue, 30 Jan 2018 19:10:08 +0000</pubDate>
      <link>https://forem.com/adamaso/friends-with-bem-efits-4ehp</link>
      <guid>https://forem.com/adamaso/friends-with-bem-efits-4ehp</guid>
      <description>&lt;h2&gt;
  
  
  An Introduction to BEM
&lt;/h2&gt;

&lt;h3&gt;
  
  
  What is BEM?
&lt;/h3&gt;

&lt;p&gt;The &lt;strong&gt;Block&lt;/strong&gt;, &lt;strong&gt;Element&lt;/strong&gt;, and &lt;strong&gt;Modifier&lt;/strong&gt; (BEM) methodology is a common naming convention for CSS classes developed by &lt;a href="https://en.bem.info/"&gt;Yandex&lt;/a&gt;. The core idea behind BEM is to provide a strict way to arrange your CSS classes into modules. BEM captures the purpose and meaning through it's CSS class name syntax:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Block&lt;/strong&gt;: Represents a module or context where the element finds itself. (&lt;em&gt;"&lt;strong&gt;What&lt;/strong&gt; is it?"&lt;/em&gt;)

&lt;ul&gt;
&lt;li&gt;navigation&lt;/li&gt;
&lt;li&gt;footer&lt;/li&gt;
&lt;li&gt;item-review&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Element&lt;/strong&gt;: Describes a component within the block that performs a particular function. (&lt;em&gt;"What does this &lt;strong&gt;do/show&lt;/strong&gt;?"&lt;/em&gt;)

&lt;ul&gt;
&lt;li&gt;item&lt;/li&gt;
&lt;li&gt;link&lt;/li&gt;
&lt;li&gt;button&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Modifier&lt;/strong&gt;: Defines the appearance, state, or behavior of a block or element. (&lt;em&gt;"What &lt;strong&gt;state&lt;/strong&gt; is it in?"&lt;/em&gt;)

&lt;ul&gt;
&lt;li&gt;active&lt;/li&gt;
&lt;li&gt;red&lt;/li&gt;
&lt;li&gt;large&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We represent this syntax with two underscores for elements and two dashes for modifiers:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.navigation__item--active
.footer__link--red
.item-review__button--large
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  An Analogy
&lt;/h3&gt;

&lt;p&gt;To grasp a further understanding of how these are all related, think of it like an analogy.&lt;/p&gt;

&lt;h4&gt;
  
  
  Hierachy
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Car
|-- Transmission
|   -- Automatic
|   -- Manual

Person
|-- Female
|   -- Lips
|-- Male
|   -- Beard
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  CSS
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.car {}
.car__transmission {}
.car__transmission--automatic {}
.car__transmission--manual {}

.person {}
.person--male__beard {}
.person--female__lips {}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's say we want to display different classes to describe a car's transmission. The &lt;strong&gt;block&lt;/strong&gt; or module would be the &lt;code&gt;Car&lt;/code&gt;. The &lt;strong&gt;element&lt;/strong&gt; we are showing is a &lt;code&gt;Transmission&lt;/code&gt;, and is &lt;strong&gt;modified&lt;/strong&gt; or described by &lt;code&gt;Automatic&lt;/code&gt; and &lt;code&gt;Manual&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;In our second example, we see that the modifier is coming before the element!!&lt;/p&gt;

&lt;p&gt;If you look at our tree hierarchy, this approach makes more sense. In this example, a &lt;code&gt;Person&lt;/code&gt; is being divided into a &lt;code&gt;Female&lt;/code&gt; and &lt;code&gt;Male&lt;/code&gt; class. Each modifier will have elements of its own, such as &lt;code&gt;Lips&lt;/code&gt; or &lt;code&gt;Beard&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Remember to be thoughtful and tasteful when creating your naming hierarchies. Nobody want's to read &lt;code&gt;.person--female__arm__hand--left__finger--pinky&lt;/code&gt; and can easily clutter up your markup. If that level of specificity is needed, try breaking it down into submodules for easier readability and organization.&lt;/p&gt;

&lt;h3&gt;
  
  
  Sass + BEM = &amp;lt;3
&lt;/h3&gt;

&lt;p&gt;In a Sass file, one way to structure your classes is through nesting.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.block {
    &amp;amp;__element {
        &amp;amp;--modifier { 
        }
    }
    &amp;amp;--modifier {
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;which would print out to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.block__element {}
.block__element--modifier {}
.block--modifier[]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The great thing about this architecture is potential to handle scalability. Code is grouped modularly and describes its purpose and state. Let's take a look at an example:&lt;/p&gt;

&lt;h4&gt;
  
  
  HTML
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;ul class="tabs"&amp;gt;
    &amp;lt;li class="tabs__header--active"&amp;gt;
        &amp;lt;img class="tabs__content__image" src=""&amp;gt;
    &amp;lt;/li&amp;gt;
    &amp;lt;li class="tabs__header"&amp;gt;
        &amp;lt;img class="tabs__image" src="#"&amp;gt;
        &amp;lt;img class="tabs__image--inverse" src="#"&amp;gt;
    &amp;lt;/li&amp;gt;
&amp;lt;/ul&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Sass
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.tabs {
    &amp;amp;__header {
        &amp;amp;--active {
        }    
    }
    &amp;amp;__image {
        &amp;amp;--inverse {
        }
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Outputted CSS
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.tabs {

}
.tabs__header {

}
.tabs__header--active {

}
.tabs {

}
.tabs__image {

}
.tabs__image--inverse {

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

&lt;/div&gt;



&lt;p&gt;Pretty cool! As applications grow, this nested structure makes class names easier to read and removes the guesswork when other developers read your code.&lt;/p&gt;

&lt;p&gt;Just remember: &lt;em&gt;&lt;strong&gt;Try not to nest your Sass more than &lt;a href="https://www.sitepoint.com/sass-basics-nesting/"&gt;three levels deep&lt;/a&gt;!!&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  So...Why BEM?
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Self-documenting CSS! It displays the hierarchy between different nodes' relationships in the DOM.&lt;/li&gt;
&lt;li&gt;Strict class naming promotes encapsulation and reduce naming collisions or using classes outside a given context.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developers.google.com/web/fundamentals/performance/rendering/reduce-the-scope-and-complexity-of-style-calculations#use_block_element_modifier"&gt;Performance benefits!&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Tells other developers more about what a piece of markup is doing from its name alone.&lt;/li&gt;
&lt;li&gt;Removes the need for &lt;a href="https://css-tricks.com/efficiently-rendering-css/#article-header-id-3"&gt;descendant selectors&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Component styles are decoupled and highly portable from project to project. In practice, this means an improvement in code quality and development speed!&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In short, BEM will make you push yourself to pay attention to detail, think things through and thus raise the quality of your code :)&lt;/p&gt;

</description>
      <category>css</category>
      <category>sass</category>
      <category>architecture</category>
      <category>bem</category>
    </item>
  </channel>
</rss>
