<?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>DEV Community: Christopher Satterthwaite</title>
    <description>The latest articles on DEV Community by Christopher Satterthwaite (@gijinkakun).</description>
    <link>https://dev.to/gijinkakun</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%2F936358%2F58d42090-d672-49c8-a286-384c8d672226.jpeg</url>
      <title>DEV Community: Christopher Satterthwaite</title>
      <link>https://dev.to/gijinkakun</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/gijinkakun"/>
    <language>en</language>
    <item>
      <title>Making a Card Component With BEM</title>
      <dc:creator>Christopher Satterthwaite</dc:creator>
      <pubDate>Tue, 04 Oct 2022 01:48:32 +0000</pubDate>
      <link>https://dev.to/gijinkakun/making-a-card-with-bem-108p</link>
      <guid>https://dev.to/gijinkakun/making-a-card-with-bem-108p</guid>
      <description>&lt;p&gt;In this tutorial, I'll show you how to make a simple card component for your next project using the BEM naming mythology.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is a Card?
&lt;/h2&gt;

&lt;p&gt;One of the most used components on any website I've worked on is the card component. Primarily used to group various pieces of content into a container like blog posts, projects, or even products. &lt;/p&gt;

&lt;h2&gt;
  
  
  Let's Get Started
&lt;/h2&gt;

&lt;p&gt;First, look at what we are building to visualize the code we will write.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--jDhEIyp1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7ezfwyf8zir4v0id6png.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--jDhEIyp1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7ezfwyf8zir4v0id6png.png" alt="Card Example" width="452" height="671"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With the simple example above, we will now identify the parts we will work with to create the HTML markup. I came up with the following, but depending on your design, it can be more complex.&lt;/p&gt;

&lt;h3&gt;
  
  
  Parts of my card;
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Card Body&lt;/li&gt;
&lt;li&gt;Card Image&lt;/li&gt;
&lt;li&gt;Card Title&lt;/li&gt;
&lt;li&gt;Card Subtitle&lt;/li&gt;
&lt;li&gt;Card Excerpt&lt;/li&gt;
&lt;li&gt;Card Action&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Identify The Card Parts
&lt;/h2&gt;

&lt;p&gt;Now that we know the parts of the card, it will be beneficial to determine what parts they are and what they will be called. For this example, I'll be breaking the elements out into layout and components parts. &lt;/p&gt;

&lt;h3&gt;
  
  
  Card Layout BEM Names
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;c-card&lt;/strong&gt;&lt;br&gt;
The wrapper of the whole card. This is usually a &lt;strong&gt;&lt;code&gt;&amp;lt;article&amp;gt;&lt;/code&gt;&lt;/strong&gt; tag for SEO purposes and semantics, but you can also get away with just a &lt;strong&gt;&lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt;&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;c-card__header&lt;/strong&gt;&lt;br&gt;
Contains the Image, Title, or Subtitle. We will use the &lt;strong&gt;&lt;code&gt;&amp;lt;header&amp;gt;&lt;/code&gt;&lt;/strong&gt; tag to ensure everything is semantic and valid.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;c-card__body&lt;/strong&gt;&lt;br&gt;
Contains the Title, Subtitle, or Excerpt. We will use a &lt;strong&gt;&lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt;&lt;/strong&gt; for this part. There is no read HTML element for this use.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;c-card__footer&lt;/strong&gt;&lt;br&gt;
Contains the action button. This will use the &lt;strong&gt;&lt;code&gt;&amp;lt;footer&amp;gt;&lt;/code&gt;&lt;/strong&gt; tag to keep everything nice and semantic with the &lt;strong&gt;&lt;code&gt;&amp;lt;article&amp;gt;&lt;/code&gt;&lt;/strong&gt; specifications.&lt;/p&gt;
&lt;h3&gt;
  
  
  Card Component BEM Names
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;c-card__image&lt;/strong&gt;&lt;br&gt;
I like the image used by the card to make a background image, so it's easier to display.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;c-card__heading&lt;/strong&gt;&lt;br&gt;
Usually wrapped in an &lt;code&gt;**&amp;lt;H2&amp;gt;**&lt;/code&gt; tag for semantics and to stick with the &lt;strong&gt;&lt;/strong&gt; tags spec, the title can also be made a &lt;strong&gt;&lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt;&lt;/strong&gt; or a &lt;strong&gt;&lt;code&gt;&amp;lt;span&amp;gt;&lt;/code&gt;&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;c-card__sub-heading&lt;/strong&gt;&lt;br&gt;
We will use a &lt;strong&gt;&lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt;&lt;/strong&gt; tag. There is no real need for us and heading tags.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;c-card__excerpt&lt;/strong&gt;&lt;br&gt;
The &lt;strong&gt;&lt;code&gt;&amp;lt;p&amp;gt;&lt;/code&gt;&lt;/strong&gt; tag will be used to wrap this part. Again, you can get away with a &lt;strong&gt;&lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt;&lt;/strong&gt; but semantics.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. c-card__action&lt;/strong&gt;&lt;br&gt;
the action will hold our &lt;strong&gt;&lt;code&gt;&amp;lt;button&amp;gt;&lt;/code&gt;&lt;/strong&gt;. We will use a &lt;strong&gt;&lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt;&lt;/strong&gt; tag here.&lt;/p&gt;
&lt;h2&gt;
  
  
  Start Writing The Code
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;let's start by opening up your editor. I'll use &lt;a href="https://visualstudio.microsoft.com/"&gt;Visual Studio Code&lt;/a&gt; for this tutorial.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Create an index.html file and open it up. Let's put the basic coded need for the HTML to render. Place the following code in your index.html;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;!DOCTYPE html&amp;gt;
   &amp;lt;html lang="en-us"&amp;gt;
   &amp;lt;head&amp;gt;
      &amp;lt;meta charset="UTF-8" /&amp;gt;
      &amp;lt;meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" /&amp;gt;
   &amp;lt;/head&amp;gt;
   &amp;lt;body&amp;gt;
   &amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;With the index.html file open, let's add the following code to create the card markup.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;article&amp;gt;
   &amp;lt;header&amp;gt;
      &amp;lt;div&amp;gt;&amp;lt;/div&amp;gt;
      &amp;lt;h2&amp;gt;Card Headline Here&amp;lt;/h2&amp;gt;
      &amp;lt;div&amp;gt;Card Subtitle Here&amp;lt;/div&amp;gt;
   &amp;lt;/header&amp;gt;
   &amp;lt;div&amp;gt;
      &amp;lt;p&amp;gt;Lorem ipsum dolor sit amet, consectetur adipiscing elit,    sed do eiusmod tempor incididunt ut labore...&amp;lt;/p&amp;gt;
   &amp;lt;/div&amp;gt;
   &amp;lt;footer&amp;gt;
      &amp;lt;div&amp;gt;
         &amp;lt;button&amp;gt;Read Full Post&amp;lt;/button&amp;gt;
      &amp;lt;/div&amp;gt;
   &amp;lt;/footer&amp;gt;
&amp;lt;/article&amp;gt;

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Now that we have our markup, it is time to add the BEM class names we came up with earlier.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;article class="c-card"&amp;gt;
   &amp;lt;header class="c-card__header"&amp;gt;
      &amp;lt;div class="c-card__image"&amp;gt;&amp;lt;/div&amp;gt;
      &amp;lt;h2 class="c-card__heading"&amp;gt;Card Headline Here&amp;lt;/h2&amp;gt;
      &amp;lt;div class="c-card__sub-heading"&amp;gt;Card Subtitle Here&amp;lt;/div&amp;gt;
   &amp;lt;/header&amp;gt;
   &amp;lt;div class="c-card__body"&amp;gt;
      &amp;lt;p class="c-card__excerpt"&amp;gt;Lorem ipsum dolor sit amet, consectetur adipiscing elit,    sed do eiusmod tempor incididunt ut labore...&amp;lt;/p&amp;gt;
   &amp;lt;/div&amp;gt;
   &amp;lt;footer class="c-card__footer"&amp;gt;
      &amp;lt;div class="c-card__action"&amp;gt;
         &amp;lt;button class="c-button"&amp;gt;Read Full Post&amp;lt;/button&amp;gt;
      &amp;lt;/div&amp;gt;
   &amp;lt;/footer&amp;gt;
&amp;lt;/article&amp;gt;

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

&lt;/div&gt;



&lt;p&gt;You might note that the button is its own component and not part of the card component. I do this to make my code easy to reuse.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Now that our HTML is marked up and ready to go, it's time for the CSS. I'll just be using plain CSS in this example, but I recommend using SASS as it makes the job much easier.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;To Keep this simple, we will inline the CSS. Between the &lt;strong&gt;&lt;code&gt;&amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;/code&gt;&lt;/strong&gt; tags add the &lt;strong&gt;&lt;code&gt;&amp;lt;style&amp;gt;&amp;lt;/style&amp;gt;&lt;/code&gt;&lt;/strong&gt; tags;&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;!DOCTYPE html&amp;gt;
   &amp;lt;html lang="en-us"&amp;gt;
   &amp;lt;head&amp;gt;
      &amp;lt;meta charset="UTF-8" /&amp;gt;
      &amp;lt;meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" /&amp;gt;

   &amp;lt;style&amp;gt;Inline CSS Will Go Here&amp;lt;/style&amp;gt;

   &amp;lt;/head&amp;gt;
   &amp;lt;body&amp;gt;
   &amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Let's start with the c-card styles. Because we want this to be a component and reusable, the CSS for this layout part is quite simple;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.c-card {
   position: relative;
   width: 100%;
   color: #222222;
   background: #fafafa;
   transition: 0.4s ease-in-out;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's go over what I have. First, I always like to add position relative to my components, so the 0, 0 position is always their top left, not the sites. It makes future edits much more manageable. &lt;/p&gt;

&lt;p&gt;Next, I add 100%. Of course, you don't have to if you use a rest.css, but for me, it is just something standard. &lt;/p&gt;

&lt;p&gt;Now because I want his component to be used without modifiers for colors, I added default ones. &lt;/p&gt;

&lt;p&gt;And finally, we have the transition in case we want to add animation effects to the card later.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Next, let's create the Layout CSS. Below your .c-card styles, add the following code;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.c-card__header {
   position: relative;
   padding: 16px 16px 16px;
}

.c-card__body {
   position: relative;
   padding: 16px 16px 16px;
}

.c-card__footer {
   position: relative;
   padding: 16px 16px 16px;
   border-top: 1px solid #e7e7e7;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The layout parts are what I use to give the card padding. This gives you more flexibility to move them around or not even include them. Again you will note I added position relative just for future flexibility.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Next, let's style the components. Create the following code;
&lt;/li&gt;
&lt;/ol&gt;

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

.c-card__heading {
   margin: 0;
   padding: 0;
   font-size: 28px;
   font-family: "Lato";
   line-height: 1.2;
}

.c-card__sub-heading {
   font-size: 18px;
   font-family: "Lato";
   line-height: 1.2;
}

.c-card__excerpt {
   margin: 0;
   padding: 0;
   font-size: 18px;
   font-family: "Lato";
   line-height: 1.2;
}

.c-card__action {
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;&lt;p&gt;You're going to note the margin and padding set to 0 on the .c-card_&lt;em&gt;heading and .c-card&lt;/em&gt;_excerpt. I like making the line height do the work vs. margin and padding. The other styles for fonts are our defaults and can be overridden by modifiers later.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If you preview your file, you should now have something like &lt;br&gt;
this;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--XkUAR87o--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bg9yk2vebf1scvy0x5us.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--XkUAR87o--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bg9yk2vebf1scvy0x5us.png" alt="Basic Card" width="800" height="214"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Now, let's look at adding the image to the card. I prefer to set the picture as a background image to avoid resizing it and make it easier later on to animate. Let's add the following styles to the image CSS;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.c-card__image {
   margin: 0 0 16px 0;
   background-size: cover;
   background-repeat: no-repeat;
   aspect-ratio: 4 / 3;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You will note I am using the aspect ratio style instead of providing a width or height. Now that this style is fully supported, it gives us a more flexible way to manipulate the image. In addition, the margin is added to provide a bit of extra space.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Next, let's add the image to the HTML. I am going to just use a placeholder image from placeholder.com. Make sure it's a 4:3 ratio. You should end up with the following code;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;article class="c-card"&amp;gt;
   &amp;lt;header class="c-card__header"&amp;gt;
      &amp;lt;div class="c-card__image" style="background-image: url(https://via.placeholder.com/1024x768);"&amp;gt;&amp;lt;/div&amp;gt;
      &amp;lt;h2 class="c-card__heading"&amp;gt;Card Headline Here&amp;lt;/h2&amp;gt;
      &amp;lt;div class="c-card__sub-heading"&amp;gt;Card Subtitle Here&amp;lt;/div&amp;gt;
   &amp;lt;/header&amp;gt;
   &amp;lt;div class="c-card__body"&amp;gt;
      &amp;lt;p class="c-card__excerpt"&amp;gt;Lorem ipsum dolor sit amet, consectetur adipiscing elit,    sed do eiusmod tempor incididunt ut labore...&amp;lt;/p&amp;gt;
   &amp;lt;/div&amp;gt;
   &amp;lt;footer class="c-card__footer"&amp;gt;
      &amp;lt;div class="c-card__action"&amp;gt;
         &amp;lt;button class="c-button"&amp;gt;Read Full Post&amp;lt;/button&amp;gt;
      &amp;lt;/div&amp;gt;
   &amp;lt;/footer&amp;gt;
&amp;lt;/article&amp;gt;

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

&lt;/div&gt;



&lt;p&gt;You Should now have something similar to this when you preview your HTML file.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--qD_n5FUB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pmnlsaa3oghnqqxjembo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--qD_n5FUB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pmnlsaa3oghnqqxjembo.png" alt="Card With Image" width="621" height="733"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;We are almost done with the base card component. We just have one more step left, and that's to add styles to the c-card__action component. For example, add the following code to align the button to the right and center align it.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.c-card__action {
   display: flex;
   justify-content: flex-end;
   align-items: center;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should now have something that looks similar to this;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--eAgHHb6I--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hawfy1sfutdsrwe1w7a9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--eAgHHb6I--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hawfy1sfutdsrwe1w7a9.png" alt="Card With Action Butto" width="617" height="728"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Adding Modifiers
&lt;/h2&gt;

&lt;p&gt;Now that we have our base card ready to go, it's time for us to create some modifiers. Modifiers can be used for many things, such as changing Color, Font sizes, widths, add animations.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;let's start with creating modifiers for rounded corners and drop shadows. Add the following CSS to your index.html file;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.c-card--rounded {
   border-radius:  0.375rem;
}

.c-card--elevation {
   box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.3), 0px 2px 6px 2px rgba(0, 0, 0, 0.15);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We have created 2 modifiers, one for rounded corners and one for the drop shadow. Let's add them to our code. You should end up with something like this;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;article class=""c-card c-card--rounded c-card--elevation""&amp;gt;
   &amp;lt;header class="c-card__header"&amp;gt;
      &amp;lt;div class="c-card__image" style="background-image: url(https://via.placeholder.com/1024x768);"&amp;gt;&amp;lt;/div&amp;gt;
      &amp;lt;h2 class="c-card__heading"&amp;gt;Card Headline Here&amp;lt;/h2&amp;gt;
      &amp;lt;div class="c-card__sub-heading"&amp;gt;Card Subtitle Here&amp;lt;/div&amp;gt;
   &amp;lt;/header&amp;gt;
   &amp;lt;div class="c-card__body"&amp;gt;
      &amp;lt;p class="c-card__excerpt"&amp;gt;Lorem ipsum dolor sit amet, consectetur adipiscing elit,    sed do eiusmod tempor incididunt ut labore...&amp;lt;/p&amp;gt;
   &amp;lt;/div&amp;gt;
   &amp;lt;footer class="c-card__footer"&amp;gt;
      &amp;lt;div class="c-card__action"&amp;gt;
         &amp;lt;button class="c-button"&amp;gt;Read Full Post&amp;lt;/button&amp;gt;
      &amp;lt;/div&amp;gt;
   &amp;lt;/footer&amp;gt;
&amp;lt;/article&amp;gt;

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

&lt;/div&gt;



&lt;p&gt;Let's preview our index.html file. You should have something like this;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--jZe9ZLhX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zkkugk3rf88bp5hc4he6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--jZe9ZLhX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zkkugk3rf88bp5hc4he6.png" alt="Card With Modifiers" width="642" height="760"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That's really it. You can add more modifiers, like making the image full width by adding a negative margin to the image component or adding animation effects to the drop shadow. It's really up to you.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Building components is one of my favorite things to do as a developer, and there are many advantages to this theme style. It's essential to think through how components will be used so you can plan ahead on how to best build a component that can be reused. &lt;/p&gt;

&lt;p&gt;Rushing through building components without understanding where and how a component may be used can lead to duplicating code or redoing your work to accommodate new project requirements.&lt;/p&gt;

&lt;p&gt;If you like to mess around with the code or use the card component, You can download the working file from &lt;a href="https://gist.github.com/gijinkakun/d20e2f2c4f8498eedb6bc12dfa460380"&gt;my gist here&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>css</category>
      <category>html</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
