<?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: Alec Wertheimer</title>
    <description>The latest articles on DEV Community by Alec Wertheimer (@ajwerth).</description>
    <link>https://dev.to/ajwerth</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%2F110822%2Fd1859ae6-ad3f-4c0e-9d15-a20e52dfbf21.png</url>
      <title>DEV Community: Alec Wertheimer</title>
      <link>https://dev.to/ajwerth</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ajwerth"/>
    <language>en</language>
    <item>
      <title>Very Basic - Redux</title>
      <dc:creator>Alec Wertheimer</dc:creator>
      <pubDate>Tue, 06 May 2025 00:07:50 +0000</pubDate>
      <link>https://dev.to/ajwerth/very-basic-redux-3bkn</link>
      <guid>https://dev.to/ajwerth/very-basic-redux-3bkn</guid>
      <description>&lt;p&gt;Learning Redux is a real pain in the @#$#$^&amp;amp;. Good thing the team I was on at the time I learned it highly valued taking the time to learn, because it took me a good 30 out of 40 hours of a work week to figure out what the eff was going on. &lt;/p&gt;

&lt;p&gt;Once I finally did learn it however, I realized that the majority of what slowed me down in the learning process was that I couldn’t find a great explanation of exactly what Redux was doing. All I could find were tutorials on how to use it, and not really very much info on how it worked. &lt;/p&gt;

&lt;p&gt;I’m going to try to solve that issue with this post. I’m also going to assume that you know how to use React, and that you know what Redux is and why you want to learn it. I’m also only covering the very basics of Redux and what you need to know to be able to hopefully speed up the process of really learning it. &lt;/p&gt;

&lt;p&gt;&lt;em&gt;If you need more in depth information check out the documentation. &lt;a href="https://redux.js.org/" rel="noopener noreferrer"&gt;https://redux.js.org/&lt;/a&gt; It's actually pretty great.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Boilerplate Code
&lt;/h2&gt;

&lt;p&gt;Before we get into the nitty gritty of Redux, I want to explain one thing that really confused me when I first started using it. Redux uses A LOT of boilerplate code. So much so that it seems kind of unnecessary or over engineered, and that is not entirely false. When choosing to use Redux you need to weigh whether or not the amount of boilerplate code and the intricacies it introduces are worth it for what you are building. With the introduction of Hooks there are even less cases where Redux is necessary now. The goal of this post is to help you understand how Redux works, but hopefully by doing so it will also help you decide when and when not to choose Redux.&lt;/p&gt;

&lt;h2&gt;
  
  
  Parts of Redux
&lt;/h2&gt;

&lt;p&gt;There are three main parts to Redux, the Store, the Reducer Function, and the Actions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Store
&lt;/h2&gt;

&lt;p&gt;The main goal of Redux is to move where state is stored from inside the application and components, to a separate object. So instead of creating a top level component to hold all the state, or just keeping it in the components themselves, Redux creates an external state object that can be accessed by all components in your app. This extracted state object is called the Store.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reducer
&lt;/h2&gt;

&lt;p&gt;The Store is the object that gets created when the app is running in dev mode or when it’s been built. But the thing that actually updates the store is the Reducer Function. The Reducer is just a large Switch Statement where all the cases make updates to the Store. So it receives an argument, executes the correct case, and updates the store.&lt;/p&gt;

&lt;h2&gt;
  
  
  Actions
&lt;/h2&gt;

&lt;p&gt;The arguments that get passed to the Reducer come from the Actions. The Actions are the part of Redux that interact with the front end of the code. They’re basically just normal functions. They get called under certain circumstances in your components, then pass an argument to the Reducer and ask it to update the store. Then when the Store gets updated it changes the state of your app.&lt;/p&gt;

&lt;p&gt;That’s pretty much all there is to it. Here’s a visual to help. As you can see Redux adheres to the unidirectional data flow model that React is known for. &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%2Fwww.alecwertheimer.com%2Fblog_imgs%2Fredux-structure.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%2Fwww.alecwertheimer.com%2Fblog_imgs%2Fredux-structure.png" alt="Image description" width="800" height="592"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Wrap up
&lt;/h2&gt;

&lt;p&gt;That’s it! That’s basically all that redux is, it gets a little more complicated once you start implementing because of all the code that is needed to get it to actually work. I have been looking into a nifty tool called Redux-Toolkit. Which is a tool that makes it faster and easier to set up Redux state management. I will be posting a blog soon about how Redux-Toolkit works and how you can add it to your application!&lt;/p&gt;

</description>
      <category>redux</category>
      <category>javascript</category>
      <category>react</category>
      <category>vue</category>
    </item>
    <item>
      <title>Basic FlexBox</title>
      <dc:creator>Alec Wertheimer</dc:creator>
      <pubDate>Wed, 02 Oct 2024 17:40:24 +0000</pubDate>
      <link>https://dev.to/ajwerth/basic-flexbox-4738</link>
      <guid>https://dev.to/ajwerth/basic-flexbox-4738</guid>
      <description>&lt;p&gt;This is a quick overview of basics and fundamentals. I'm assuming that you know the basics of CSS and what FlexBox is and why you want to use it. I’m only going over the basic properties and values, I have narrowed it down to the handful that I use most on a daily basis. This should however be enough for you to accomplish the majority of what you’re trying to accomplish with FlexBox. &lt;/p&gt;

&lt;p&gt;There is more to FlexBox than what I’m going to cover in this post. If you’re not sure what FlexBox is or want to take a deeper dive into all of the properties that are available to you, check out &lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_flexible_box_layout/Basic_concepts_of_flexbox" rel="noopener noreferrer"&gt;MDN&lt;/a&gt;, they have a great overview of the flex module.&lt;/p&gt;

&lt;h2&gt;
  
  
  Main Pieces
&lt;/h2&gt;

&lt;p&gt;There are two main pieces to an element that is using flexbox. The flex container or the parent, and the flex items, or the children inside the flex container. That’s all, seem’s simple right? Honestly it is, that’s the beauty of it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Container and Flex Model
&lt;/h2&gt;

&lt;p&gt;So to be able to use flexbox the first thing we need to do is create a “flex container” to do this we’ll create a div and give it the styling “display: flex;”. This converts our default div into a flex container, and enables the flex model inside. You can turn almost any HTML element into a flex container, it doesn’t have to be a div.&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;div class="flexContainer"&amp;gt;&amp;lt;/div&amp;gt;

.flexContainer:{
    display: flex;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So what’s actually happened to the div now that we’ve converted it to a flex container? &lt;/p&gt;

&lt;p&gt;Well first of all, the element itself is converted into a block level element. So as far as how it interacts with the rest of the elements on the page, it's as if you’ve enabled “display: block”. &lt;/p&gt;

&lt;p&gt;That's pretty standard behavior, the more important thing is that once the element is defined as a flex container, two axes are enabled inside the container itself. The Main Axis, and the Cross Axis. These axes are what is used to actually arrange your child elements inside of the flex container.&lt;/p&gt;

&lt;p&gt;The main axis is the axis that determines which direction the flex items will be displayed. Hence the name &lt;strong&gt;MAIN&lt;/strong&gt; axis.&lt;/p&gt;

&lt;p&gt;The cross axis runs perpendicular to the main axis, hence the name &lt;strong&gt;CROSS&lt;/strong&gt; axis.&lt;/p&gt;

&lt;p&gt;You can choose which direction you want the main axis to be by using &lt;strong&gt;“flex-direction”&lt;/strong&gt;. There are two main flex-directions, Row and Column.&lt;/p&gt;

&lt;p&gt;If you use &lt;strong&gt;flex-direction: row;&lt;/strong&gt; the main axis will run horizontally and the cross axis will run vertically inside the container. Since the main axis is horizontal this will cause the flex items to be aligned horizontally inside the container. Lets take a look at a flex container with out items for now.&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%2Flswiscdu82ccfau7lt1k.jpg" 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%2Flswiscdu82ccfau7lt1k.jpg" alt="flex container row" width="640" height="445"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In contrast &lt;strong&gt;flex-direction: column;&lt;/strong&gt; will cause the main axis to change to run vertically, and of course this will cause the cross axis switch to be horizontal. Since the main axis is now vertical, and the items always run along the main axis, they will now be aligned vertically. Again this is without having any child items yet.&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%2F1indgthgwhslydhrnlhm.jpg" 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%2F1indgthgwhslydhrnlhm.jpg" alt="flex container column" width="640" height="445"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;FYI the default flex-direction is row.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;These two axes are the fundemental structure of how flexbox works. Lets move on and actually add some items.&lt;/p&gt;

&lt;h2&gt;
  
  
  Flex Items, Selectors and Properties.
&lt;/h2&gt;

&lt;p&gt;Ok so we know how to create a flex container and how to set the direction of the main axis. Now the question is how can we manipulate the items in the container and get them to behave how we want. They answer like most things in web dev is..….there isn't just one way.&lt;/p&gt;

&lt;p&gt;With flexbox you can set positioning values at the container level which will adjust all of the elements in the container. Or in some cases you can set positioning values on individual to change their position.&lt;/p&gt;

&lt;p&gt;We’re going to focus mostly on the container level values, I’ll mention some of the item values towards the end. But I’m not going to do a deep dive on those in this post.&lt;/p&gt;

&lt;h2&gt;
  
  
  Justify and Align (Container level)
&lt;/h2&gt;

&lt;p&gt;Let’s start off simple with Justify and Align. Justify positions items along the main-axis the actual property is justify-content, and Align positions items along the cross-axis with the property being align-items.&lt;/p&gt;

&lt;p&gt;There are many values you can set to these properties to achieve certain results but we’re only going to focus on a handful.&lt;/p&gt;

&lt;p&gt;The properties and values that you use to position elements on the main and cross axis change depending on the flex-direction that you are using. We’ll start with *&lt;em&gt;flex-direction: row;&lt;/em&gt; since that is the default.&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%2F71gaw56nu8nqq5gnatk9.jpg" 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%2F71gaw56nu8nqq5gnatk9.jpg" alt="flex direction row" width="600" height="384"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Justify-content
&lt;/h3&gt;

&lt;p&gt;In my experience these 6 values for justify-content is all you will need the majority of the time when working with flexbox.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;justify-content: start;&lt;br&gt;
    Start will position the items at the “start” of the main-axis. Which by default is the left hand side. &lt;/p&gt;
&lt;/blockquote&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%2Fojaedq6sb95npk1qb983.jpg" 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%2Fojaedq6sb95npk1qb983.jpg" alt="justify start" width="600" height="417"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;justify-content: center;&lt;br&gt;
    Center will position the items at the center of the main axis.&lt;/p&gt;
&lt;/blockquote&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%2Fyvv2n9jwcyd6suolcea0.jpg" 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%2Fyvv2n9jwcyd6suolcea0.jpg" alt="justify center" width="600" height="417"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;justify-content: end;&lt;br&gt;
    End will position the items at the end of the main axis, which by default is the right hand side.&lt;/p&gt;
&lt;/blockquote&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%2F4iu2mkcv91lj9ishxlmi.jpg" 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%2F4iu2mkcv91lj9ishxlmi.jpg" alt="justify end" width="600" height="417"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Align-Items
&lt;/h3&gt;

&lt;p&gt;For align-items there are really only 3 main values that you need.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;align-items: start;&lt;br&gt;
    Start will position the items at the “start” of the cross-axis, which is the top of the container.&lt;/p&gt;
&lt;/blockquote&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%2Fpf4eac1brqduqfmtkaq4.jpg" 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%2Fpf4eac1brqduqfmtkaq4.jpg" alt="align start" width="600" height="417"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;align-items: center;&lt;br&gt;
    Center will position the items in the center of the cross-axis, which is the center of the container vertically.&lt;/p&gt;
&lt;/blockquote&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%2F33cb8219dpl2w8tqy0l3.jpg" 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%2F33cb8219dpl2w8tqy0l3.jpg" alt="align center" width="600" height="417"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;align-items: end; &lt;br&gt;
    End will position the items at the “end” of the cross-axis, which is the bottom of the container.&lt;/p&gt;
&lt;/blockquote&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%2Fii15ev0uzzrnunl1fn67.jpg" 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%2Fii15ev0uzzrnunl1fn67.jpg" alt="align end" width="600" height="417"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://codepen.io/ajwerth/pen/ayVxRy" rel="noopener noreferrer"&gt;Here's a codepen I made that has a flex container and one flex item, try using justify-content and align-items to move it around in the container.&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Spacing
&lt;/h3&gt;

&lt;p&gt;Spacing is a very useful tool when creating layouts. Spacing lets you add space (surprise) between the flex items, and since spacing causes the items to move on the main axis, you use values in the justify-content property to change the spacing. When using the spacing values for justify-content, it’s similar to applying margins to all the items. The difference is that instead of explicitly setting the margins yourself, the browser will calculate the amount of margin needed so that the entire space of the container is used.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;justify-content: space-around;&lt;br&gt;
    Space around will position the items so that they all have the same amount of space around them. &lt;/p&gt;
&lt;/blockquote&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%2Fkwgczpn6g70uxfbfmm5h.jpg" 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%2Fkwgczpn6g70uxfbfmm5h.jpg" alt="justify space around" width="600" height="417"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;justify-content: space-between;&lt;br&gt;
    Space between will position the items so that they all have the same amount of space around them, except for the first item and the last item, which will not have space on their left and right sides respectively.&lt;/p&gt;
&lt;/blockquote&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%2F9ojfucm7flk7o73gkzot.jpg" 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%2F9ojfucm7flk7o73gkzot.jpg" alt="justify space between" width="600" height="416"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;justify-content: space-evenly;&lt;br&gt;
    Space-evenly will position the items so that the space around them is all the same amount.&lt;/p&gt;
&lt;/blockquote&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%2Fpyt7b9br5qssg7kj7as9.jpg" 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%2Fpyt7b9br5qssg7kj7as9.jpg" alt="justify space evenly" width="600" height="425"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With these 2 properties and 9 values you can create a surprising amount of layouts using FlexBox. Before moving on, check out these two CodePens I made and fool around with Justify and Align. The first one is just with one child in the container, the 2nd has multiple.&lt;/p&gt;

&lt;p&gt;As I mentioned earlier, switching to &lt;strong&gt;flex-direction: column;&lt;/strong&gt; will cause the main axis to be vertical, and the cross axis to be horizontal.&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%2Feiwrx9ntmutsko779lww.jpg" 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%2Feiwrx9ntmutsko779lww.jpg" alt="direction colum" width="600" height="384"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://codepen.io/ajwerth/pen/yoMLwv" rel="noopener noreferrer"&gt;Here's a copdpen with multiple flex items, try adjusting the justification and alignements with what you just learned.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The cool thing is that no matter what the direction of the axes, you use the same properties to position elements on each of the axes. So even though the main axis is now vertical you will still use justify-content to position elements along the main axis. The same goes for the cross axis you still use align-items. The only difference is that now justify-content will position vertically, and align-items will position horizontally, but that’s kind of obvious.&lt;/p&gt;

&lt;h3&gt;
  
  
  Align-self
&lt;/h3&gt;

&lt;p&gt;Now that we’ve covered the basics of how to position flex items by adjusting the container properties and values. Let’s quickly go over a couple properties and values that you have at your disposal on the items themselves.&lt;/p&gt;

&lt;p&gt;Align self is pretty self explanatory you can use this property on a flex item to set the positioning of that item only, and not any of the other items in the container.&lt;/p&gt;

&lt;p&gt;In this image you can see that the container has &lt;strong&gt;align-items: center;&lt;/strong&gt; so the items are all aligned to the center. Except for item1 on which I put align-self: start; which takes precedence over align-items, and hence aligns item1 to the start of the container.&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%2Fyfxoo8uuizu8b1xdclxr.jpg" 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%2Fyfxoo8uuizu8b1xdclxr.jpg" alt="align self" width="600" height="417"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can use align-self on any item in the flex container and you can position them with any of the align values.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://codepen.io/ajwerth/pen/MvOvEy" rel="noopener noreferrer"&gt;Here's the codepen for align-self you can make some wild alignments.&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Flex
&lt;/h2&gt;

&lt;p&gt;Flex is one of my favorite properties in the FlexBox module. Flex lets you set a calculated width of a flex item in relation to the other items in the container. What I mean by this is that you can give an item a flex value, and the browser will use that number to figure out what the width of the item should be based on the flex values of the other items.&lt;/p&gt;

&lt;p&gt;Here’s a more detailed explanation. Let’s say you have 2 items in a container, item1 and item2. Then let's say you set item1 to have flex: 1; and item2 to have flex:2; The browser calculates that you're specifying that the container is 3 units wide, and that item1 should take up 1 of those units and item2 should take up the other 2.&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%2Ff5o5nkpgnu7r9j2c4aa5.jpg" 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%2Ff5o5nkpgnu7r9j2c4aa5.jpg" alt="flex 2x3" width="600" height="431"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The best part is that no matter how many elements you have or how many units you set an item to be, the browser will always add them all up and calculate the widths based on the flex values. This means you can be super specific about the widths of the elements in the container. It also means that they will be 100% responsive.&lt;/p&gt;

&lt;p&gt;Here's another example. There are 3 items in this container. item1 has a flex of 1, item2 has a flex of 2 and item3 has a flex of 3. The browser calculates 1+2+3=6 and that the container should be considered 6 units wide. Then it determines how much space each of the items should take up based on the flex value, and then it sets the widths of the items accordingly. It does all the heavy lifting for you.&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%2Fdbzlr2cd3eogyv6xl36p.jpg" 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%2Fdbzlr2cd3eogyv6xl36p.jpg" alt="flex 3x6" width="600" height="363"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://codepen.io/ajwerth/pen/gxXmWQ" rel="noopener noreferrer"&gt;A link for the codepen utilizing the flex property, mess around with the flex values and see what happens.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Flex is a super powerful property in FlexBox, it makes it so you have a huge amount of control over the space the items take up in the container. Mess around with the codepen I made, and see how cool the flex property is.&lt;/p&gt;

&lt;h2&gt;
  
  
  Flex-Wrap
&lt;/h2&gt;

&lt;p&gt;The last property I want to talk about is the flex-wrap property. The flex-wrap property allows for the items in the container to wrap around to the next row if there isn’t enough room for them on the first row. All you need to enable wrapping is to add flex-wrap: wrap; to your flex container.&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%2F5ojp9mc4if8a4str78gh.jpg" 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%2F5ojp9mc4if8a4str78gh.jpg" alt="flex wrap" width="600" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As you can see in the image, the items all have a width of 200px, but the container is only 600px wide. But since I set flex-wrap: wrap; item4 wraps around to the next line. If the container was less than 600px wide item3 would also wrap around to the next line. &lt;/p&gt;

&lt;p&gt;This makes flex wrap great for making responsive grids, or grids where you might not know how many elements you will have in the grid. Like if you’re pulling your items from an API where the item count is constantly changing.&lt;/p&gt;

&lt;p&gt;You can combine this with the properties and values that we went over earlier and you can create an amazingly flexible and responsive grid. Here’s a code pen demo, mess around with it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://codepen.io/ajwerth/pen/MvrWVL" rel="noopener noreferrer"&gt;Check out the Flex Wrap codepen. Notice how the items wrap to the next line if you change the size of the browser.&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;Now you know why FlexBox is one of my favorite CSS modules. And almost always is my go to when I’m creating more complex layouts. Hopefully this post helped you wrap your head around how FlexBox works and serves as a good jumping off point to allow you to start using it. Don’t forget to check out MDN to learn more about the tools in the FlexBox tool box, there’s a lot more you can do with it. Feel free to leave a comment if you have any questions or thoughts. Stay Flexible!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>The reason I'm starting a blog.</title>
      <dc:creator>Alec Wertheimer</dc:creator>
      <pubDate>Wed, 18 Mar 2020 19:54:09 +0000</pubDate>
      <link>https://dev.to/ajwerth/the-reason-i-m-starting-a-blog-ihi</link>
      <guid>https://dev.to/ajwerth/the-reason-i-m-starting-a-blog-ihi</guid>
      <description>&lt;p&gt;Hey, you found my blog! Welcome! Since this is my first post I'm going to use it to tell you a little bit about me and how I got to where I am. Then a little bit on why I decided to start a blog and why I think you should start one too.&lt;/p&gt;

&lt;p&gt;So how did I become a Web Developer? Well it's a long story that can be summed up in a few sentances so I don't bore you to death. &lt;/p&gt;

&lt;p&gt;I went to school for Animation. After that I started designing web sites and naturally became interested in how I could build what I had designed. With help from codeacademy and freecodecamp I taught myself basic HTML/CSS and was instantly hooked. As I got more experience I wanted to make more and more elaborate sites, which turned into apps, and next thing you know I'm knee deep in a Dockerized React frontend and a custom Flask API, running in AWS. Coding is a blast!&lt;/p&gt;

&lt;h1&gt;
  
  
  Why write a blog.
&lt;/h1&gt;

&lt;p&gt;Now you're probably saying to yourself "Cool man, I don't really care about your life story.", fair point. You want to know why I decided to write a blog, and why I think you should start one too. Like me you're probably realize there are a million articles and blog posts on every topic you could ever possibly want to read about. So whats the point of even starting a blog? Well I've got 2 great simple reasons why.&lt;/p&gt;

&lt;h2&gt;
  
  
  A blog is a great Reference tool.
&lt;/h2&gt;

&lt;p&gt;A few years ago I was at WordCamp Philly, the WordPress convention that is put on here in philly every year. One of the talks that I attendeed was specifically about why and how to start a blog. During his talk the speaker mentioned how he quiet frequently found himself looking up things that he had done before. Whether it was something he just recently learned and wasn't that farmiliar with, or something that he'd done a million times, however the last time he did it was so long a go there's not a shot in hell he was going to remember how to do it correctly. He thought "God, wouldn't it be great if I had a collection of articles about things I already spent time learning, and could refer back to whenever I needed a refresher?" Boom! perfect reason for a blog.&lt;/p&gt;

&lt;p&gt;I thought this was genius, but still it wasn't enough to really kickstart my desire to start a blog. I'm not suer why since it was such a simple and great reason. One day I saw a youtube video about The Feynman Technique. A technique developed by Richard Feynman the famous physicist, yeah the one who help build the atomic bomb.&lt;/p&gt;

&lt;p&gt;The technique has 3 steps...&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1 learn it.
&lt;/h2&gt;

&lt;p&gt;You can't master anything if you don't spend some time learning how to do it. Super important, but I mean come on common sense. You can't ride a bike if you don't learn how to ride a bike, duh.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2 Do it.
&lt;/h2&gt;

&lt;p&gt;Another pretty obvious step if you don't practice the skill you'll eventually forget what you learned, at that point you're back to square one.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3 Teach it.
&lt;/h2&gt;

&lt;p&gt;Step 3 is where it gets interesting. This is the step that's not as obvious, but also the one which is most important on the path to mastery. Teaching others the same skill. &lt;/p&gt;

&lt;p&gt;You don't realize until you do it how much teaching someone else gives you a deeper understanding of whatever it is your teaching them. There are two main reasons for this that I've experience.&lt;/p&gt;

&lt;p&gt;In order to teach someone a skill, you need to be able to articulate what needs to be done in a way that shows not only how to do it, but also why it needs to be done that way. Thats where you start to master a skill when you start examining the "why". knowing why something works is extremely powerful.&lt;/p&gt;

&lt;p&gt;Now, to really take yourself to the next level, to really be considered a master. To reach, as I like to call it, "Wizard" status, you need to be able to answer questions. All kinds of questions. When you start teaching someone a skill, they will undoubtedly have a question for you that you don't know the answer to. Not because you don't know the skill, but because the question they asked never even occurded to you. When you start looking up answers to questions your brain didn't come up with, that's when you start really learning the ins and outs of something.&lt;/p&gt;

&lt;p&gt;Pocahontas summed it up best...&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;...if you walk the footsteps of a stranger&lt;br&gt;
you'll learn things you never knew, you never knew..&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h1&gt;
  
  
  That's why.
&lt;/h1&gt;

&lt;p&gt;When I saw the video on The Feynman Technique, thats when I really had the urge, the fire to actaully start a blog.&lt;/p&gt;

&lt;p&gt;A blog lets you accomplish so many things. It lets you keep an index of things you've learned that you can refer back to, gives you a deeper understanding of those things, teaches others about those thing who in return will have questions that will most likely give you and even deeper understanding. Not to mention you'll probably make some good connections in the proccess. &lt;/p&gt;

&lt;h1&gt;
  
  
  Wrapping up.
&lt;/h1&gt;

&lt;p&gt;I am currently working on my next and first coding post. The first topic I'm going to cover is Flex-box. I love this tool and I'm going to break it down so that you will too. So make sure to keep an eye out for that. I implore you to reach out to me with any questions.&lt;/p&gt;

&lt;p&gt;Also if you would like to learn more about the Feynman Technique check out &lt;a href="https://www.youtube.com/watch?v=_f-qkGJBPts&amp;amp;feature=youtu.be"&gt;this video by Thomas Frank&lt;/a&gt; he explains it really well and in a lot more detail. There are also a ton of great articles and other blogs that cover the topic as well.&lt;/p&gt;

&lt;p&gt;Well that's all I got for now. Keep coding!&lt;/p&gt;

</description>
      <category>blogs</category>
      <category>feynmantechnique</category>
    </item>
  </channel>
</rss>
