<?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: Vincent Dhennin</title>
    <description>The latest articles on DEV Community by Vincent Dhennin (@kawacrepe).</description>
    <link>https://dev.to/kawacrepe</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%2F375232%2Fdd608191-98b1-4528-a2be-12eed75dbe0c.png</url>
      <title>DEV Community: Vincent Dhennin</title>
      <link>https://dev.to/kawacrepe</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kawacrepe"/>
    <language>en</language>
    <item>
      <title>Introduction to Flex in Web Development: Vuetify Edition</title>
      <dc:creator>Vincent Dhennin</dc:creator>
      <pubDate>Mon, 11 May 2020 19:00:14 +0000</pubDate>
      <link>https://dev.to/kawacrepe/introduction-to-flex-in-web-development-vuetify-edition-27kn</link>
      <guid>https://dev.to/kawacrepe/introduction-to-flex-in-web-development-vuetify-edition-27kn</guid>
      <description>&lt;p&gt;Flexbox may not be a new web development concept, yet it still remains one of the fundamental concepts developers use to craft user interfaces in 2020.&lt;br&gt;
Things web developers must always keep in mind include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Responsive design&lt;/li&gt;
&lt;li&gt;Having a proper layout&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To succeed, our biggest weapon is flexbox, as well as general grid concepts.&lt;/p&gt;

&lt;p&gt;This tutorial will cover what flexbox is, the most used properties, and will conclude with a part of how Vuetify works with flexbox.&lt;/p&gt;
&lt;h2&gt;
  
  
  What is Flexbox?
&lt;/h2&gt;

&lt;p&gt;The flexbox layout aims to provide a way to lay out, align and distribute space among items in a container, even when their size is unknown and/or dynamic.&lt;/p&gt;

&lt;p&gt;Before going further, we should understand the difference between a parent and a child element in webdev. It’s a basic concept which has a high impact when we start using flexbox.&lt;/p&gt;

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

&lt;p&gt;Flexbox is not a single property -  it’s a whole module which involves a lot of things.&lt;/p&gt;

&lt;p&gt;It includes properties for the parent element, known as a &lt;code&gt;flex container&lt;/code&gt; and for the children element known as a &lt;code&gt;flex item&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The main idea behind the flex layout is to give the container the ability to alter its items’ width/height (and order) to best fill the available space (mostly to accommodate to all kind of display devices and screen sizes).&lt;/p&gt;

&lt;p&gt;A flex container expands items to fill available free space or shrinks them to prevent overflow.&lt;/p&gt;

&lt;p&gt;Next, we will look into the basics about flex and the most used properties with some examples&lt;/p&gt;

&lt;p&gt;Let’s see behind some flexbox properties and their utilities.&lt;/p&gt;

&lt;p&gt;In my opinion, the best way to learn things is to play with them.&lt;br&gt;
&lt;a href="https://flexbox.netlify.app/" rel="noopener noreferrer"&gt;Flexbox playground&lt;/a&gt; is perfect for that! The code used to create this app is the same as you can find in the Vuetify Docs.&lt;/p&gt;

&lt;p&gt;If you prefer textual explanation, you should have a look to &lt;a href="https://css-tricks.com/snippets/css/a-guide-to-flexbox/#flexbox-background" rel="noopener noreferrer"&gt;CSS Tricks Flexbox guide&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  How does Vuetify work with flexbox?
&lt;/h2&gt;

&lt;p&gt;When it comes to using Vuetify, this UI framework makes it so that you do not need to to write css flex class inside your web application. This is because Vuetify  has two different ways to handle flex design.&lt;/p&gt;

&lt;p&gt;The first one is using &lt;code&gt;flex-helpers&lt;/code&gt;, as you can find &lt;a href="https://vuetifyjs.com/en/styles/flex/#flex" rel="noopener noreferrer"&gt;here&lt;/a&gt;. It covers the basics flex properties.&lt;/p&gt;

&lt;p&gt;The second way is to use v-row (as a flex-container) and v-col (as a flex-item).&lt;br&gt;
This example is from the official Vuetify documentation:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;v&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;container&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;v&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;row&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
       &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;v&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;col&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
         &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;v&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;card&lt;/span&gt;
           &lt;span class="kd"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;pa-2&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
           &lt;span class="nx"&gt;outlined&lt;/span&gt;
           &lt;span class="nx"&gt;tile&lt;/span&gt;
         &lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
           &lt;span class="nx"&gt;One&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="nx"&gt;three&lt;/span&gt; &lt;span class="nx"&gt;columns&lt;/span&gt;
         &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/v-card&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;       &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/v-col&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;       &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;v&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;col&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
         &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;v&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;card&lt;/span&gt;
           &lt;span class="kd"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;pa-2&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
           &lt;span class="nx"&gt;outlined&lt;/span&gt;
           &lt;span class="nx"&gt;tile&lt;/span&gt;
         &lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
           &lt;span class="nx"&gt;One&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="nx"&gt;three&lt;/span&gt; &lt;span class="nx"&gt;columns&lt;/span&gt;
         &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/v-card&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;       &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/v-col&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;       &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;v&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;col&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
         &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;v&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;card&lt;/span&gt;
           &lt;span class="kd"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;pa-2&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
           &lt;span class="nx"&gt;outlined&lt;/span&gt;
           &lt;span class="nx"&gt;tile&lt;/span&gt;
         &lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
           &lt;span class="nx"&gt;One&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="nx"&gt;three&lt;/span&gt; &lt;span class="nx"&gt;columns&lt;/span&gt;
         &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/v-card&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;       &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/v-col&amp;gt;&lt;/span&gt;&lt;span class="err"&gt; 
&lt;/span&gt;     &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/v-row&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;   &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/v-container&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;v-row&lt;/code&gt; is a wrapper component for &lt;code&gt;v-col&lt;/code&gt;. It utilizes flex properties to control the layout and flow of its inner columns. It uses a standard gutter of 24px. This can be reduced with the &lt;code&gt;dense&lt;/code&gt; prop or removed completely with &lt;code&gt;no-gutters&lt;/code&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;v-col is a content holder that must be a direct child of v-row&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;v-row and v-col contain different props to interact with align, justify and order, offset.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You can find more information &lt;a href="https://vuetifyjs.com/en/components/grids/#api" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now let’s play some games to understand all the basics!&lt;/p&gt;

&lt;p&gt;You can practice your flexbox skills on the two websites listed below:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://flexboxfroggy.com/" rel="noopener noreferrer"&gt;Flexbox froggy&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.flexboxdefense.com/" rel="noopener noreferrer"&gt;Flexbox defense&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Thanks for reading this introduction post on flexbox! Stay tuned for more posts with detailed examples on this concept in the near future.&lt;/p&gt;

&lt;p&gt;Sources: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://flexbox.netlify.app/" rel="noopener noreferrer"&gt;https://flexbox.netlify.app/&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="https://css-tricks.com/snippets/css/a-guide-to-flexbox/#flexbox-background" rel="noopener noreferrer"&gt;https://css-tricks.com/snippets/css/a-guide-to-flexbox/#flexbox-background&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://flexboxfroggy.com/" rel="noopener noreferrer"&gt;https://flexboxfroggy.com/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.flexboxdefense.com/" rel="noopener noreferrer"&gt;http://www.flexboxdefense.com/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;This blog post is a part of &lt;a href="https://vuetifyjs.com/en/introduction/guide/" rel="noopener noreferrer"&gt;Vuetify Beginner's Guide Series&lt;/a&gt;. 🐣 Each blog has been collaboratively worked on by the Vuetify Core Team. Interested in contributing a topic? ➡ Reach out to &lt;a href="https://dev.to/johannarlee"&gt;Johanna&lt;/a&gt; on Dev.to or in the &lt;a href="https://discord.com/invite/s93b7Fv" rel="noopener noreferrer"&gt;Vuetify Community Discord&lt;/a&gt;. &lt;/p&gt;

</description>
      <category>beginners</category>
      <category>webdev</category>
      <category>vuetify</category>
      <category>flexbox</category>
    </item>
  </channel>
</rss>
