<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by The indieDev on Medium]]></title>
        <description><![CDATA[Stories by The indieDev on Medium]]></description>
        <link>https://medium.com/@dev.mstflotfy?source=rss-1d1bf4cc031f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Jwd8sOXYWPyIDUkmQie-IA.png</url>
            <title>Stories by The indieDev on Medium</title>
            <link>https://medium.com/@dev.mstflotfy?source=rss-1d1bf4cc031f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 14:54:20 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@dev.mstflotfy/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Using localStorge in NuxtJs (Developing my first app)]]></title>
            <link>https://medium.com/@dev.mstflotfy/using-localstorage-to-persist-unsaved-sessions-in-my-nuxt-app-f8d02926ee63?source=rss-1d1bf4cc031f------2</link>
            <guid isPermaLink="false">https://medium.com/p/f8d02926ee63</guid>
            <category><![CDATA[localstorage]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[indiedev]]></category>
            <category><![CDATA[nuxtjs]]></category>
            <category><![CDATA[indie]]></category>
            <dc:creator><![CDATA[The indieDev]]></dc:creator>
            <pubDate>Mon, 29 Apr 2024 00:00:06 GMT</pubDate>
            <atom:updated>2024-05-13T04:12:17.902Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Text: Persist Session using localStorage in Nuxt, The indieDev, OneExercise. Image: OneExercise app with a running session and page is being reloaded." src="https://cdn-images-1.medium.com/max/1024/0*XqKV8iVfNiPT_RAT.png" /></figure><p>Hey, I’m building my indie apps and sharing some of the lessons I come across on <a href="https://mstflotfy.com/">my website</a> and my YT channel: <a href="https://www.youtube.com/@theindiedev.mstflotfy">The indieDev</a>.</p><p>I finally built my first App: <a href="https://oneexercise.mstflotfy.com/">OneExercise (1Xercise)</a>: A free workout tracker that runs in your browser and gives you instant colored feedback by comparing the current workout to the very last one. I am still fixing some bugs and rethinking the design and functionality to improve the UX.</p><figure><img alt="OneExercise App screenshot in darkmode" src="https://cdn-images-1.medium.com/max/1024/0*OUZRVgv0a1R940tK.jpg" /></figure><p>But, it’s very functional. I’ve been using it for the past 3+ months to track my own workouts.</p><figure><img alt="OneExercise App screenshot, stats page" src="https://cdn-images-1.medium.com/max/1024/0*LjFFaLipt2B4-Cef.jpg" /></figure><p>In the following video, I talk about one of the latest issues I found while using my NuxtJs app, <a href="https://oneexercise.mstflotfy.com/">OneExercise (1Xercise)</a>, and how I used <a href="https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage">localStorage</a> to fix it.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FHNquoFO4Y2c%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DHNquoFO4Y2c&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FHNquoFO4Y2c%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/0ae13afec96d8c53aaa733c062f761b3/href">https://medium.com/media/0ae13afec96d8c53aaa733c062f761b3/href</a></iframe><p>Here are some quick notes from the video:</p><h3>The Problem: Losing unsaved session state on page reloads and app closures</h3><p>I came across an issue while using <a href="https://oneexercise.mstflotfy.com/">OneExercise</a>, where I was losing my running (unsaved) workout session whenever the page is reloaded or the app is closed. This was especially painful whenever I was tracking a workout that has a timer (like a ‘Dead Hang’ or a ‘Power walk’ workout)</p><p>I mainly use <a href="https://oneexercise.mstflotfy.com/">OneExercise</a> as a PWA downloaded by the Chrome browser on my Android phone. Whenever I switch to another app temporarily, the Chrome browser tends to restart the app, resulting in a very bad experience and losing unsaved progress.</p><h3>Different ways to save data in the browser</h3><p>There are many ways to save data in the browser. ( <a href="https://www.sitepoint.com/client-side-storage-options-comparison/">This article shows 10 different ways to save data in the browser</a>.)</p><p>I had already been using <strong>indexedDb</strong> to store <a href="https://oneexercise.mstflotfy.com/"><strong>OneExercise</strong></a> users’ workouts &amp; exercises in the browser via Dexie.Js. <a href="https://dexie.org/"><strong>Dexie.Js</strong></a> is a wrapper library that simplifies working with <strong>indexedDb</strong> that I use in OneExercise. However, indexedDb is more suitable for storing a large amount of structured data and is an overkill for what I needed to do, which is to temporarily store a very small amount of data (the current user’s unsaved workout info), in the browser.</p><p>I looked into <strong>sessionStorage</strong>, but sessionStorage would only save state across page reloads, if the app is closed the data will be lost.</p><p>I found localStorage to be the most suitable solution; it stores state across page reloads and even when the app is closed.</p><h3>How To Use localStorage</h3><p>The following code example shows how simple it is to use <strong>localStorage</strong> to quickly save state in the browser.</p><pre><br>// Saving each item separately in localStorage as a string<br><br>let workoutName = &#39;Sprints&#39;<br><br>localStorage.setItem(&#39;unsavedWorkoutName&#39;, workoutName)<br>workoutName = localStorage.getItem(&#39;unsavedWorkoutName&#39;)<br><br>// clean up<br>localStorage.removeItem(&#39;unsavedWorkoutName&#39;)<br></pre><pre>// Saving related items as one object in localStorage<br><br>let workout = {<br> name: &#39;Walk&#39;,<br> date: new Date()<br>}<br><br>localStorage.setItem(&#39;unsavedWorkout&#39;, JSON.stringify(workout))<br><br>// update workout val<br>workout = JSON.parse(localStorage.getItem(&#39;unsavedWorkout&#39;))<br><br>// clean up<br>localStorage.removeItem(&#39;unsavedWorkout&#39;)</pre><h3>How I used localStorage in my Nuxt.js app OneExercise</h3><p>I created this <a href="https://github.com/mstflotfy/Nuxt.js-isolated-localStorage-persistent-session">simple GitHub repo</a> to show how I persist unsaved workout sessions in OneExercise.</p><p>When a user adds/edits a workout, I watch the values of the current unsaved workout session, if they are changed, I save the changes into localStorage.</p><pre>&lt;script setup lang=&quot;ts&quot;&gt;<br>// ...<br><br>// Save to localStorage<br>watch([workoutName, workoutDate], ([newName, newDate], [oldName, oldDate]) =&gt; {<br>   localStorage.setItem(&#39;unsavedWorkoutName&#39;, newName)<br>   localStorage.setItem(&#39;unsavedWorkoutDate&#39;, newDate)<br>   localStorage.setItem(&#39;unsavedId&#39;, workoutId as string)<br>})<br><br>// ...<br>&lt;/script&gt;</pre><p>Then, whenever the page is reloaded, I check if there is an unsaved session in localStorage, if I find one I load it.</p><pre><br>&lt;script lang=&quot;ts&quot; setup&gt;<br><br> // ...<br><br>  onMounted(() =&gt; {<br>    // Load from localStorage<br>    const unsavedId = localStorage.getItem(&#39;unsavedId&#39;) ?? &#39;&#39;<br>    const unsavedName = localStorage.getItem(&#39;unsavedWorkoutName&#39;) ?? &#39;&#39;<br>    const unsavedDate = localStorage.getItem(&#39;unsavedWorkoutDate&#39;) ?? &#39;&#39;<br>    if (unsavedId) {<br>        workoutName.value = unsavedName<br>        workoutDate.value = unsavedDate<br>    }<br>  })  <br><br> // ...<br>&lt;/script&gt;</pre><p>Finally, when the user presses navigates back, I remove the workout session from localStorage:</p><pre>&lt;script lang=&quot;ts&quot; setup&gt;<br><br> // ...<br><br>  onBeforeRouteLeave(() =&gt; {<br>    // Reset localStorage<br>    localStorage.removeItem(&#39;unsavedId&#39;)<br>    localStorage.removeItem(&#39;unsavedWorkoutName&#39;)<br>    localStorage.removeItem(&#39;unsavedWorkoutDate&#39;)<br>  })<br>&lt;/script&gt;</pre><p>If the app is closed, the user will first visit the root page. So I check if there is already an unsaved running workout session in localStorage, if yes I direct the user towards it using the ID I saved in localStorage, if not I just direct the user to the workout page as the normal entry point of the user journey.</p><pre>&lt;script lang=&quot;ts&quot; setup&gt;<br>  const router = useRouter();<br><br>  onMounted(() =&gt; {<br>    const unsavedId = localStorage.getItem(&#39;unsavedId&#39;) ?? &#39;&#39;<br><br>    if (unsavedId) {<br>      router.push(`/workouts/${unsavedId}`);<br>    } else {<br>      router.push(&#39;/workouts&#39;)<br>    }<br>  })<br>&lt;/script&gt;</pre><p>Checkout the full code at the <a href="https://github.com/mstflotfy/Nuxt.js-isolated-localStorage-persistent-session">GitHub Repo</a>, or the <a href="https://youtu.be/HNquoFO4Y2c">video</a> for more details.</p><h3>Links from this post</h3><ul><li><a href="https://github.com/mstflotfy/Nuxt.js-isolated-localStorage-persistent-session">Persist session Using localStorage In Nuxt.Js, GitHub Repo</a></li><li><a href="https://youtu.be/HNquoFO4Y2c">Use localStorage to keep unsaved Sessions Running , Youtube Video</a></li><li><a href="https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API">MDN Docs, Using the Web Storage API</a></li><li><a href="https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Client-side_web_APIs/Client-side_storage">MDN Docs, Client-side storage</a></li><li><a href="https://www.sitepoint.com/client-side-storage-options-comparison/">Article, 10 Client-side Storage Options and When to Use Them</a></li><li><a href="https://nuxt.com/docs/getting-started/installation">Nuxt.js Official Docs</a></li></ul><h3>Other Posts You Might Find Interesting</h3><ul><li><a href="https://mstflotfy.com/design/figma-to-code-html-css">How I coded my website’s Figma design</a></li><li><a href="https://mstflotfy.com/design/first-wireframe-5lessons-7step-workflow">5 Lessons from Wire-framing My First App</a></li></ul><p><em>Originally published at </em><a href="https://mstflotfy.com/dev/persist-state-localStorage-OneExercise"><em>https://mstflotfy.com</em></a><em> on April 29, 2024.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f8d02926ee63" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[3 lessons I learned Wireframing my first app]]></title>
            <link>https://medium.com/@dev.mstflotfy/3-lessons-i-learned-wireframing-my-first-app-7f67cd1c0d47?source=rss-1d1bf4cc031f------2</link>
            <guid isPermaLink="false">https://medium.com/p/7f67cd1c0d47</guid>
            <category><![CDATA[app-development]]></category>
            <category><![CDATA[ui]]></category>
            <category><![CDATA[ux]]></category>
            <category><![CDATA[design]]></category>
            <category><![CDATA[wireframe]]></category>
            <dc:creator><![CDATA[The indieDev]]></dc:creator>
            <pubDate>Tue, 20 Jun 2023 00:00:14 GMT</pubDate>
            <atom:updated>2023-07-16T11:53:20.148Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*64XkzIbUHX7QMS66aycziA.png" /></figure><p>I’m finally building my very first app. A simple workout tracker that focuses on starting slow and building up progress.</p><p>Even though I was itching to jump straight into <a href="https://www.figma.com/?utm_medium=affiliate&amp;utm_source=partnerstack&amp;utm_campaign=%7Bpartner_key%7D&amp;link=homepage">Figma</a> and to design the app, <strong>One of the very first steps to build an app is to create a wireframe for it.</strong></p><p>When I started working on my first wireframe, I made a mess and felt stuck. Eventually, I managed to come up with a decent enough wireframe.</p><p>In this video, I share 3 main lessons I learned from the process and a 7-step (suggested) workflow that I will try to follow when working on creating wireframes in the future.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fr2T1E29xsh4%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dr2T1E29xsh4&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2Fr2T1E29xsh4%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/fbc02d88d6fc05fd3d347a51c84ba76c/href">https://medium.com/media/fbc02d88d6fc05fd3d347a51c84ba76c/href</a></iframe><h3>Quick Notes From The Vid</h3><h3>3 Lessons</h3><h4>1 Define The Core of the app/website</h4><p>Define the most important page/functionality of the app. And start sketching and editing it first. Build the rest of the pages of the app around the core.</p><h4>2 Sketch The Big Picture</h4><p>Sketch all the pages of the app on one large piece of paper.</p><h4>3 Don’t Make A Mess while wireframing your app</h4><h4>Capture Related Ideas Cleanly</h4><p>Don’t allow ideas related to the app but not to the wireframe to distract you and take over your wireframe pages. Capture them cleanly on one separate page, to have easy access to them in the future and stay focused on the wireframe process.</p><h4>Stick to one medium</h4><p>Don’t scatter your wireframe across different mediums; sketchbook, pieces of paper, or GoodNotes (iPad note-taking app). Choose one medium to hold your</p><h4>Limit the pages</h4><p>Put a limit on the number of pages for your wireframe. I found 3 pages to be enough, one for the core, one for the big picture, and a third to capture related notes and ideas.</p><h3>7-Step workflow to create a wireframe</h3><ol><li>Define Refs</li><li>Create a list of every feature that you want to add to the app/website</li><li>Filter the list and find the essential features and pages of the app.</li><li>Define the core of the app.</li><li>Sketch and edit the Core</li><li>Sketch and edit the Big Picture</li><li>Capture all related ideas in a one page</li></ol><h3>Other Articles/Things You Might Find Interesting</h3><ul><li><a href="https://mstflotfy.com/design/fab-material-design-3">How I used a FAB (Material Design 3 Component) In My App’s Design</a></li><li><a href="https://mstflotfy.com/design/figma-to-code-html-css">Coding my website’s Figma Design</a></li><li><a href="https://www.youtube.com/playlist?list=PLsOexrcoU3Q7vQS9RW4VhfajYR2Vt6bwm">Exploring Figma playlist</a></li></ul><p>I will continue to document my progress while making my first app, on <a href="https://mstflotfy.com/">this website</a>, and on <a href="https://www.youtube.com/c/mstflotfyindieDev">The indieDev</a> YouTube channel. Stay tuned if you found this interesting.</p><p><em>Originally published at </em><a href="https://mstflotfy.com/design/first-wireframe-5lessons-7step-workflow"><em>https://mstflotfy.com</em></a><em> on June 20, 2023.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7f67cd1c0d47" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to use Material Design 3 Figma design kit (FAB)]]></title>
            <link>https://medium.com/design-bootcamp/how-i-used-a-fab-material-design-3-component-in-my-apps-designr-4e7609991885?source=rss-1d1bf4cc031f------2</link>
            <guid isPermaLink="false">https://medium.com/p/4e7609991885</guid>
            <category><![CDATA[app-design]]></category>
            <category><![CDATA[material-design]]></category>
            <category><![CDATA[materialdesign3]]></category>
            <category><![CDATA[figma]]></category>
            <category><![CDATA[indiedev]]></category>
            <dc:creator><![CDATA[The indieDev]]></dc:creator>
            <pubDate>Fri, 27 Jan 2023 00:00:20 GMT</pubDate>
            <atom:updated>2024-02-12T14:04:45.186Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Vza6Nq0XgXJcWrwk.png" /></figure><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FasN3B33wOzo%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DasN3B33wOzo&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FasN3B33wOzo%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/1ba76f99239543459f65cea839355fec/href">https://medium.com/media/1ba76f99239543459f65cea839355fec/href</a></iframe><p>I finally started working on building my first app. And I decided to use Material Design 3 to design it.</p><p>In the video above, I talk about a part of this design; The FAB (floating action button), and how I used it in the design of my app.</p><p>The second part of the vid is a step-by-step tutorial of how I used <a href="https://www.figma.com/community/file/1035203688168086460">Material 3 design kit</a> in Figma to add a custom FAB in the design of my app and I make a mini prototype to present and test it.</p><p>You can watch the vid above or you can read this summary.</p><h3>What Is Material Design?</h3><p><a href="https://youtube.com/shorts/DtSv3_A4DqQ?feature=share">What is Material Design? #shorts</a></p><p>Material Design is Google’s open-source design system, and Material Design 3 is the latest version of it.</p><p>The website <a href="https://m3.material.io/">m3.material.io</a> includes guidelines on using the Material design system to design for Android and the web.</p><p>The website is very useful even if you don’t intend to use the material design system. You’ll understand a lot about Ux and Ui.</p><h3>What is A FAB?</h3><p>There is a components section on the m3 website that includes every single component of the M3 design system. Including headers, buttons, cards, …</p><p>one of these components is the FAB.</p><p>The FAB (Floating action button) is a button that is displayed above all other content. Taking up a prominent position. And it should be used to give quick access to the most important action of a page.</p><p>There are 2 FAB components, the FAB and the Extended FAB component.</p><p>The FAB can only have an icon. But sometimes an icon is not enough to show what the action is then you have the extended FAB component that can include a label alone or one next to the icon.</p><p>If you check the <a href="https://m3.material.io/components/floating-action-button/overview">FAB</a>, and <a href="https://m3.material.io/components/extended-fab/overview">extended FAB</a> guideline pages on the material design website you’ll find more guidelines and very specific info on how to use the FAB and how not to use it as well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*RIwnr1i_HQRj63UM.png" /></figure><h3>Apps Using A Floating Action Button</h3><p>Google Keep has a FAB embedded in the bottom Nav. That allows the user to quickly add a new note.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/511/0*i1Cz43hqE_7u9Qxw.png" /></figure><p>And Gmail has an extended FAB to quickly compose a new email.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/451/0*LwFy-H0KBDYjnpHw.png" /></figure><h3>How I used a FAB in my App’s Design</h3><p><a href="https://youtube.com/shorts/TSvCPAM96Oo">How I used a FAB (Material Design 3 component) In The Design Of My App</a></p><p>While wireframing this is how I imagined the FAB.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/703/0*ctS_mQNbPnTJDV7U.png" /></figure><p>I wanted a main FAB and when I click it 2 other FABs would come app.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/597/0*LhrScpfeX4-pyvNa.png" /></figure><p>This is an exercise-tracking app. So there would be 2 main actions that I want to have quick access to when I’m on any of the main pages. And a FAB is perfect for that.</p><p>I thought I’d make adding a workout larger and adding an exercise smaller as adding a workout should happen more often than adding a new exercise.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/601/0*AqSnrFxsntPslr6E.png" /></figure><p>Clicking on a FAB that opens a list of FAB is inspired by MyNetDiary an app I’m currently using to track my calories.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/459/0*3vbEeLwcQ20SXj4-.png" /></figure><p>So my first attempt to implement this in Figma using the Material 3 kit. This is what you see in the image below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/541/0*BP_sIoGTTEKCDZdf.png" /></figure><p>The icons I have do not make the action clear so I must use a label. However the extended FAB already has a place for a label, so I thought there is no need to customize the FAB and I used an extended FAB instead.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/469/0*XrAKlEU6Xj22YSnK.png" /></figure><p>When clicked it opens up 2 extended FABs, There is no need to have a dismiss FAB when I can just click anywhere outside the buttons. I can dismiss taking an action.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/486/0*qP7M-Hhzxcq6xdtY.png" /></figure><h3>A step-by-step guide to adding an interactive FAB to your design</h3><p><a href="https://www.youtube.com/watch?v=asN3B33wOzo&amp;t=321s">05:21</a> — You can go to this part of the vid.</p><h3>1. Get a copy of the Free Material 3 Design Kit In Figma</h3><p>Go to <a href="https://www.figma.com/community/file/1035203688168086460">Material 3 Design Kit</a> and all you need to do is press “Get a copy” and you’ll have a copy of it in your drafts folder.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*CwaEr7FxKfMaXviC.png" /></figure><h3>2. Add a device frame to a new page</h3><p>Create a new page for our design. And add a frame.</p><p>I added an Android large device frame from the presets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qbnfKctb25TgztOY.png" /></figure><h3>3. Grab an instance of the device component and drop it in our device frame</h3><p>This step is optional. If you want you can grab a device frame from the “Styles” page. And adjust the constraints of its elements to always stick to our frame.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FqZfhGDjOw-iJu2f.png" /></figure><h3>4. Grab an instance of the extended FAB from the components page</h3><p>Before grabbing an instance of the Extended FAB component. Make prototype connections between the enabled, hovered, and pressed states. So that when we present our design and hover or press above the FAB the state changes accordingly.</p><p>Do this for the Primary and secondary FABs as we’ll use both.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*zmNnaFdvMHl695D8.png" /></figure><p>Then just grab a copy of the primary FAB and drop it into our design page to take an instance of it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*a3OeCuoTmrxUNFbc.png" /></figure><h3>5. Edit the Label and Icon of the FAB</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*XASIF-DZq2MDKq56.png" /></figure><h3>6. Test the FAB’s hover and press states</h3><p>First turn it into a component, as we’ll add a variant to it soon.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/495/0*a9c6qslh1c2cJwc3.png" /></figure><p>Then grab a copy of it and drop it inside our device frame.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/843/0*rNqsaGhsNgQYuOwP.png" /></figure><p>Present it, hover it, and press on it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/370/0*W7_FdH-qRk5V-cAQ.png" /></figure><h3>7. Add an open-state variant</h3><p>Add a new variant to our extended FAB.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/224/0*I7Sfg4VHDRbIBxju.png" /></figure><p>The new variant is 2 FABs on top of each other.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/275/0*Lrrs2_kHD17xm26E.png" /></figure><p>For the Add button to change to its open state, we’ll use an overlay.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/818/0*SjFB8gB5_D0jjHZU.png" /></figure><p>An overlay is going to open right on top of the Add FAB and cover it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/954/0*aWzWCjh6utYGYSwr.png" /></figure><p>Check the close when clicking outside, so we can dismiss the overlay and the open state when we click anywhere on the page away from the buttons.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*AAGszDKuukOf4Lks.png" /></figure><p>You can now present our design and see the FAB in action.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/616/0*bXob1gLW1k2qWDp1.png" /></figure><p>Finally, you can add a couple of pages with back buttons, so you can have a mini prototype.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*jWGtEvMFtv56SncZ.png" /></figure><h3>Other Articles You Might Find Interesting</h3><ul><li><a href="https://mstflotfy.com/design/figma-dropdown-3steps/">Make A Figma Dropdown Menu In 3 Steps</a></li><li><a href="https://mstflotfy.com/design/figma-negative-stack-card-component-in-5steps/">Design &amp; Prototype A Card Component In Figma</a></li></ul><p><em>Originally published at </em><a href="https://mstflotfy.com/design/fab-material-design-3"><em>https://mstflotfy.com</em></a><em> on January 27, 2023.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4e7609991885" width="1" height="1" alt=""><hr><p><a href="https://medium.com/design-bootcamp/how-i-used-a-fab-material-design-3-component-in-my-apps-designr-4e7609991885">How to use Material Design 3 Figma design kit (FAB)</a> was originally published in <a href="https://medium.com/design-bootcamp">Bootcamp</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to get a domain Name?]]></title>
            <link>https://medium.com/@dev.mstflotfy/domain-name-buying-guide-d8ee90ae320d?source=rss-1d1bf4cc031f------2</link>
            <guid isPermaLink="false">https://medium.com/p/d8ee90ae320d</guid>
            <category><![CDATA[web-design]]></category>
            <category><![CDATA[indiedev]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[domains]]></category>
            <category><![CDATA[website-design]]></category>
            <dc:creator><![CDATA[The indieDev]]></dc:creator>
            <pubDate>Tue, 22 Nov 2022 00:00:38 GMT</pubDate>
            <atom:updated>2023-01-20T08:31:06.918Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*eQDs9xmqolI09yg8.png" /></figure><p>If you want to create a website and you want people to take it seriously, you need a custom domain name.</p><h3>What is a domain Name?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/597/0*eZk89jnQS88H0uXZ.png" /></figure><p>It’s the address that people will type in the browser to visit your website. This site’s domain name is <a href="https://mstflotfy.com/"><strong>mstflotfy.com</strong></a></p><h3>How to get a domain Name?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7Y64sfyCXdwzJ8Wy.png" /></figure><p>You buy it.</p><p>Domain names are sold by websites called <strong>registrars</strong>.</p><p>When you go to a domain name registrar website’s main page, you’ll probably find a search bar, and you can search to see if the domain name you want is available.</p><p>You can buy a domain name for one or more years. Then you have to renew.</p><p>If you don’t renew, it enters a grace period, where the domain name will stop working. But the registrar gives you time to renew your domain name before they remove it.</p><h3>What to look for when buying a domain name?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4u-EZ4l9zOc6TRph.png" /></figure><p>Each domain name registrar offers different add-ons. Here are some extras you should look for:</p><h3>Whois guard</h3><p><a href="http://www.whoisguard.com/">Whois guard</a> is a service that hides your personal info (name, address, phone number, email), which is required from you when you register a domain name. This info is being made available publicly in the <a href="https://lookup.icann.org/en">WHOIS directory</a>! Spammers can then collect your info!</p><p>To prevent this, a Whois guard hides your info from being available to the public.</p><p>So Whois guard is an essential add-on that protects you from spammers and cyber criminals.</p><p>Domain registrars will offer Whois guard as an add-on, some ask you to pay an extra fee for it, but you should look for a registrar that offers it for free.</p><p>Here are some registrars that offer whois guard for free</p><ul><li><a href="https://www.namecheap.com/">Namecheap</a></li><li><a href="https://www.namesilo.com/">NameSilo</a></li><li><a href="https://porkbun.com/">porkbun</a></li><li><a href="https://www.cloudflare.com/products/registrar/">Cloudflare registrar</a></li></ul><p><strong>P.S.</strong> There are many other domain name registrars out there. I am not affiliated with any service mentioned here. I gain nothing from the links in this article. I am just sharing my experience. Also, you might decide to do more research and find more options out there that better suit your needs.</p><h3>Domain Name Price</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/310/0*H_GLzGesrhjYL9kQ.png" /></figure><p>Some domain name registrars offer low prices for your first year, like Namecheap and <a href="https://www.godaddy.com/">GoDadday</a>, and probably others. However, those initial prices last only for the first year, and the renewal prices will rise.</p><p>Choose a domain name registrar with reasonable renewable prices.</p><p>Registrars with Good renewal prices</p><ul><li><a href="https://www.cloudflare.com/products/registrar/">Cloudflare registrar</a></li><li><a href="https://porkbun.com/">porkbun</a></li><li><a href="https://www.namesilo.com/">NameSilo</a></li></ul><h3>SSL certificate</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/141/0*-pK0L5y1L47P-O-T.png" /></figure><h4>What is an SSL certificate</h4><p>The little lock in the browser, next to your website’s address.</p><p>It means that transactions on this website are secure. An SSL certificate encrypts data visitors send to your website and then decrypts it once it is received.</p><h4>Why should you care about SSL</h4><p>It makes your website trusted by customers and by search engines.</p><p>Even if it’s just a blog where no transaction happens. A “not secure” sign in the browser address bar next to your website’s address might hurt your brand and could negatively affect your website’s SEO.</p><p>So an SSL certificate is a must.</p><p>However, most website hosting services already provide one. I host my website on GitHub pages, and it provides an SSL certificate. I was using Namecheap and it doesn’t provide one for free, but I didn’t need to pay extra for it.</p><p>If your host doesn’t provide a free SSL certificate then you might want to choose a registrar that provides a free SSL certificate.</p><h4>Domain Name Registrars offering free SSL certificates</h4><ul><li>porkbun</li><li>Cloudflare</li></ul><h3>Email forwarding</h3><p>Email forwarding is not an essential feature, but it’s really nice to have.</p><p>Email forwarding allows you to set a custom email address that forwards to your current email. For example, I can set up an email: <a href="https://mstflotfy.com/cdn-cgi/l/email-protection">[email protected]</a> that I can give to people and when they send emails to it they will be forwarded to my free email service, saving me the cost of an email host.</p><p>However, when you send emails to people they will see that it’s coming from your Gmail, for example.</p><h4>Domain name registrars offering free email forwarding</h4><ul><li><a href="https://www.namecheap.com/">Namecheap</a></li><li><a href="https://www.cloudflare.com/products/registrar/">Cloudflare</a></li><li><a href="https://porkbun.com/">porkbun</a></li><li><a href="https://www.namesilo.com/">NamSilo</a></li></ul><h3>Which domain name registrar to choose</h3><p>Depends on what you need.</p><p>When I was first buying my website’s domain name (<a href="https://mstflotfy.com/"><strong>mstflotfy.com</strong></a>) I found the best deal with Namecheap; one of the cheapest prices available at that time, and with free Whois guard, free email forwarding, doesn’t provide a free SSL but I’m hosting my website at GitHub pages and it provides a free SSL.</p><p>Then each year the price of renewal kept rising. So I found a better deal at porkbun and transferred to it; reasonable renewal prices, free whois guard, free SSL (if needed), and free email forwarding.</p><p>Cloudflare also has the best prices, free whois, free SSL, free email forwarding, and more. But they do try to lock you into using their other services. If you want to use Cloudflare’s CDN anyways it’s fine. But if you choose <a href="https://www.cloudflare.com/products/registrar/">Cloudflare as your registrar you can’t change your nameservers</a>.</p><p>The best deal I found is at <a href="https://porkbun.com/"><strong>porkbun</strong></a> and <a href="https://www.cloudflare.com/products/registrar/"><strong>Cloudflare registrar</strong></a>. <a href="https://www.namesilo.com/"><strong>Namesilo</strong></a> is another option.</p><p>There are so many domain name registrars out there.</p><p>If the price is very critical to you, you can buy a domain name somewhere with a good initial year price ( <strong>NameCheap</strong> for example) and then transfer before the end of the year to a registrar with reasonable renewal prices. (like <strong>porkbun</strong> or Cloudflare registrar)</p><p>Also, some sites offer bulk discounts like <a href="https://www.namesilo.com/">NameSilo</a>.</p><h3>Does it need to end in .com</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/487/0*QmCfTqdL6_RwJdSK.png" /></figure><p>No.</p><p>A domain name can be available in many different extensions (TLDs); .com, .net, .dev, …</p><p>It doesn’t matter. However, if <strong>.com</strong> is available, buy it, just because people are most familiar with it. If not, just don’t buy an extension that is too unfamiliar as your visitors might think your website is untrustworthy.</p><h3>How to transfer your domain name</h3><p>Your current domain name registrar should have a docs page to show you the steps you need to take to transfer out of it. Here are the <a href="https://www.namecheap.com/support/knowledgebase/article.aspx/258/84/what-should-i-do-to-transfer-a-domain-from-namecheap/">official docs to move from Namecheap</a></p><p>Also, the registrar you want to go to should have documentation to transfer from other popular registrars. Here’s the one from <a href="https://kb.porkbun.com/article/88-how-to-transfer-a-domain-from-namecheap-to-porkbun">porkbun to move to them from Namecheap</a></p><h3>Here’s how I transferred my domain name from Namecheap to porkbun.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*IBtqsFVncDIO3JXp.png" /></figure><p>First, I followed <a href="https://www.namecheap.com/support/knowledgebase/article.aspx/258/84/what-should-i-do-to-transfer-a-domain-from-namecheap/">these official docs</a> by Namecheap.</p><p>Basically, the domain name transfer is locked by default. So I unlocked it, then I asked for an auth code (required by the other registrars to be able to transfer to them).</p><p>Then I received an email with the Auth code immediately.</p><p>I took it, went to pork bun, <a href="https://porkbun.com/transfer">found the transfer page</a>, added my domain name and Auth, registered, and paid for a one-year extension. The process was then stopped-awaiting for Namecheap to release my domain.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*aQR352uScmck7XWm.png" /></figure><p>The above triggered an email from Namecheap, telling me that if I don’t respond to this email, my domain will be transferred in 5 days automatically. But if I want to cancel it, I’m given a link, and if I want to make the process immediate, I’m given another link to do so.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ZX9ITUQx6GtcSmy_.png" /></figure><p>I clicked on the SPEED UP link and confirmed my transfer. In a couple of minutes, it was done.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*MPtmPAYFllhEOrbi.png" /></figure><p>The remaining time for your domain name will be transferred, and one year will be added. Check the registrar’s rules. If you transfer a couple of days before your current domain name expires, you should have no problems.</p><p>It’s generally the same process transferring from and to other registrars.</p><h3>Refs</h3><ul><li><a href="https://docs.ukfast.co.uk/domains/domains/faqs/what-is-a-domain-grace-period.html">What is a domain grace period</a></li><li><a href="https://kb.porkbun.com/article/55-if-i-transfer-a-domain-to-porkbun-will-i-lose-any-existing-months-or-years-of-registration">If I transfer a domain name to porkbun will I lose any existing months or years of registration</a></li><li><a href="https://developers.cloudflare.com/registrar/get-started/transfer-domain-to-cloudflare">Transfer a domain name to Cloudflare</a></li><li><a href="https://lookup.icann.org/en/lookup">Whois Database Lookup</a></li></ul><h3>Related Articles</h3><ul><li><a href="https://mstflotfy.com/dev/how-to-start-a-blog">How to start a blog</a></li></ul><p><em>Originally published at </em><a href="https://mstflotfy.com/dev/domain-name-guide-2022"><em>https://mstflotfy.com</em></a><em> on November 22, 2022.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d8ee90ae320d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Figma to HTML & CSS — How I coded my first website]]></title>
            <link>https://medium.com/design-bootcamp/figma-to-html-css-how-i-coded-my-first-website-90b76a12e670?source=rss-1d1bf4cc031f------2</link>
            <guid isPermaLink="false">https://medium.com/p/90b76a12e670</guid>
            <category><![CDATA[css]]></category>
            <category><![CDATA[html]]></category>
            <category><![CDATA[web-design]]></category>
            <category><![CDATA[figma]]></category>
            <category><![CDATA[design]]></category>
            <dc:creator><![CDATA[The indieDev]]></dc:creator>
            <pubDate>Sat, 27 Aug 2022 00:00:29 GMT</pubDate>
            <atom:updated>2023-02-26T17:16:39.325Z</atom:updated>
            <content:encoded><![CDATA[<h3>Figma to HTML &amp; CSS — How I Turned My Figma Design To Code</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yJD9AZsQ7luX2G25.png" /></figure><p>In this article, I want to show you how I took a Figma design and turned it into a live website using HTML &amp; CSS. And finally deployed it with Jekyll and GitHub pages.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F2U750Bd3CbM%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D2U750Bd3CbM&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F2U750Bd3CbM%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/8f2cc5aab08706ae6a7fe59e845da647/href">https://medium.com/media/8f2cc5aab08706ae6a7fe59e845da647/href</a></iframe><p>I am documenting the lessons I come across while I work on building my own indie apps.</p><p>As an exercise to learn Figma, I redesigned my website.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*R7wsh2jl5trcft5v.png" /></figure><p>I implemented this Figma design into my website.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/842/0*PXhhyPJZK3oXMyw_.png" /></figure><p>You can see the <a href="https://www.figma.com/community/file/1051279558347794166">Figma design file here</a>, and if you’re not already there, <a href="http://mstflotfy.com/">you can visit the live website here</a>.</p><p>Also, here’s a <a href="https://github.com/mstflotfy/mstflotfy-redesign-exercise/tree/main">GitHub repo of the HTML &amp; CSS</a> as I plan a more deliberate remake of my website soon.</p><p><strong>This is not a step-by-step guide</strong>, just documenting the main steps I took and the thought process. However, more practical lessons will be coming soon.</p><h3>Step 1 — Designing An Entire Website In Figma</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*sWZpv15dxHvZhzFf.png" /></figure><p>This is the starting point.</p><p>I have already gone through how I designed the website in 2 previous videos.</p><p>In <a href="https://youtu.be/LTmHoRJLcuY">this first video</a> I quickly went through the general process, then in <a href="https://youtu.be/euXzyxr_d6A">the second</a> you can find a step-by-step guide, starting from scratch. In brief: It is not an ideal well-thought start. It started as an exercise to practice making designs in Figma. Then I took it a bit further into a full redesign of my website. I heavily used Figma’s auto-layout and components.</p><p>In this <a href="https://www.figma.com/community/file/1051279558347794166">Figma Community file</a>, you can find the final design.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*GACgqoewwStcBH8x.png" /></figure><p>As for responsiveness, I made three designs; for desktop, tablet, and mobile. Then I figured out the in-between sizes while I was coding.</p><p>In this case, I think this was good enough. In a previous video, I explored how to create a fully responsive design in Figma using breakpoints. You can have a look at it <a href="https://youtu.be/3KUZ3o0ddcE">here</a>.</p><p>So basically, I didn’t start from scratch. I had a Figma file with components and pages.</p><h3>Step 2- Prep The Figma File For Coding</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*oY3lThUYW06gmydC.png" /></figure><p>I was itching to jump straight into code.</p><p>But, I decided to first research how to go from Figma to code.</p><p>I came across 2 keywords; <strong>developer handover</strong> and <strong>design systems</strong>. Those need to be explored on their own. But I decided to keep things simple.</p><p>Before I started, I wanted to make a basic design system and name components and elements consistently.</p><h3>Design System</h3><p>I realized I had to think deliberately about many things, including typography, color, spacing between components, pages, and assets, …</p><p>I already had most of those things somewhat in place. I had components for everything I used across the pages that I made.</p><p>Yet, after a closer look, I found many inconsistencies, especially with color, typography, and spacing.</p><p>So I made a simple typography scale, then experimented and adjusted it a bit to fit the design.</p><p>Also, I limited the color palette. And tried to use it consistently across elements and pages.</p><p>Finally, I had to think of readability. I used <a href="https://color.adobe.com/create/color-contrast-analyzer">Adobe Color’s Contrast Checker</a> to do this. This made me change the color slightly for some fonts and adjust the type scale to make sure smaller font sizes are readable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*lBgYJbS-QxA1q-6B.png" /></figure><h3>Naming Components And Elements</h3><p>I wanted to name components and elements in a consistent way across the design and code.</p><p>So instead of coming up with my own naming system, I decided to try BEM.</p><p><a href="https://css-tricks.com/bem-101/">BEM</a> (Block, Element, Modifier) is a naming convention for classes in HTML and CSS.</p><p>I think I didn’t do the best job with naming. Generally, I treated components as blocks, the items inside components as elements, and component variants as modifiers.</p><p>For example, the header’s default component will have a class <strong>header</strong>. The list of links inside it will be an element with a class <strong>header__link-list</strong>. And the header’s mobile variant will have a class <strong>header-mobile</strong>.</p><p>While it might seem straightforward, sometimes there will be elements inside elements and other independent components inside your component. This opens the room for interpretation, and different people handle it differently.</p><p>Again with naming, I wasn’t consistent enough, so next time I need to think this through and do a cleaner job.</p><p>In this <a href="https://www.figma.com/community/file/1144516865792093918">Figma Community file</a>, you can find the final design after making the changes.</p><h3>Step 3-Turning the Figma design into HTML</h3><p>I laid out the <a href="https://developer.mozilla.org/en-US/docs/Learn/HTML/Introduction_to_HTML/Getting_started#what_is_html">HTML</a> structure for each page, starting with the landing page and focusing only on the desktop design.</p><p>Tried my best to use <a href="https://developer.mozilla.org/en-US/docs/Glossary/semantics#semantics_in_html">semantic HTML</a> and minimize the use of <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/div">divs</a>, but of course, I sometimes had to resort to them.</p><p>Also, I tried to give elements class names matching the naming in the <a href="https://www.figma.com/community/file/1144516865792093918">Figma file</a>.</p><p>I laid out the HTML structure for all the pages then I moved to <a href="https://developer.mozilla.org/en-US/docs/Learn/CSS/First_steps/What_is_CSS">CSS</a>.</p><p>Using <a href="https://code.visualstudio.com/">Visual Studio Code</a> and installing the <a href="https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer">live server extension</a>, I used a local server to see the live changes while I coded.</p><h3>Step 4- Styling With CSS</h3><p>I started by setting some <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_custom_properties">CSS variables</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/801/0*4-JFyjiPq_JkL3VL.png" /></figure><p>I used the styles that I set in the <a href="https://www.figma.com/community/file/1144516865792093918">Figma file</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/237/0*T3rrFawA_7Z6FyP2.png" /></figure><p>Then I finished styling all the pages for the desktop design, intentionally ignoring responsiveness.</p><p>After I finished, I added media queries to target different screen widths.</p><p>I started targeting smaller screens, then I tackled larger screen sizes.</p><p>Mainly targeting elements using classes, I tried to minimize other selectors but sometimes had to resort to them.</p><p>I also used Figma’s “Inspect panel”, It’s not a copy-and-paste solution, but it helped a lot.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*fc7o9qX_ciRGc4Is.png" /></figure><p>Having the fonts set using rem instead of pixels helped make this easier.</p><p>I didn’t use any JavaScript code.</p><p>I jumped back and forth between HTML and CSS and looked up some CSS tricks to show and hide elements using CSS only.</p><p>Finally, I had yet another prototype. But in HTML and CSS instead of Figma.</p><p>To actually deploy the website, I had to find a way to integrate this HTML and CSS into my actual Jekyll website.</p><h3>Step 5- Integrating The HTML &amp; CSS into Jekyll</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*cGEOMqxfszEoeJHw.png" /></figure><p><a href="https://jekyllrb.com/">Jekyll</a> is a static site generator. I use Jekyll so that I can write my articles in <a href="https://en.wikipedia.org/wiki/Markdown">Markdown</a>, push them to GitHub, and the changes would go live.</p><p>My website was already running using the <a href="https://github.com/jekyll/minima">Jekyll minima theme</a>, which I had <a href="https://github.com/git-guides/git-clone">cloned</a> and deployed on <a href="https://pages.github.com/">GitHub pages</a> (where I host my website).</p><p>I already knew how Jekyll generally works. I didn’t go too deep into it, and I don’t want to. I just needed to figure out how to place my HTML and CSS with minimal changes.</p><h3>Step 6- Deploy &amp; Test</h3><p>While setting things up in Jekyll, I tested locally on many different browsers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*kR_0dGN_MccqUVdU.png" /></figure><p>When I got decent results, I committed the changes and pushed them to the GitHub repo hosted on GitHub pages. In a couple of minutes, it was up and running.</p><p>Next, I tested the website on every device I could find.</p><h3>Step 7- Fix Issues</h3><p>I didn’t find many issues as I already tested locally first. But trying the website on different browsers on different devices brought up new problems.</p><p>I fixed some issues that can’t be ignored, but the things that could wait, I noted and decided to fix things incrementally when I have the energy for them.</p><p>Every time I visit the website, I keep making little improvements testing locally, and then pushing to the GitHub repo.</p><h3>Other articles you might want to read</h3><ul><li><a href="https://mstflotfy.com/dev/how-to-start-a-blog/">How To Start A Blog</a></li><li><a href="https://mstflotfy.com/dev/command-line-very-beginner/">An Introduction To The Command Line</a></li></ul><p><em>Originally published at </em><a href="https://mstflotfy.com/design/figma-to-code-html-css"><em>https://mstflotfy.com</em></a><em> on August 27, 2022.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=90b76a12e670" width="1" height="1" alt=""><hr><p><a href="https://medium.com/design-bootcamp/figma-to-html-css-how-i-coded-my-first-website-90b76a12e670">Figma to HTML &amp; CSS — How I coded my first website</a> was originally published in <a href="https://medium.com/design-bootcamp">Bootcamp</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Learn Figma by making a card component]]></title>
            <link>https://medium.com/design-bootcamp/learn-figma-by-making-a-card-component-86550d681770?source=rss-1d1bf4cc031f------2</link>
            <guid isPermaLink="false">https://medium.com/p/86550d681770</guid>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[figma]]></category>
            <category><![CDATA[design]]></category>
            <category><![CDATA[ux]]></category>
            <category><![CDATA[ui]]></category>
            <dc:creator><![CDATA[The indieDev]]></dc:creator>
            <pubDate>Sat, 18 Jun 2022 00:00:00 GMT</pubDate>
            <atom:updated>2022-06-24T05:10:37.317Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="2 Figma components made up of negatively stacked cards presented inside a MacBook" src="https://cdn-images-1.medium.com/max/1024/0*fuMV0Sj2kTCa80jf.png" /></figure><p>In this article, I want to show you how I used <strong>auto layout</strong> and <strong>components</strong> to recreate the pin stack you see above (from the Pinterest design) in Figma.</p><p>I broke this down into 12 mini-steps:</p><ol><li><a href="#7308">Grab screenshots to have quick in-page references.</a></li><li><a href="#0e48">Inspect Pinterest’s code to get precise measurements for the design elements.</a></li><li><a href="#ebd2">Install the Unsplash plugin and add an image.</a></li><li><a href="#bb2c">Set the image properties</a></li><li><a href="#2403">Add an auto-layout frame (a container for the images)</a></li><li><a href="#79c6">Add 2 text boxes and set their properties</a></li><li><a href="#2e8a">Turn it into a component</a></li><li><a href="#bb3b">Add text component properties</a></li><li><a href="#0012">Add an icon (boolean) component property</a></li><li><a href="#c368">Take instances of the component</a></li><li><a href="#d51f">Add a hover variant</a></li><li><a href="#3221">Present and test the design</a></li></ol><p>You can also watch it on <a href="https://www.youtube.com/c/mstflotfyindieDev">YouTube</a>. And <a href="https://www.figma.com/community/file/1119848425895842486">Here’s the final Figma file</a>.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FpHuh--cYx9o%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DpHuh--cYx9o&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FpHuh--cYx9o%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/b001a10ef0480c102773a50f38ddb7e3/href">https://medium.com/media/b001a10ef0480c102773a50f38ddb7e3/href</a></iframe><h3>1 Take screenshots for reference</h3><p>I’m making a <a href="https://www.youtube.com/playlist?list=PLsOexrcoU3Q4b-dI6chgagDntDD-AgetO"><strong>Pinterest Clone in Figma</strong></a> as an exercise to work on developing an eye for good <strong>Ui &amp; Ux</strong>.</p><p>So, I started by heading to the Pinterest website and grabbing screenshots of the parts of the design I am going to copy.</p><p><em>If you’re using a Mac you can take a screenshot by pressing </em><strong><em>cmd shift 4</em></strong><em>, then select the area you want in your screenshot. A neat trick I recently learned is pressing and holding the </em><strong><em>ctrl key</em></strong><em> while making the selection and the image will be copied to your clipboard. Then you can head to Figma and just press </em><strong><em>cmd v</em></strong><em> and you’re done!</em></p><figure><img alt="2 screenshots of multiple cards with text below them, inside a Figma file." src="https://cdn-images-1.medium.com/max/1024/0*-5Nj_Hi94CUlbiGs.png" /></figure><p>Open a <strong>new Figma draft</strong> design file, and paste the screenshots.</p><p>We want to make 2 card stacks that are almost identical except that they have different text, and one has a lock icon above it.</p><p>The second screenshot shows the hover state. It’s hard to see in the screenshot but there is a subtle difference on hover that makes the card stack just a tiny bit darker.</p><h3>2 Inspect code for precise measurements</h3><p>Since this is just an exercise you can size elements just by eying them, which I always do for exercises. But I found it insightful to dig in and have a look at the actual sizes of the elements.</p><figure><img alt="Right-clicking on the card stack and selecting Inspect from the menu." src="https://cdn-images-1.medium.com/max/1024/0*0QQEWCV7-NCSm7QO.png" /></figure><p>All you need to do is head to your browser, <strong>right-click</strong>, and select <strong>“Inspect”</strong></p><figure><img alt="Page is split between code and Pinterest’s board page" src="https://cdn-images-1.medium.com/max/1024/0*1bi4axiZRhLmGbvn.png" /></figure><p><strong>Code</strong> will appear next to the page (which might seem intimidating if you’re not used to code, but we’re just grabbing some measurements).</p><p>Press on the <strong>“select an element in the page to inspect it”</strong> icon.</p><figure><img alt="Label above image that shows size" src="https://cdn-images-1.medium.com/max/424/0*YkdUiTT9lMwNACkH.png" /></figure><p>Hover above the first image in the stack and its size will show up above it<strong> (116px * 155px)</strong>.</p><figure><img alt="css code showing the image has a border-radius of 16px" src="https://cdn-images-1.medium.com/max/1024/0*XHF4cZ1AQXmzjPr1.png" /></figure><p>The code on the right side shows us 2 things; <strong>elements</strong> and <strong>style</strong>.</p><p>Elements (the code above) is the <strong>HTML</strong>; the structure of the page; the elements the page is made up from. The HTML you see here is all the HTML for this page.</p><p>Style (the code below) is the <strong>CSS</strong> (the style and looks of the elements on the page). The CSS you see below the HTML is only the style of the HTML element you select. So to find the style of an element you must select it first.</p><p>We already know the dimensions of the image, now we want to know the <strong>corner radius</strong>. In CSS corner radius is called <strong>border-radius</strong>.</p><p>We can manually look through the CSS code and look for border-radius, but there’s too much CSS code. Above the CSS code, there’s a <strong>filter</strong> text box. Write <strong>radius</strong> or <strong>border-radius</strong> in it.</p><p>It might show no result! Even though it clearly has a border radius!</p><p>You’ll see inside the HTML code many lines that start with &lt;div. You can think of a <strong>div</strong> as a Figma frame. It wraps around and holds other elements, including other frames or divs. So the corner radius might not be applied to the element directly but to another frame that is holding it.</p><p>So keep selecting the line above in the HTML code until your filter gives you a result. Just going a couple of <strong>divs</strong> up will show you the value of the border-radius property ( border-radius: 16px;).</p><figure><img alt="Pinterest’s board page. image stack’s code is selected and its dimension are shown (236*157px)" src="https://cdn-images-1.medium.com/max/1024/0*zCsLd5gqktB8wp8R.png" /></figure><p>Keep going upwards through the divs in the code till the stack of images only is highlighted and get its width and height. The dimensions will pop up above it when you select its code. <strong>(236 * 137 px)</strong></p><figure><img alt="whole component code inspected" src="https://cdn-images-1.medium.com/max/1024/0*BwBuTsWHnYI3hPnI.png" /></figure><p>Then get the width and height of the <strong>full component(236 * 215 px)</strong>.</p><figure><img alt="Main text’s code inspected" src="https://cdn-images-1.medium.com/max/466/0*NhDKuCVwlWnBDqt1.png" /></figure><p>Finally, select the main text and get its <strong>font size (20px)</strong>.</p><figure><img alt="inspector open and hovering above text" src="https://cdn-images-1.medium.com/max/399/0*BDwN1vP6Y5Ei6PSg.png" /></figure><p>And the font size of the secondary text <strong>(12px)</strong>.</p><figure><img alt="hovering above icon while the inspector is open and dimensions are shown" src="https://cdn-images-1.medium.com/max/323/0*Ie2cnShtNfwAlzuo.png" /></figure><p>One last thing we need to grab is the dimensions of the lock icon (<strong>32 * 32 px</strong>).</p><figure><img alt="Inspector code on the right page on the left drop-down open with devices to select from" src="https://cdn-images-1.medium.com/max/1024/0*VynNNbsH4jC2xEdg.png" /></figure><p>If you’re wondering about the point of getting precise measurements when the sizes will change when the device size changes, they won’t.</p><p>The way Pinterest handles responsiveness is they keep the elements’ sizes the same but the grid holding the elements changes. More elements are added horizontally when the size increases and elements are removed when the device’s width gets smaller.</p><p>You can see this if you open the toggle device toolbar and change to a smaller device, all the sizes we took are the same, even the text! but the grid adapts by presenting fewer columns</p><h3>3 Grab an image from Unsplash</h3><p>We need an image to work with so grab one from <strong>Unsplash</strong>.</p><p>Instead of going to <a href="https://unsplash.com/">Unsplash.com</a> searching for an image, download it, uploading it into Figma, then doing this for all the other images we’ll need later, just <a href="https://www.figma.com/community/plugin/738454987945972471/Unsplash">install the Unsplash Figma plugin</a>.</p><figure><img alt="A search bar over the Figma canvas with Unsplash written in it" src="https://cdn-images-1.medium.com/max/1024/0*Kt7VohwQnQqHqjM9.png" /></figure><p>To quickly open the Unsplash plugin (or any other plugin), get the quick access menu by pressing <strong>cmd /</strong> or <strong>cmd p</strong> (probably “<strong>ctrl p</strong>” for windows), write <strong>Unsplash, </strong>and press <strong>Enter</strong>, and it will open.</p><figure><img alt="Unsplash plugin hovering above figma’s canvas and image dropped inside the canvas" src="https://cdn-images-1.medium.com/max/1024/0*gpJ_Xr0h5oJdl2kk.png" /></figure><p>Select any image and it will be dropped into your canvas.</p><h3>4 Set image properties</h3><figure><img alt="Image zoomed-in, given rounded corners, width, and height" src="https://cdn-images-1.medium.com/max/1024/0*fKSYg_AxcjHQH0KK.png" /></figure><p>Select the image and give it the dimensions we grabbed from the inspector earlier; a <strong>width</strong> of <strong>116px</strong> and a <strong>height</strong> of <strong>155px</strong>. And give it a <strong>16px corner radius</strong>.</p><h3>5 Auto layout frame (Images Container)</h3><p>According to our in-page reference (the screenshot), we want to have 4 images stacked on top of each other.</p><p>We’ll start by adding an <strong>auto-layout frame</strong> around our image, this frame will be the container for all 4 images.</p><figure><img alt="Image wrapped in an auto-layout frame" src="https://cdn-images-1.medium.com/max/1024/0*WvAMJTe3grRWcz3W.png" /></figure><p>Select our image and press <strong>Shift A</strong>, this will add an <strong>Auto layout</strong> frame around it.</p><p>I renamed this auto-layout frame to <strong>“images”</strong> to keep the layers panel organized and readable.</p><p><em>When using Figma forget about using rectangles and putting elements inside them (just like you would with a classic graphic design app). Figma has a tool for wrapping other elements called frames. A frame is like a container for your elements, a bit like an HTML </em><strong><em>div</em></strong><em> element. For example, a webpage can be a frame with 3 frames inside it; header, main, and footer. The header has a home button, this can be a frame as well, and so on.</em></p><p><em>There are 2 types of frames in Figma; </em><strong><em>regular frames</em></strong><em> and </em><strong><em>auto-layout frames</em></strong><em>. </em><strong><em>Regular frames</em></strong><em> allow you to layout the elements inside it freely, while </em><strong><em>auto-layout frames</em></strong><em> have more specific values to manage the alignment of the elements inside it, this speeds up your workflow for the majority of cases where elements are laid out in an ordered manner. So </em><strong><em>use auto-layout frames whenever possible</em></strong><em>.</em></p><figure><img alt="auto layout padding removed. Frame wrapping around the image with no extra padding." src="https://cdn-images-1.medium.com/max/1024/0*EuaZoaRPq77Ip74R.png" /></figure><p>The auto-layout frame has padding by default, so remove it, by setting All paddings to<strong> 0px</strong>.</p><figure><img alt="4 images inside an auto-layout frame" src="https://cdn-images-1.medium.com/max/1024/0*5OOUwI25CvhcXyvm.png" /></figure><p>To add the other 3 images select the image inside the auto layout frame, and press <strong>cmd c, </strong>then press <strong>cmd v</strong> 3 times. Our auto-layout frame is set in the <strong>horizontal direction</strong> so the images will be next to each other, just what we want.</p><figure><img alt="Unsplash plugin open and image changed" src="https://cdn-images-1.medium.com/max/1024/0*8j3nA2ecdmG7o_kY.png" /></figure><p>Bring up the Unsplash plugin again, and change the images. Select the image you want to replace in the design, and once you click on an image in the Unsplash plugin it will replace it.</p><figure><img alt="4 different images stacked on top of each other" src="https://cdn-images-1.medium.com/max/1024/0*20iP_60-KB3EGJWV.png" /></figure><p>To make the images stack on top of one another, set the distance between them to a negative number.</p><p>The width we took from the inspector for the image container is <strong>236px</strong>, so keep reducing the “<strong>Spacing between items” </strong>property until the width of the whole frame is exactly <strong>236px</strong>.</p><figure><img alt="image stacked on top of one another first on top from the left" src="https://cdn-images-1.medium.com/max/1024/0*28x1nRGa4wABWXwQ.png" /></figure><p>The order of our images is wrong, the last image is on top. We want the first to be on top.</p><p>Press on the 3-dotted icon, in the <strong>Design</strong> panel (at the Auto layout settings section) to go to “<strong>auto-layout advanced settings”</strong>. And change the “<strong>Canvas stacking”</strong> to <strong>“First on top”</strong>.</p><figure><img alt="Zoom in on card stack reference shows a white border around images" src="https://cdn-images-1.medium.com/max/816/0*0eLNkEP3SDO2PNVy.png" /></figure><p>Also, our image stack is a bit hard to look at, as nothing separates the images.</p><p>Looking back at the reference you can see that each image has a <strong>white border</strong> around it.</p><figure><img alt="image CSS shows a solid white border of 1px" src="https://cdn-images-1.medium.com/max/285/0*zojTFRvJks0zUhgW.png" /></figure><p>Inspecting the code again, I found a property of the image that we missed. It has a <strong>1px white border</strong> around it.</p><figure><img alt="4 negatively stacked images inside Figma each with a solid white stroke of 1px." src="https://cdn-images-1.medium.com/max/1024/0*sfhv6o8jLDkuQHBv.png" /></figure><p>To select all 4 images at the same time, select the <strong>“images</strong> <strong>frame”</strong> and press <strong>Enter</strong>. At the design panel, go to strokes and press on the <strong>+</strong> icon next to it to add a stroke around each image. Give it a <strong>white color</strong>. The default size is 1 pixel already.</p><h3>6 Add text to your component</h3><p>We grabbed the font size from the inspector earlier, but not the font weight so I went back in and got it.</p><figure><img alt="inspecting the main text code in Pinterest shows a font-weight property that has a value of bold." src="https://cdn-images-1.medium.com/max/282/0*ZmzJgRxbBfU_HAe-.png" /></figure><p>The font-weight for the main text is <strong>bold</strong>.</p><figure><img alt="inspecting secondary text show it has a value of normal" src="https://cdn-images-1.medium.com/max/328/0*7HzpcDYoHJRkTawA.png" /></figure><p>And the font weight for the secondary text is normal/<strong>regular</strong>.</p><figure><img alt="2 text box added in Figma under the image stack, but not in a frame with it. The main text is bold with 20px. Secondary text is regular with 12px. Both use a Roboto font" src="https://cdn-images-1.medium.com/max/1024/0*rrJc18lzgTpJsLRL.png" /></figure><p>Add 2 text boxes and set the <strong>“main text (All Pins)”</strong> to <strong>20px</strong>, <strong>Roboto</strong>, <strong>bold</strong>, and the <strong>“secondary text”</strong> to <strong>Roboto</strong>, <strong>12px</strong>, <strong>regular</strong>.</p><p>To add a text box press on the <strong>T</strong> key to grab the text tool, then press on the canvas and a text box will be added.</p><figure><img alt="Pinterest boards page with code inspector open. The div holding the text is highlighted and its dimensions are “236*50”" src="https://cdn-images-1.medium.com/max/1024/0*FhexuS-pDqLf72an.png" /></figure><p>In Figma, we’ll group the 2 text boxes, by adding an auto-layout frame around them.</p><p>In the code, the same thing is happening; the main and secondary texts are grouped inside an HTML div element.</p><p>I found this element and inspected its code to see what properties this frame will have. It has an <strong>8px</strong> padding in all directions (top, bottom, right, and left).</p><p>Also, the text’s div/frame has a<strong> height of 59px</strong>.</p><figure><img alt="2 text boxes inside an auto-layout frame, aligned left, with 8px padding." src="https://cdn-images-1.medium.com/max/1024/0*OJHMsngTitX-Ptd-.png" /></figure><p>Select the 2 text boxes then press “<strong>Shift A</strong>” to add an <strong>auto-layout</strong> frame around them.</p><p>In the design panel, under <strong>auto-layout</strong> settings, give the frame a padding of “<strong>8px</strong>”. Then change the “<strong>distance between items</strong>” till the height of the frame is <strong>59px</strong>.</p><p>I named this frame “<strong>text</strong>” to keep the layers panel organized.</p><figure><img alt="![auto-layout frame around cards frame and text frame, with no padding, and a height of 215px" src="https://cdn-images-1.medium.com/max/1024/0*_n3_9PzEJlLPwKVY.png" /></figure><p>Then to wrap everything in a frame I select the “<strong>images frame”</strong> and the <strong>text frame</strong> and press <strong>Shift A</strong> to add another <strong>auto-layout</strong> frame around everything. And name it “<strong>card”</strong>.</p><p>Also, adjust the <strong>distance between items</strong> inside the <strong>card frame</strong> till the height of it is <strong>215px</strong>.</p><h3>7 Create a component</h3><p>We’ll turn the card into a component, this will allow us to take many instances of it. And if we update our component all the instances will be updated.</p><p>By turning the card into a component we can also make a hover variant for it and prototype our component.</p><figure><img alt="card is selected and hovering above Create component button" src="https://cdn-images-1.medium.com/max/1024/0*9tUnlS-9bQTl718c.png" /></figure><p>To turn the “<strong>card frame</strong>” into a component, select it and press the <strong>create component</strong> button at the top of the page.</p><figure><img alt="mouse hovering above the component icon in the layers panel, while the new component is selected." src="https://cdn-images-1.medium.com/max/1024/0*_Y2jSqgGj3V1gnaa.png" /></figure><p>Notice how the icon of the frame changed to the component icon in the layers panel and also to a <strong>purple color</strong> to make it distinct from normal elements.</p><h3>8 Text component properties</h3><p>Next, we’ll add <strong>component properties</strong>. We’ll start by adding <strong>text component properties</strong>.</p><p><strong>Component properties</strong> are a part of <a href="https://mstflotfy.com/design/figma-new-update-2022/"><strong>Figma’s new update (config 2022)</strong></a>. Using them makes <strong>customizing instances</strong> of your components easier and faster, and will allow you to <strong>use fewer variants</strong>.</p><figure><img alt="All pin (main text) is selected and mouse hovering above Apply text property icon in the Design panel." src="https://cdn-images-1.medium.com/max/1024/0*UyEyCPv0TpDH3bXd.png" /></figure><p>To set a <strong>component property</strong>, select the element you want to turn into a customizable/editable property, in this case, it’s the <strong>main text (All Pins)</strong>.</p><p>In the “design panel”, next to “content”, press on the <strong>Apply text property</strong> icon.</p><figure><img alt="Create component property pops up above the page. property is named: Text, with a value of All Pins. Mouse-hovering above the “create property” button" src="https://cdn-images-1.medium.com/max/1024/0*58XRrBn-eBTp3itB.png" /></figure><p>You’ll be prompted to give your new component property a name and a default value, after you do, click on <strong>Create property</strong>.</p><figure><img alt="secondary text (1, 851 Pins) is selected, create text property icon is clicked, a drop-down menu is shown, and pointer hovering above create property" src="https://cdn-images-1.medium.com/max/1024/0*qimGvRXwkXBkVehP.png" /></figure><p>And the same goes for the secondary text<strong> (1,851 Pins)</strong>.</p><h3>9 Add a boolean property to show/hide an icon</h3><p>Normally I just quickly grab icons from one of the icons plugins in Figma, but I couldn’t find this one. So instead of searching for it online, or recreating it in Figma, I just went to the icon in Pinterest and grabbed its <strong>SVG code</strong>.</p><p><a href="https://developer.mozilla.org/en-US/docs/Web/SVG"><em>SVG</em></a><em> stands for scalable vector graphics. It’s used to display vector graphics for the web.</em></p><figure><img alt="Pinterest boards page is shown. Code inspector is open on the right. SVG icon is selected to be copied" src="https://cdn-images-1.medium.com/max/1024/0*rUFfu1ShoGmvTvTT.png" /></figure><p>Go to <strong>Pinterest’s “boards page”</strong> and <strong>right-click</strong> on the <strong>lock icon</strong> and select <strong>inspect</strong>. The SVG HTML tag of the icon should be highlighted. Copy it by pressing Cmd/Ctrl C.</p><figure><img alt="svg icon pasted in Figma under the card component" src="https://cdn-images-1.medium.com/max/1024/0*Xtl-L4UAnbDLMHHB.png" /></figure><p>Paste it inside your Figma File by pressing <strong>cmd/ctrl v</strong>.</p><figure><img alt="svg icon’s frame turned into an auto-layout, and width and height are set to fixed." src="https://cdn-images-1.medium.com/max/1024/0*5VE472U1CR3_uNcZ.png" /></figure><p>Leave the width and height of the vector as they are.</p><p>We want the <strong>frame</strong> around the vector to have a <strong>rounded white fill</strong>.</p><p>So turn the frame around the icon into an <strong>auto-layout frame</strong> by selecting it and pressing <strong>Shift A. </strong>And, set the icon resizing to <strong>fixed horizontally and vertically</strong>, so its size won’t change when we resize the frame.</p><p>You can also select the icon and set its <strong>constraints</strong> to center and center then you won’t need to turn the frame into an auto-layout frame.</p><p><em>To easily select all the items inside a frame (a regular frame or an auto-layout frame), select the frame and press </em><strong><em>Enter</em></strong><em>. In our case, by selecting the frame of the icon and pressing </em><strong><em>Enter</em></strong><em>, we can quickly select and edit the vector inside it.</em></p><figure><img alt="Lock icon selected" src="https://cdn-images-1.medium.com/max/1024/0*uBAMm1su8dKnyRtK.png" /></figure><p>Change the frame’s width and height to <strong>32px</strong> (The size we got for the icon earlier). Then set it to <strong>center alignment</strong>, to center the vector inside it.</p><figure><img alt="lock icon with white circular background" src="https://cdn-images-1.medium.com/max/1024/0*Y_xfAOLLArH_wi5O.png" /></figure><p>Give the icon’s frame a fill and rounded corners.</p><p>To add a fill press on the <strong>+</strong> icon, next to <strong>Fill</strong>, inside the <strong>Design panel</strong>, and set the color to <strong>white</strong>.</p><p>In the <strong>design panel</strong>, <strong>Frame</strong>, give the frame <strong>100px</strong> <strong>rounded corners</strong>, to turn it into a circle.</p><figure><img alt="lock icon inside the image stack frame and selected" src="https://cdn-images-1.medium.com/max/1024/0*q7iQTlCwI60UzOp4.png" /></figure><p>Drop the icon into our component, inside the <strong>“images frame”</strong>. It will go next to the images and push them out of place. We want it to be above the images.</p><figure><img alt="Lock icon above the image stack and cursor hovering above absolute position." src="https://cdn-images-1.medium.com/max/1024/0*H4gzaHb-8HvBPd7E.png" /></figure><p>We’ll easily make it hover above the images inside the “<strong>images frame</strong>” by selecting it and pressing on the new Figma feature: <strong>absolute position, </strong>inside the Frame setting in <strong>the design panel</strong>.</p><p><em>Absolute position is a part of Figma’s latest update. It allows an element to be a part of an auto-layout frame, but we can set it freely with a fixed position inside the frame. So it’s still grouped with the elements of its frame but it doesn’t need to follow its positioning and alignment rules.</em></p><figure><img alt="margin-left: 16px;" src="https://cdn-images-1.medium.com/max/397/0*ATe522hY_acdYx_y.png" /></figure><figure><img alt="margin-top: 16px;" src="https://cdn-images-1.medium.com/max/196/0*ahYpRqtfk7o7n6Mb.png" /></figure><p>To get a precise position for the icon inside the card frame I went back and inspected the code and found that it has a <strong>margin-left of 16px</strong>, and a <strong>margin-top of 16px</strong>.</p><figure><img alt="icon above image stack with 16 px top and left between it and the frame" src="https://cdn-images-1.medium.com/max/1024/0*qIfc7rejKtISXauR.png" /></figure><p>Translating this in Figma, just give the element an <strong>x</strong> and <strong>y</strong> positions of <strong>16px</strong> inside the “images frame”.</p><figure><img alt="icon selected and cursor hovering above Add boolean property icon" src="https://cdn-images-1.medium.com/max/1024/0*FjX8EQAHSNKpMdO9.png" /></figure><p>Now to create a component property to toggle this image on and off in our instances, select the icon, and inside the design panel, next to “<strong>Layer</strong>” press on the <strong>create boolean property icon</strong>.</p><p><em>Boolean properties are used to show and hide any layer inside your component.</em></p><figure><img alt="Create component property box pops above page to name property" src="https://cdn-images-1.medium.com/max/1024/0*ryedxlJjNXGi4bX4.png" /></figure><p>And, you’ll be prompted to give your new property a <strong>name</strong> and <strong>value</strong>.</p><p>I set it to <strong>False</strong> (hidden) by default, but it doesn’t matter much.</p><h3>10 Take instances of the component</h3><p>Let’s try out our component properties.</p><p>We’ll start by adding a frame. This frame will be the container for our design. It represents the webpage where the design is viewed.</p><p>To present a design it must be inside a frame. I selected a <strong>Macbook pro 14&#39;’</strong> as the size of the frame but you can select any other device or make a custom-size, it doesn’t matter much in our case.</p><figure><img alt="frame tool selected and cursor hovering above MacBook 14&quot; in the design panel." src="https://cdn-images-1.medium.com/max/1024/0*sO_sNclbJDJarCIP.png" /></figure><p>Click on the <strong>frame tool </strong>(top-left), then select one of the custom size frames from the <strong>design panel</strong>.</p><figure><img alt="2 instances of the component in a mac frame" src="https://cdn-images-1.medium.com/max/1024/0*raWTRuxgc6hmZ1D7.png" /></figure><p>Drop 2 instances of our component inside the MacBook frame.</p><p>To take an instance of a component just make a copy of it, the fastest way is to just grab it while pressing and holding the <strong>alt</strong> key and drop the instances inside our Macbook frame.</p><figure><img alt="The second instance selected and component properties updated" src="https://cdn-images-1.medium.com/max/1024/0*RoAvDu0Fr-a4a_-H.png" /></figure><p>The first instance on the left is exactly how we want it to be, so select the second one. Inside the design panel, you’ll see that the component properties we set are there with their default values.</p><p>Now you can edit the component easily.</p><p>Just toggle the icon on, and change the values of <strong>Text</strong> and <strong>Text 2</strong> to match our design.</p><h3>11 Add a hover variant</h3><p>To add a hover state to our button, we need to create a new variant.</p><p>Component properties don’t work in prototypes, and we want the hover property to work in the prototype so we must use a variant in this case.</p><figure><img alt="Component is selected and the cursor is hovering above the create component icon." src="https://cdn-images-1.medium.com/max/1024/0*L580auLlvc_Lb6TQ.png" /></figure><p>Select the card component and press on the <strong>Add variant</strong> icon at the top of the page.</p><figure><img alt="New variant is selected. Property 2 is renamed to hover and it is set to True." src="https://cdn-images-1.medium.com/max/1024/0*Z9z8M94yjMaZy6kT.png" /></figure><p>Both variants have one property, named <strong>Property 1</strong>, by default.</p><p>For the first variant, its value is set to <strong>Default</strong>, and for the new variant, it’s set to <strong>Variant 2</strong>.</p><figure><img alt="default variant is selected and its hover property is set to False" src="https://cdn-images-1.medium.com/max/1024/0*XFh7-__k-a9ahUnE.png" /></figure><p>So We’ll change the name of <strong>Property 1</strong> to <strong>hover</strong> and we’ll set the default variant to <strong>False,</strong> and for <strong>Variant 2</strong> we’ll set it to <strong>True</strong>.</p><figure><img alt="another image was added to the stack increasing the width." src="https://cdn-images-1.medium.com/max/1024/0*6kgwyl8jB7ocT-iT.png" /></figure><p>We want an element to cover the “<strong>images frame</strong>” that will act as our hover effect.</p><p>Duplicate one of the images by selecting it and pressing <strong>cmd c</strong> then <strong>cmd v</strong>.</p><p>The new image will be added next to the images, just like the icon did.</p><figure><img alt="image on top of image stack is set to absolute position](/" src="https://cdn-images-1.medium.com/max/1024/0*7sWW--baCIRHMymG.png" /></figure><p>To fix this and make it above the images, give it an <strong>absolute position</strong> inside the “<strong>images frame</strong>”.</p><figure><img alt="Image covering all image" src="https://cdn-images-1.medium.com/max/1024/0*CVdzH6daH33v49n8.png" /></figure><p>Then manually resize it to cover the whole “i<strong>mages frame</strong>”.</p><figure><img alt="The frame covering the images is selected. Fill is set to solid color with 21%" src="https://cdn-images-1.medium.com/max/1024/0*5vB-V2c1oKEzcYjl.png" /></figure><p>Change its fill from image to a solid color.</p><p>We’ll just eye this one, the hover effect should just be a little bit darker. Give it a dark gray color and lower the opacity.</p><p>Give it a dark gray color and lower the opacity.</p><figure><img alt="hover=False variant is connected to hover=True variant. The design panel is switched to the Prototype panel. The interaction is open and set to while hovering change to hover." src="https://cdn-images-1.medium.com/max/1024/1*nJ73K1dxLBGognlSrGy5DA.png" /></figure><p>Finally for this to work inside a prototype switch to the prototype panel (<strong>Shift E</strong>). Grab the node next to the “<strong>hover =false</strong>” variant and connect it to “<strong>hover=true</strong>”.</p><p>The “interaction details” will pop up, change it from “<strong>on click</strong>” to “<strong>while hovering</strong>”.</p><figure><img alt="Hover variant toggled on and off" src="https://cdn-images-1.medium.com/max/1024/0*67zs60lj7rHtaqc-.png" /></figure><p>You can check the hover effect inside the canvas as well, by selecting an instance and toggling the hover variant “on”.</p><p>The effect is above the icon in our design. The icon shouldn’t be affected by hover.</p><figure><img alt="Icon frame is selected inside hover variant. x and y positions are both set to 16px." src="https://cdn-images-1.medium.com/max/1024/0*Z3vNX70gzNNTXrC9.png" /></figure><p>To fix this, get back to the “<strong>hover=True</strong>” variant, and in the “<strong>layer panel</strong>” grab the icon’s frame and put it above the hover effect’s frame.</p><h3>12 Present it</h3><p>Finally, select the “<strong>MacBook frame</strong>” and present it by pressing the play button at the top left side of the page, above the design panel.</p><figure><img alt="2 instances presented pointer above one of them shows hover effect" src="https://cdn-images-1.medium.com/max/1024/0*pt3DXvwYvLxCVC1r.png" /></figure><p>Hover above our cards and you should see the hover effect.</p><p>It’s a bit darker than the subtle effect we want.</p><figure><img alt="Hover effect frame is selected and and it’s opacity is set to 6%" src="https://cdn-images-1.medium.com/max/1024/0*LO64olPmHN4faaFB.png" /></figure><p>Get back and reduce the opacity and check again.</p><figure><img alt="2 image instances are presented, hovering above the first shows a very subtle change in color just like Pinterest." src="https://cdn-images-1.medium.com/max/1024/0*lDolv0D4fHevghT9.png" /></figure><p>I’m hovering above the one on the left and there’s just the slightest difference, which matches our design.</p><p>And finally, we’re done! Here’s a full view of our final design file.</p><figure><img alt="full Figma design page is shown with references, components, and frame to present." src="https://cdn-images-1.medium.com/max/1024/0*CYHQEH5kvOPiW9Wx.png" /></figure><p><a href="https://www.figma.com/community/file/1119848425895842486">Here’s the final Figma file</a>.</p><p><strong>Thanks for reading!</strong></p><p><em>Originally published at </em><a href="https://mstflotfy.com/design/figma-negative-stack-card-component-in-5steps/"><em>https://mstflotfy.com</em></a><em> on June 18, 2022.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=86550d681770" width="1" height="1" alt=""><hr><p><a href="https://medium.com/design-bootcamp/learn-figma-by-making-a-card-component-86550d681770">Learn Figma by making a card component</a> was originally published in <a href="https://medium.com/design-bootcamp">Bootcamp</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Config 2022 (New Figma Updates) In Practical Examples]]></title>
            <link>https://medium.com/@dev.mstflotfy/figma-new-updates-practical-examples-c7c93e27ac42?source=rss-1d1bf4cc031f------2</link>
            <guid isPermaLink="false">https://medium.com/p/c7c93e27ac42</guid>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[updates]]></category>
            <category><![CDATA[components]]></category>
            <category><![CDATA[ui-ux-design]]></category>
            <category><![CDATA[figma]]></category>
            <dc:creator><![CDATA[The indieDev]]></dc:creator>
            <pubDate>Mon, 23 May 2022 00:00:00 GMT</pubDate>
            <atom:updated>2023-07-16T11:54:24.201Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p9yZVdsG2amj2D7bACxaoA.png" /></figure><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FAZg1oGWn6SY%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DAZg1oGWn6SY&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FAZg1oGWn6SY%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/812433d63ab1cf70e6723ad41c27d74b/href">https://medium.com/media/812433d63ab1cf70e6723ad41c27d74b/href</a></iframe><p><em>Here’s a </em><a href="https://www.figma.com/community/file/1111642615512042772"><em>link to the Figma community file</em></a><em> from this article.</em></p><h3>Intro</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qOm6vrjBHWzKCczd.png" /></figure><p>Figma just had a new update a couple of days ago. In this article, I’ll go through most of the new features using brief practical examples.</p><p>The update includes many little changes, but the main 2 upgrades came to auto-layout and components. And since auto-layout and components are the main features of Figma, it’s important to understand these updates and how to use them to improve your workflow.</p><p>There is no better way to explain something than to use an example. So let’s have a look at the updates by creating a button.</p><h3>Dark Mode</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/955/0*Y0C7vrsGd8tNykz0.png" /></figure><p>We’ll start by opening a new design file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/283/0*i2FvkHzsdh5LT1OP.png" /></figure><p>And the first new feature is Dark-mode. The easiest way to toggle between dark and light modes is to press “Cmd /” to get the quick access menu (I think that’s what it’s called), then write “dark”, and press enter. The Ui changes to Dark-mode but the Canvas’s color we have to change ourselves. This makes sense, if Figma changes it for you, the color it chooses might conflict with your design. To change the color of the Canvas (The background color), click anywhere on it, then at the Design panel, adjust the “Background” color.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*p5L9RdDhVC6fuI_O.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*EaWxEx9Gt0-RzGgJ.png" /></figure><h3>Variable Fonts</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*rLlTz1A6MHh_1HpU.png" /></figure><p>Let’s make our button.</p><p>Grab the text tool (T), press to insert a text box, and write “Button”, then change the font to “Roboto Flex”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*KRV4FOeSkyE47mhB.png" /></figure><p>Figma just added support for variable fonts.</p><p>I also didn’t know what variable fonts were when I first read this.</p><p>I didn’t dive deep into it but here’s what I understood by reading briefly on it; Basically variable fonts give you more flexibility while customizing your type, instead of just preset custom sizes and styles (like “Bold”, or “italic”), variable fonts give you more control. At the same time, all this functionality is packed in one file (unlike normal fonts, where each style has a new file), this leads to faster load times.</p><p>If you want to read more on variable fonts, check out this <a href="https://web.dev/variable-fonts/">Introduction to variable fonts on the web</a> article.</p><p>Just note that not all fonts are variable fonts, and not all variable fonts give you the same amount of options. “Roboto flex” gives many options so you can play with it and customize it.</p><p>To access the variable options select the text, go to the design panel, Text, click on “Type settings” (The three dots icon), then select the variable tab. And you can start customizing the text of your button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qipqlkLl0GPtgcN9.png" /></figure><h3>Auto Layout Text Baseline Alignment</h3><p>Now let’s add an auto-layout frame around our text. Which will function as the frame for our button. Do this by selecting the text and then pressing “Shift A”. You can also name the frame “button”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/709/0*d5WobnF3MTrPM_Kz.png" /></figure><p>We also want our button to have an icon, next to the text. To do this press “cmd /” and then write the name of any icon plugin you have installed, I used the “Material Design Icons” plugin. If you don’t have one you can install one from the <a href="https://www.figma.com/community">Figma community</a>.</p><p>Just select some random icons that you might want to use for your button. I’ll turn each of those icons into a component by individually selecting each icon, and pressing the create component button at the very top of the page. Then I will group these components by selecting all of them and adding an auto-layout frame around them, giving this frame a stroke and naming it “buttons_icons”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*e9Dz-vEj1472BMRb.png" /></figure><p>Grab an instance (just a copy) of one of the icons components, and drop it into the button. (The auto-layout frame holding the text)</p><p>A new feature added to auto-layout is text-based alignment, to use it select the button’s auto-layout frame, in the design panel, auto-layout, press on “Advanced auto-layout settings”. Then press on the checkmark next to “text-based alignment”. This should align the icon and text to the bottom, regardless of the text’s line-height. (This, however, adjusts the text to the frame holding the icon, so if there is space between the icon and its, frame it will not give you the desired result.)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*RkwssZTDyLQIYV9S.png" /></figure><h3>Auto Layout Visual Alignment</h3><p>Auto-layout now has visual alignment added to it. So we can visually adjust the padding and the spacing between items.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/605/0*7_aaCIzxaMmlTQ_z.png" /></figure><h3>Individual Strokes</h3><p>Let’s add a stroke to our button. (In the design panel, Stroke, press the plus button.)</p><p>Another new feature in Figma is individual strokes. Inside the stroke settings, you’ll find a circle icon, if you hover above it should say “Strokes per side”, click on it, and choose left.</p><p>Now, we have a stroke to one side only. Bump up the size of the stroke to 10px.</p><p>You can also press on the “Strokes per side” icon, and have complete control over stoke size per side.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/939/0*dSZDAwnVUR0P9RXG.png" /></figure><p>We’ve covered a lot of updates, but now let’s move to the big one.</p><h3>Component Properties</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/497/0*Ptin8rTdHcja3P4U.png" /></figure><p>Select our button frame, and turn it into a component by pressing the “Create component” button, at the top of the page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/445/0*7boUAJ2rUhOQka71.png" /></figure><p>We can still use components the same way we’re used to, by creating variants, and variant properties, but we now have the option of using component properties as well.</p><p>Components properties are different than variant properties. A component property can be a boolean property (allows you to toggle a layer on and off), a text property (allows you to quickly change the default text, without needing to manually select text boxes), or an instance swap (allows you to easily swap nested components). This will only make sense with an example.</p><p>Select the text inside our button, by double-clicking. Then inside the design panel, you’ll find a new content section, you can edit the default text here, then press on the “Apply text property” icon. Leave the property name as text, and its default value as “Button”. and click on “Create property”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*lfIlzz2bIBBhJhVQ.png" /></figure><p>Now take an instance of our button component (You take an instance just by copying it). You can notice the difference between a component and its instance by noticing its icons. Any changes you make to the component will automatically take place in all its instances.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_L9z7gz8GwIhMiKc.png" /></figure><p>Select the instance and now you can change the text to any text you want right from the design panel, no need to select the text box anymore. This saves time, especially when your design is complex, and it would take many clicks to get to your text boxes.</p><p>Since I have a fingerprint icon, I’ll change the text to unlock.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/739/0*QmQs2UckbBU0FW9H.png" /></figure><p>Let’s add secondary text to our button. In the component, duplicate the “Button” text box. Change the new text to a smaller and thinner size. We want it to be below the main text. But our auto-layout is set in the horizontal direction, so we’ll select both text boxes and press “Shift A” to add a nested auto-layout frame around them, and set it in the vertical direction. Update the line height, set them to left alignment, and set the spacing between them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/263/0*gPrhZ0I6BnqCsoUO.png" /></figure><p>Select the new smaller text and create a new text property for it. Since we duplicated the other text box and it has a “Text” property this one does too, but we want it to have a new property. So inside the design panel, content, press on “Remove property”, change the text, then press on the “Apply text property” icon, then select “Create new property”, name it “secondary_text” and press “Create property”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/510/0*EcnZ4HyNa5bm6DpE.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Miy8nZYj4wcuATyg.png" /></figure><p>Now, if you select our instance you’ll have 2 options, Text and Secondary_text. So set a custom secondary_text.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/738/0*i432WThPKYoiiAB4.png" /></figure><p>Now that we have 2 text boxes, text baseline alignment is not ideal, so remove it and align to center instead.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/926/0*I4NLLfYunm4apaU4.png" /></figure><p>Let’s add a boolean property. Select the icon in our component. And go to the design panel, Layer, then press on the “Apply boolean property icon”. Name the property whatever you want, I’ll name it “icon”, and leave it set to true.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*U0EnXPQmZtptoH14.png" /></figure><p>Grab another instance of our button. Select it and have a look at the design panel. You’ll find a new option in there to toggle the icon off and on. Toggle it off. Not all buttons will have icons. This will allow you to use one component in different cases. Change the text properties.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5NWJ8vUDojfFZbYh.png" /></figure><p>But if we want a button with no secondary text? We’ll just add a new boolean property that will toggle the secondary text on and off.</p><p>Select the secondary text inside the button component. In the design panel, Layer, press on the “Add boolean property” icon.Then “create property”, name it “show_secondary_text”, and leave it as True.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vtO8h82u4fIcfSjJ.png" /></figure><p>Make a new instance, and toggle the secondary text off. I framed the instances together in an auto-layout frame to separate them from the component, and later in this article, we’ll present this frame when we make the buttons interactive.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*dG406JsOfO68L71z.png" /></figure><p>We also want to easily switch between the icons that we chose for our design, so let’s create an instance swap property.</p><p>Select the icon inside the component. And in the design panel, next to the name of the component, press on “Apply instance swap property”. Name the property “select_icon” And press “Create property”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*aAeBBhpX098LxhZi.png" /></figure><p>Now create a fourth instance of our button component. And inside the design panel, find the select icon property and you’ll find a drop-down menu that allows you to swap easily between the icons inside our “buttons_icons” frame, change the text to go along with your new icon, and remove the secondary text.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*fhUrGOG6cJJQvTZo.png" /></figure><p>Component properties allowed us to use one component to make four different button styles.</p><p>But when to avoid using a component property and use a variant instead?</p><p>I think it’s best to set your properties first, then create variants if needed. You can set properties after creating variants, but this will require setting them to every variant, which will add a bit of work, not too much but why do more work than needed.</p><p>The first case where you don’t want to use a component property and should use a variant instead is if you want to use interactive components (if you want to create an interaction, between different variants), like creating a hover state, that will work in prototypes, for example. Component properties can’t be used interactively inside prototypes. interactive components work by internally connecting variants of the same components together, so obviously you need a variant to do this.</p><p>So let’s create a hover state for our button. Select our button component. The add “Add variant” button moved from the design panel to the top of the page. I read some frustrated comments about this, but it makes little difference. Press on the button and a new variant will be added.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*w68jCUrZBypBXNNl.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/385/0*LwBPeiVpM8SaExea.png" /></figure><p>Variants have properties. No two variants can have the exact same property values, if they do, you’ll get an error message. By default the first variants you create will have one property, named “Property 1”, and its value will be “Default” for the very first variant, and “Variant 2” for the new variant. Let’s change this to something that makes more sense. Change “Property 1” to “Hover”, change “Default” to “False”, and “Variant 2” to “True”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Q-PHr1ygf9AYIQkN.png" /></figure><p>Now let’s change the looks of the “Hover=True” variant so that when we change to it we actually see a change. Select the “Hover=True” variant, add a fill to it, and give it any color you want your hover effect to be. We can change the text style as well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*g0vt2GkP5DptpLS1.png" /></figure><p>Now let’s select our instances and we can toggle the hover on and off. Everything is working fine, except I think we’ve discovered a bug. When the instance with the icon swapped changes to hover, the icon gets stuck with the hover color!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*amC_pHtysb0FKtja.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*MONmRKC6GD7LmS6V.png" /></figure><p>I’ve sent to Figma’s team about this bug, hopefully, it will be fixed.</p><p>To make this work in a prototype select the “Hover=False” component, press “Shift E” to switch to prototype settings, and connect it to the “Hover=True” variant, with a “While hovering” and “change to” connection.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/981/0*VHazm_nOTW1fzROT.png" /></figure><p>To present the design and try out the prototype. Select the “Instances” frame, give it a fill, then press the present button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*DQ64SNqPRG7Q2ceC.png" /></figure><p>Now you can hover above all the buttons and see the hover effect in action.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/438/0*g31WZRmaok_Qlygb.png" /></figure><p>Now let’s look at some of the other new Figma updates, that we didn’t cover in our example.</p><h3>Auto Layout Negative Spacing</h3><p>We’ve mentioned some changes to auto-layout while going through the previous example. We mentioned visual spacing and text baseline alignment, but the more impactful changes are negative spacing and relative positioning.</p><p>Auto-layout now allows negative spacing and this allows you to stack elements on top of each other. In an upcoming article, I’ll show you how I used it to create the example below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/575/0*Xc8e0pAGlNDq4Xey.png" /></figure><p>For now, just know that it’s there. And to use it just set the distance between elements to a negative number, and you can choose the order of the stack from the advanced auto-layout settings.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/747/0*Uya1aFGLr32iugLM.png" /></figure><p>The order of the stack can be reversed, by going to “Advanced layout settings” and setting “Canvas stacking” to “First on top”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/923/0*odbCOmPNfUjruMey.png" /></figure><p>And here’s another bug. An element that is in a negative stack does not know the difference between hovering over it or over the element above it. I assume the same issue would be there with clicking as well. In the image below I hover above the unlock button, but in the common area between it and the Dev button and both buttons are showing the hover effect.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/450/0*ECnDVYDJXuZIhHRO.png" /></figure><h3>Spring Animation</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/487/0*F0K1xuCkf91DXHLL.png" /></figure><p>Select one of your icons and add a variant to it. You can rename “Property 1” to “clicked”, and give it a value of “True” instead of “Variant 2”. Change the “clicked=Default” variant to “clicked=False”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Yys4Y2pu3vHndFj9.png" /></figure><p>Switch to prototype settings by pressing “Shift E”, and connect the “clicked=False” variant to “clicked=True”. Set the connection interaction to “on click” and “change to”. Change the instant animation to “smart animate”. Then select one of the preset spring animations (Gentle, Quick, Bouncy, or Slow) or make a custom one.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-pNjqkvz16Mg8Yba.png" /></figure><p>For an animation to actually happen there should be a difference between the 2 variants. So bump up the size of the second variant a bit, and let’s also change its color.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/385/0*XmVslf4z--UVWzPV.png" /></figure><p>To present it make a new frame and add an instance of the “clicked=False” variant inside it, then present the frame and try it out.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*nTsiFZPeeYvu6WQG.png" /></figure><p>The icon will change to the larger size using a spring animation.</p><p>It would be nice if it would change back to its original size after a short delay. So, go back to the component, select the “clicked=True” icon variant, press “Shift E” to switch to prototype settings, and set an “After delay” of “800ms”, “change to”, “clicked=False” interaction to it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1zc2qOhIunBMLAhj.png" /></figure><p>Present the frame and click try it one more time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*uzJXg9dsmvYPoGlD.png" /></figure><p>Check the prototype it should change to clicked=True, then after a short delay, change back to clicked=False.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*NgSD5gFtMInFOBVI.gif" /></figure><h3>Favoriting Files</h3><p>The drafts folder will become a mess once you have a large number of files in there. There is no way to organize files. And it becomes more and more difficult to find older files as the number of files in your drafts folders grows. Finally, Figma added the ability to add files to a Favorites list, this is not enough to end the mess, but it’s a good first step.</p><p>You can add a file to the “Favorite files” list in the drafts folder by right-clicking it and selecting “Add to your favorites” or pressing on the star icon.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/317/0*IP0QQIqjoahHfOTJ.png" /></figure><p>You can also add a file to your Favorites while you’re inside the file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ANX_8BtOqax7ekPv.png" /></figure><p>This is it. These are the updates I found most impactful and for a full official list check <a href="https://www.figma.com/whats-new/">this page</a>. You can also check the Figma community file with the examples in this article.</p><p>You might want to check out this article: <a href="https://mstflotfy.com/design/figma-dropdown-3steps/">How to make a dropdown menu in Figma</a>.</p><p><em>Originally published at </em><a href="https://mstflotfy.com/design/figma-new-update-2022/"><em>https://mstflotfy.com</em></a><em> on May 23, 2022.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c7c93e27ac42" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Make A Figma Dropdown Menu in 3 steps]]></title>
            <link>https://medium.com/design-bootcamp/make-a-figma-dropdown-menu-in-3-steps-d8186cdf0e3?source=rss-1d1bf4cc031f------2</link>
            <guid isPermaLink="false">https://medium.com/p/d8186cdf0e3</guid>
            <category><![CDATA[ux]]></category>
            <category><![CDATA[ui]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[figma]]></category>
            <category><![CDATA[design]]></category>
            <dc:creator><![CDATA[The indieDev]]></dc:creator>
            <pubDate>Sat, 07 May 2022 00:00:00 GMT</pubDate>
            <atom:updated>2024-05-13T04:35:11.146Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*njsPFjr7zAWMUNK799owxg.png" /></figure><p>Whatever design you’re working on, it will (most probably) have a <strong>dropdown menu</strong> somewhere. So, in this article, I’ll attempt to simplify making a dropdown menu in Figma. As a part of my <a href="https://www.youtube.com/playlist?list=PLsOexrcoU3Q4b-dI6chgagDntDD-AgetO">Pinterest Clone in Figma</a> exercise.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FwRnz_AZXJaQ%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DwRnz_AZXJaQ&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FwRnz_AZXJaQ%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/48bd9832719d972ccfca0fb8c11f926b/href">https://medium.com/media/48bd9832719d972ccfca0fb8c11f926b/href</a></iframe><p>We’ll use auto-layout, components, and variants. We’ll create a prototype using <a href="https://help.figma.com/hc/en-us/articles/360061175334#Before"><strong>interactive components</strong></a>.</p><h3>Step 0: The starting point</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*wOrok1smeUSiN537.png" /></figure><p>I’ve already been working on a <strong>Pinterest Clone in Figma</strong>. I started from scratch and created a design for the home page. I even made the <a href="https://www.youtube.com/watch?v=3KUZ3o0ddcE&amp;list=PLsOexrcoU3Q4b-dI6chgagDntDD-AgetO&amp;index=5&amp;t=379s">homepage design fully responsive with breaking points</a>.</p><p>But, the design is not interactive. Pinterest has a lot of interactivity going on, even for a single page, but creating an interactive dropdown menu is not a bad place to start.</p><p>For this design, we’re not starting from scratch. We’ll build on the previous work. And focus only on the dropdown menu.</p><p>One thing to note, where I ended with the last vids, I had a component for almost every element in the design.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/675/0*yJhPz1O8HpTh69uJ.png" /></figure><p>But for this file, I removed most of the components, to minimize the confusion, and only left the ones we’ll need to work on, in the dropdown menu.</p><p>Inside the <a href="https://www.figma.com/community/file/1104788393847411628">file</a>:</p><p>We have a screenshot, just as a reference.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/832/0*BsXKjuWivAiLf7C5.png" /></figure><p>Then we have the design frame, which we’ll not do anything to. We’ll only use it to present our prototype.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*rvagM5wSIJJyrHwA.png" /></figure><p>The main area is the “components” frame. The reason I frame them together is to keep the page clean and organized while keeping all the elements on one page. Again, I kept only the components we’ll need to work with.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*wZrmpECiy6W4QlvM.png" /></figure><p>Most people have their components on a separate page, for me, I prefer it this way, and I found it important when I was prototyping a full design, with many pages and connections.</p><p>The first component we have is the header component. An instance of it is already added to the design, which means that any changes we make to the header component will automatically take place inside the design.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0417SGnXu5KmPvaI.png" /></figure><p>If you’re unfamiliar with components, you can check the “ <a href="https://www.youtube.com/playlist?list=PLsOexrcoU3Q4b-dI6chgagDntDD-AgetO">Pinterest clone in Figma</a>” playlist and it will get you familiar with it, another option is to watch “ <a href="https://www.youtube.com/watch?v=euXzyxr_d6A">How I used Figma to create a full design and prototype for my website</a> “.</p><p>The second component is the dropdown button component. There is an instance of it inside the header, this is called a nested component, when you have a component (the dropdown button), inside another component (the header).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Z3i4kQ63U8ckEYvi.png" /></figure><p>And since there is an instance of the header inside the design frame, any changes we make to the button will take effect inside the frame. And that’s why we don’t need to do anything with the design itself but present it.</p><p>Imagine having 10 pages where the header is used, how much effort and headaches are we saving by updating the header component only without needing to make changes to every single frame! That’s why you should always use components.</p><p>Finally, we have a component for the profile image. An instance of it is inside the header component, and therefore also inside the design frame.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*m7738UA1O70nBb8M.png" /></figure><p>Now let’s get to it, and start making the dropdown menu.</p><p>To follow along I made <a href="https://www.figma.com/community/file/1104788393847411628">a Figma community file</a>. Open the link while you’re signed in to your Figma account, press on duplicate at the top right side of the page, and you’ll have a copy of it in your drafts folder.</p><p>In this article/video we’ll make a Figma Dropdown menu in three steps:</p><ol><li>Make aHover state variant for the dropdown button component.</li><li>Create a“Menu items” component with its variants.</li><li>Make an open state variant for the dropdown button.</li></ol><p>Below you’ll find steps to act as a reference for those who watch the vid and want a quick way to remember the steps. Kind of the video notes.</p><h3>Step 1: Create a hover variant</h3><p>We’ll start by creating a hover variant for the dropdown button component so that when we hover above the button it changes from its normal state to the hover state.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*xVts5S1g4-637k4-.png" /></figure><ul><li>Select the <strong>Dropdown Button</strong> component, and add a new variant.</li><li>Change <strong>property 1</strong> to <strong>State</strong>.</li><li>Set the value of <strong>State</strong> to <strong>Hover</strong>.</li></ul><p>So now the <strong>Dropdown Button</strong> has two variants, the first is “Default”, and the second is “Hover”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*eRYCEOlVgAYXINLU.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*wlVZDpQ5NTZE3LvB.png" /></figure><p>When you hover above the <strong>Dropdown</strong> button component, it should change from the “default” state to the “Hover” state.</p><h3>Step 2: Create Menu Items Components</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/425/0*3aVps9pnEiVN2P7L.png" /></figure><p>We’ll create a third variant (an open state), that is going to show the menu. But first, we’ll create a new component for the menu items. Why?</p><p>The dropdown menu, we want to make, has different items. Each item has a hover state. One way to deal with this is to create multiple dropdown menu variants. One where no element has a hover effect, then one for each item in hover. So if we have three items, we’ll make 4 menus!</p><p>By creating a component for each of those items, and utilizing interactive components, we only create one dropdown menu.</p><p>If this makes no sense, keep on reading, and it will.</p><p>Also, the same elements which are inside the menu are used in other places in the Pinterest design, so by creating a component for them we only need to set them once and use them everywhere.</p><p>Also, the same element is repeated multiple times in the menu, why create it multiple times? And when we decide to update it we’ll have to select the same element in different places, bad business!</p><p>Therefore we’ll first create the menu items, then in the next step, we’ll create an open state for the dropdown button, we’ll attach the menu to it and use these elements. Now we’ll set each element once and use it everywhere, and also update it once when we need to, and it will update everywhere. Not just inside the menu but also in other places on the page. Not just on this page, but also on other pages when we create them!</p><p>For the Pinterest Design, we’re working on we’ll create 4 menu items; Title, Text, Text &amp; link icon, and user.</p><h4>Make A Title Variant</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*jxYSONFTxto6rtGc.png" /></figure><ul><li>Grab the text tool (T), and write “Title” (Roboto, light, 20px).</li><li>Add auto-layout to it (Shift A) (padding: 20px, 10px. Alignment: left &amp; center)</li><li>Turn it into a component.</li><li>Change its property 1 to Type=Title.</li></ul><h4>Make A Text Variant</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*RDiWIXu9Ow2dUMir.png" /></figure><h3>Make A Text, Hover Variant</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*BU776qC4jTb-_ijR.png" /></figure><ul><li>Select the Text variant, and add a new variant from it.</li><li>Add a new property, state=Hover.</li><li>Set the state for the above variants to state=No Hover.</li><li>Add a fill, and give it a “Gray 2” color style.</li><li>Switch to prototype (Shift E) and connect the Text, No Hover to the Text, Hover. Set the interaction to while hovering change to.</li></ul><h4>A Text &amp; link icon Variant</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*kE8UBGokfLdwisSR.png" /></figure><ul><li>Select the Text, No Hover variant. And add a new variant from it.</li><li>Set the property: Type=Text &amp; link icon, and the property: State= Hover.</li><li>Open the “Feather Icons” plugin, grab a link icon, and drop it into the “Text &amp; link icon, No Hover” variant. Change its stroke width to “3px”.</li><li>Make sure the variant’s horizontal resizing is set to “fill container”, and set its auto-layout alignment to “space between”.</li></ul><h4>Create a text &amp; link hover variant</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VNv9Qhm0kqm7Q6gE.png" /></figure><ul><li>Select the “Text &amp; link icon” variant, and make a new variant from it.</li><li>Set its properties. Type= Text &amp; Link, State=Hover</li><li>Add a fill to it, and give it the “Gray 2” color style.</li><li>Switch to the prototype panel (Shift E)</li><li>Select the “Text &amp; Link, No Hover” variant and connect it to “Text &amp; link, Hover” variant. And set the interaction to “While hovering” and “change to”.</li></ul><h4>Create the User variant</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*bbtZ1Z39SIEI7Tp0.png" /></figure><ul><li>Select the “Text, No Hover” variant, and make a new variant from it.</li><li>Set its properties; Type=User, State=No Hover.</li><li>Edit text to “User Name”</li><li>Duplicate the text, and change it to “Account” (Roboto, 20px, Regular), and give it a “Gray 1” color style.</li><li>Duplicate it again, and change the text to “email”.</li><li>Select all three text boxes and give wrap them in their own auto-layout frame (Shift A) (vertical, item spacing=5px, padding=0, alignment=center &amp; left, packed). You can name the frame user info.</li><li>The profile image is too small. So go to the “Profile Image” component, add a new variant, give it property 1=Large, and change its size to 75px.</li><li>Grab the profile image and drop it into the “User, No Hover” variant.</li><li>Change the “User, No Hover” variant’s auto-layout settings to a horizontal direction, 20px between items, and alignment to space between.</li><li>Change the “User, No Hover” variant’s horizontal resizing to “fill container”, and vertical resizing to hug contents.</li><li>Open the “Feather Icons” plugin, grab a checkmark icon, and drop it in the frame. And give it a stroke width of 3px.</li><li>Set the elements inside the User variant to hug contents, except for the user info change its horizontal resizing to “fill container”.</li></ul><h4>Make a hover state for the User variant</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*tDH5wYxZEI9DGUT-.png" /></figure><ul><li>Select the <strong>User, No Hover</strong> variant.</li><li>Press on the plus button, at the button right corner of the menu items component, to make another variant of it.</li><li>Set the properties of the new variant; “Type=User, State=Hover”.</li><li>Add a fill to the new variant.</li><li>Give the fill a “Gray 2” color style.</li><li>Switch to the prototype panel (Shift E)</li><li>And connect the “User, No Hover” to the “User, Hover” variant and set the interaction to “while hovering”, and “change to”.</li><li>Remove the connection the “User, Hover” has to the “Text” variant.</li></ul><h3>Step 3: Create a variant for the open state</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/914/0*cTxkBbw-Pe5uVFwr.png" /></figure><h4>Create the open variant</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*nNaw9DuqIzv9szWA.png" /></figure><ul><li>Select the <strong>Hover variant</strong> inside the <strong>Dropdown Button</strong> Component.</li><li>Make a new variant of it.</li><li>Set its property “state=Open”.</li><li>Switch to the prototype panel (Shift E), connect the <strong>Hover variant</strong> to the <strong>open variant</strong>, and set the connection to “On click” and “change to”</li><li>Connect the <strong>Open variant</strong> to the <strong>Default variant</strong>, and set the interaction to “On click” and “change to”.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*szgVK_EGGcy9Ne5m.png" /></figure><p>Now the button will start in its default state, when you hover above it, it will change to the hover variant, if you click on the hover variant it will change to the open variant, and when you click on the open variant, it will return to default again.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/914/0*nHh78VHsJuqoaWTO.png" /></figure><ul><li>Select one of the menu items <strong>Title, No Hover</strong>, and copy it to the clipboard (cmd c).</li><li>Inside the <strong>Dropdown Button Component</strong>, select the <strong>Open variant</strong>, then paste (cmd v).</li><li>Add an auto-layout frame around the menu item you sent (Shift A), and name it <strong>Dropdown Menu</strong>.</li><li>Change horizontal resizing for the <strong>Dropdown Menu</strong> to Hug contents, and the menu item to “fill container”.</li><li>Manually create space for the <strong>Dropdown Menu</strong> inside the <strong>Dropdown Button</strong> component auto-layout frame. The auto-layout frame is not doing it automatically because the menu is floating outside of the frame of the <strong>Open</strong> variant. And from now on, manually give yourself space as needed.</li><li>Set the auto-layout settings for the <strong>Dropdown Menu</strong> to vertical, “0px” between items, “10px” padding, and top &amp; left alignment.</li><li>Give the <strong>Dropdown Menu</strong> a fill, and give it the “Pinterest White” color style. And rounded corners of “10px”.</li><li>Add a “drop shadow effect” to the <strong>Dropdown Menu</strong>, and remove its “x” &amp; “y” direction, and give it a “blur” of “20px”</li><li>Then, push it in place. The button should be above its right side. (Align the dropdown button, with the dropdown menu manually.)</li></ul><p>You might want to present the design and have a look at it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/541/0*rUvqQyTh2jaOATFI.png" /></figure><p>Inside the Dropdown menu frame</p><p>And we’re done! Check present the design frame to check your menu.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*hHnUlb7qqWwp8V5F.png" /></figure><p>In the future, when I create multiple pages, I can link those buttons inside the menu to them. For example, if I have a “Settings” page. I can link the Settings button inside the component to it, and it will work from anywhere inside the design.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*L7vFtY9pWohxUc7l.png" /></figure><p><em>Originally published at </em><a href="https://mstflotfy.com/design/figma-dropdown-3steps/"><em>https://mstflotfy.com</em></a><em> on May 7, 2022.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d8186cdf0e3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/design-bootcamp/make-a-figma-dropdown-menu-in-3-steps-d8186cdf0e3">Make A Figma Dropdown Menu in 3 steps</a> was originally published in <a href="https://medium.com/design-bootcamp">Bootcamp</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Linux Command Line Beginner’s Guide]]></title>
            <link>https://medium.com/@dev.mstflotfy/what-is-the-command-line-why-learn-it-and-just-enough-to-get-started-4a695c627b17?source=rss-1d1bf4cc031f------2</link>
            <guid isPermaLink="false">https://medium.com/p/4a695c627b17</guid>
            <category><![CDATA[command-line]]></category>
            <category><![CDATA[dev]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[indiedev]]></category>
            <category><![CDATA[introduction]]></category>
            <dc:creator><![CDATA[The indieDev]]></dc:creator>
            <pubDate>Fri, 22 Apr 2022 00:00:00 GMT</pubDate>
            <atom:updated>2022-07-04T16:23:32.183Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IY83LKdXeWB4Bd2JPV2TYw.png" /></figure><p>While the command line seems like a scary and daunting place, getting started with it is not as hard as it first seems.</p><p>In the following video, I try to simplify getting started with the command line.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FwRsqiMIBI3Y%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DwRsqiMIBI3Y&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FwRsqiMIBI3Y%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/587a1f6f07c69e09d94aaabd42babb23/href">https://medium.com/media/587a1f6f07c69e09d94aaabd42babb23/href</a></iframe><p>This article contains notes from the video. I tried to be brief with the article, not sure it worked, but I think that this is a thorough (for an intro that is) introduction to the command line, that can take you from knowing nothing about the command line, to confidently using it daily. And hopefully, build up your knowledge from there.</p><h3>1. What is the cmd line?</h3><p>We use a GUI (Graphical UI) to interact with our computers.</p><p>Another way to interact with a computer is using text.</p><p>The command line takes your text commands and passes them to your system to perform them.</p><p>The command line, Shell, Terminal, and Bash are different things, but for now, just think of them as the app that allows you to interact with your computer using text.</p><p>But why would you want to do that? Why should you <strong>even</strong> bother?</p><h3>2. Why learn the command line?</h3><p><em>This video/article does not aim to promote abandoning GUI and using the cmd line to do every single thing. But to show you that learning the command line can be easy and can make you more efficient with some of your everyday tasks.</em></p><h4>Speed &amp; Efficiency</h4><p>The terminal allows you to do some of your everyday tasks in a faster and more efficient way.</p><p>How?</p><p>In this article’s video, I give an example of that. My Desktop was a mess. I gave a quick example showing how I’d normally clean up my Desktop using <strong>GUI</strong>, then I did it again using <strong>the terminal</strong>. A trivial example. But, to me, it was clear that using the terminal is the more efficient (and even enjoyable) option out of the two.</p><p>Many other everyday tasks can become more efficient by using the terminal. Especially if you’re doing something repetitive or dealing with a large number of files.</p><h4>You want to become a developer</h4><p>Start doing everyday things using the command line, and get used to interacting with your computer using text, which is something a developer does all day.</p><p>A good entry point to get into the mindset of a developer, get closer to the Dev environment, and get familiar with Dev tools.</p><p>Learn to take control of your computer then learn to program.</p><h4>Dev Tools</h4><p>If you intend to develop you’ll eventually have to use Dev tools, and some of those tools do not have a GUI. And so, you’ll need to learn to use the command line, at least the very basics of it, to be able to use these tools.</p><p>It’s a skill that you’ll need to learn anyway if you want to build your own apps.</p><p>An example of this I wanted to create a website and made a quick research online and found the best way for me was to <a href="https://mstflotfy.com/dev/how-to-start-a-blog/">host my website for free</a> using <a href="https://pages.github.com/">GitHub pages</a> and use a tool called <a href="https://jekyllrb.com/">Jekyll</a> to build the site, and a tool called <a href="https://git-scm.com/">Git</a> to upload my pages online using one command. Both Jekyll and git are command line tools.</p><p>Another example, I want to use <a href="https://nextjs.org/">NextJs</a> to make webapps, when I go to its <a href="https://nextjs.org/docs/getting-started">Docs</a> it will refer me to to install it using the command line.</p><p>A third example, I came across a very interesting tool called <a href="https://www.remotion.dev/">remotion</a>, that allows you to use code to make animations and edit vids. Again, to install it and use it, I had to use the command line.</p><p>A fourth example. I came across another tool called <a href="https://revealjs.com/">revealjs</a>. It allows you to use HTML or Markdown to make presentations that look great, just by typing some text! And I also had to use the cmd line to install it and use it.</p><h4>Not just Dev Tools</h4><p>Package managers are like app stores for the terminal.</p><p><a href="https://brew.sh/">Homebrew</a> is the most popular package manager for mac computers, and APT for linux, but there are other package managers for both systems.</p><p>Through package managers, you can download and install tools, that you can use daily. Some of those tools are not just for developers.</p><p>For example, I can install a command-line internet speed test tool on a mac using one command: $ brew install speedtest-cli. And I can test my internet speed through the command line without visiting any website or downloading any app, using a single quick command: $ speedtest.</p><p>You can also use a package manager to download and update GUI apps using one-line commands.</p><p>I can install Figma from the command line using one line of code: $ brew install --cask figma, or install Brave Browser: $ brew install --cask brave-browser.</p><h4>Finally getting started is not as hard as it first seems</h4><p>It’s just another tool that you’ll learn.</p><p>Even GUI apps need learning and some are not very intuitive, even more, difficult to use than the terminal.</p><p>You’ll use a cheat sheet at first to help you memorize the commands you use the most, and when you repeatedly use commands, you’ll use a cheatsheet less often.</p><p>At first, you’ll just do simple tasks, that you can already do using GUI, using the terminal. But, as you develop your knowledge you’ll be able to do what is not possible to do using GUI.</p><p>You’ll also become faster and more efficient at doing some of your everyday tasks.</p><h3>3. How to start using the command line?</h3><p>If you’re using a Mac or Linux, you can simply open the <strong>terminal App</strong> and get started immediately!</p><p>On a Mac, I press <em>cmd spaceBar</em> to open <strong>Spotlight search</strong>, type <em>terminal</em>, and press <strong>return</strong>. And I can start writing commands.</p><p>If you’re using windows there are 2 ways you can use a Linux Shell:</p><ol><li><a href="https://gitforwindows.org/">Install git for windows</a>, which runs a Linux shell emulator.</li><li><a href="https://gitforwindows.org/">Install Windows Subsystem for Linux</a>, which is the way that is most recommended. It gives you a Linux environment without using a virtual machine or dual-booting Linux.</li></ol><h3>4. Navigate</h3><p>Now that you’re inside the <strong>terminal app</strong>. The first thing you can do is use the <strong>terminal</strong> to navigate through the files and folders on your computer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/661/0*1C3NLwSi2UmiAU8T.png" /></figure><p>When you open <strong>the terminal</strong> you get a <strong>prompt</strong>, it might look different depending on your settings. Usually, you’ll find a $ sign and a fat rectangle.</p><p>The $ sign is a <strong>prompt</strong> it shows you that this is <strong>a command line</strong>. You can type your command after the prompt. The rectangle is just <strong>the cursor</strong>.</p><h4>pwd - print working directory</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*lCeLa59kBQBNiY92.gif" /></figure><p>To know where you’re at, type your very first command: pwd: Print working directory. Think of a directory as just a folder. Basically, you&#39;re telling the terminal to show you what folder you are at, right now.</p><p>pwd returns a path for you. Then the prompt and cursor again, show you that you can type another command if you want.</p><p>/Users/mostafalotfy/ is the absolute path to where I am currently at, my home folder.</p><p>But what is an absolute path?</p><h4>Linux Directory Structure And Absolute Paths</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*ogA0rE-LO91iemtj.gif" /></figure><p>Everything (all files and folders), in a Unix-based system, is located under the <strong>root</strong> directory /.</p><p>Therefore a full path to any file or folder starts from the <strong>root</strong>. This is called an <strong>absolute path</strong>.</p><p>The <strong>home directory</strong> is a directory that holds your personal files and folders. It contains folders like <strong>Desktop</strong>, <strong>Downloads</strong>, <strong>Documents</strong>, among other things.</p><p>In a Linux system the <strong>absolute path</strong> to the <strong>home directory</strong> is like this: /home/userName.</p><p>For mac, it’s the same (Since it’s a Unix-based system), but your personal files will be under /Users/yourUserName.</p><p>So, the path returned by the pwd command /Users/mostafalotfy, is the path to my home folder. It&#39;s like directions, start from the <strong>root</strong> directory /, then move to the <strong>Users</strong> directory /Users, then move into my user.</p><p>The home directory has a shortcut to it ~. For example, the absolute path to my <strong>Desktop</strong> will be /Users/mostafalotfy/Desktop or ~/Desktop.</p><p>If I have an image on my <strong>Desktop</strong> named <strong>screenShot1.png</strong>. The absolute path to it will be ~/Desktop/screenShot1.png</p><h4>ls - list directory contents</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*YyyXGKtf9TBJqJWz.gif" /></figure><p>Use the ls command to know what files and folders are inside your current working directory.</p><p>ls will return a list of all files and folders inside your current directory.</p><p>ls -&lt;options&gt; You can add options to the ls command.</p><p>ls -a The -a option will include dotfiles, which are hidden files, in the list.</p><p>There are many options for the ls command. ls -G will give colored output, which will make directories have a different color than files.</p><p>Most options can be combined. This is how I often use the ls command: ls -GhalS</p><h4>clear - clear the terminal screen</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*zNfUfauVKDxjCNJS.gif" /></figure><p>When the screen gets too crowded you can use the clear command to get back to the comfort of a blank screen.</p><h4>man - display manual pages</h4><p>But how to know what options you can use with your commands?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*MgJsrjSTxrt_JuHD.gif" /></figure><p>Use the man command followed by the command you want to know more about. And you&#39;ll get all the info on this command, including a list of all options you can use.</p><p>Can be confusing at first, but keep using it and you’ll learn how to extract what you need out of it.</p><p>No need to learn every option, just look for what you need.</p><p>If you run the command man ls, you can read what each of the options I use with the ls -GhalS command does.</p><ul><li>-G gives colored output, so folders have a different color than files.</li><li>-a shows hidden files</li><li>-l gives a long list with more info about the file. This will come in handy in the future as you expand your knowledge. Including file type, permissions, and file size.</li><li>h makes the size of files human-readable, by adding K for Kilobytes, G for Gigabytes, and so on.</li><li>S orders files according to size</li></ul><p>Try to use the man command on each new command you learn. To quit the manual just press the q key.</p><p>I find it helpful sometimes to open the man in a new tab. By pressing cmd t, then man &lt;cmd&gt;, and switching using cmd 1 &amp; cmd 2 just like you would inside your browser.</p><h4>Anatomy of a command</h4><p>What is the anatomy of a command line?</p><pre>$ &lt;cmd&gt; -&lt;option&gt; &lt;argument&gt;▮</pre><ul><li>$ The dollar sign is a prompt to show you that you can write a command here.</li><li>▮ This rectangle is just to show you where the cursor is at.</li><li>&lt;options&gt; Options that you can add to the command. Like -G</li><li>&lt;arguments&gt; Inputs that some commands need to run. like a path to a file or directory. If the cmd is to list then I can give directories as input to be listed.</li></ul><p>$ ls -a ~/Desktop, in this command, ls is the name of the command, -a is an option that will list hidden files as well, and ~/Desktop is the argument, which is the directory that the command will apply to. So the command will list all files and directories inside the desktop directory, including hidden ones.</p><h4>Relative path</h4><p>If you are at the home directory ~. The Documents directory is already inside it, no need to give an absolute path, we can give a relative path instead. I can just do it this way directly: ls Desktop, This is called a relative path.</p><p>If an absolute path uses the root as the reference, a relative path uses our current working directory as the reference.</p><p>The parent directory is referred to using ... If your current working directory is the Desktop, and you ls .. this will list your home directory.</p><h4>cd - change working directory</h4><p>cd Stands for change working directory. Use it to navigate through your folders, and to head to any folder on your computer.</p><p>You can use a relative path; cd Downloads.</p><p>Or an absolute path; cd ~/Downloads Or cd ~/Desktop/screenshotsFolder. You can jump to the <em>Downloads</em> folder (or any folder) even if it&#39;s not inside your current working directory.</p><p>cd by itself, with no arguments, takes you to your home directory.</p><p>cd .. goes to the parent directory.</p><p>cd - goes back so you can toggle between 2 folders.</p><h4>open - open files and directories</h4><p>You can use the open command to open directories inside GUI.</p><p>open . Open the current working directory inside GUI.</p><p>open .. Open the parent directory using GUI.</p><p>open ~/Desktop Open any folder on your computer by giving an absolute path to its destination.</p><p>open Documents Use a relative path to open a folder. This is just like open ./Documents, using your current working directory . as the starting point instead of the root / directory.</p><p>If you have a screenshots directory at your Desktop, you can open it inside GUI, and look at the images by typing this: $ open ~/Desktop/screenshots</p><p>open ~/Downloads/images/image1.png The open command can also be used to open files.</p><h3>5 Organize</h3><p>Now that you know where you are, you can list files and directories, and you can navigate between directories, let’s see how we can organize our directories and files.</p><h4>mkdir - make directories</h4><p>mkdir newFolder This command will make a new directory named <strong>newFolder</strong> at the current working directory.</p><p>mkdir ~/Desktop/newFolder1 You can give an absolute path to where your want to create your new directory. This command will make a directory <em>newFolder1</em> at the <em>Desktop</em>.</p><p>If you want to create a parent directory with multiple directories inside it with one command. Do it this way mkdir -p files/images/screenShots. This will create a new directory named <strong>files</strong> with another one inside it named <strong>images</strong>, then another one inside <strong>images</strong> named <strong>screenShots</strong>.</p><h4>mv - move files and directories</h4><p>Now let’s move things!</p><pre>$ mv &lt;file&gt; &lt;directory&gt;</pre><p>Or</p><pre>$ mv &lt;file1&gt; &lt;file2&gt; ... &lt;directory&gt;</pre><p>Basically, the mv command takes at least 2 arguments or inputs, the path to the files you want to move, then the last argument should be the destination directory you want to move the file or files to.</p><p>mv ~/Desktop/image.png ~/Documents/screenshots This command will move a file with the name <em>image.png</em> from the <em>Desktop</em> folder to a folder named <em>screenshots</em>, which is inside the <em>Documents</em> folder.</p><p>mv image.png photo.png We can also use the mv command to rename files or folders. This command will rename the file <em>image.png</em> to <em>photo.png</em>.</p><p>mv ~/Desktop/image.png ~/Documents/screenshots/myImage.png You can move and rename a file at the same time.</p><p>mv image1 image2 image3 image4 ~/.Trash You can move multiple files from your current working directory to any folder you want on your computer. This command will move three files to a hidden folder/directory inside the home folder called .Trash.</p><p>One problem that can happen with the move command is that if you move a file that has the same name as another file, it will overwrite it, without asking for permission. If you want it to ask for your permission first before overwriting use the interactive option. mv -i (interactive. Forces the mv command to request permission before overwriting.)</p><p>mv newFolder ~/.Trash You can also move directories.</p><h4>cp - copy files and directories</h4><pre>$ cp &lt;file1&gt; &lt;file2&gt; ... &lt;directory&gt;</pre><p>Almost, just like the mv command but copies.</p><p>cp ~/Desktop/myBook.pdf ~/Documents/myBooks This will copy the file <em>myBook.pdf</em> from the <em>Desktop</em> directory to to <em>myBooks</em> directory inside <em>Documents</em>.</p><p>Also, you can rename while copying, and copy in the same directory to make duplicates. The -r option will copy folders with all files and directories inside them.</p><p>Let’s delete some shi*!</p><h4>rmdir - remove empty directories</h4><pre>$ rmdir &lt;directory&gt;</pre><p>The only thing this command does is remove empty folders. This could be useful if you have a bunch of empty folders you want to delete. You can run this command on all files and folders in a directory, knowing that only empty directories will be deleted.</p><p>If I make a bunch of empty folders at the desktop mkdir emptyFolder1 empty2 empty3 empty4</p><p>I can then rmdir * to remove all empty folders. We&#39;ll talk about wildcards in a minute. For now, it just means apply this command to all files, and since <strong>rmdir</strong> only works on empty folders, nothing important will be lost.</p><h4>rm - remove files and directories</h4><pre>$ rm &lt;file&gt;</pre><p>Or</p><pre>$ rm -r &lt;directory&gt;</pre><p>To remove or delete files, or folders that are not empty use the rm command.</p><p>Be careful with this, as the files are not moved to the <strong>trash</strong> but removed permanently without asking for confirmation. And you can’t get them back!</p><p>rm ~/Documents/myImage.jpeg This will remove the file <strong>myImage.jpeg</strong> from the <strong>Documents</strong> directory.</p><p>rm -r ~/Desktop/myFolder This will permanently delete the directory <strong>myFolder</strong> from the <strong>Desktop</strong> directory. The r option, stands for recursive, it will make the remove command delete a folder with all files and folders inside it. Be careful son!</p><p>Wildcards will make your command apply to every file that matches a specific pattern.</p><p>There are different ways to make patterns, but usually, you can target files that end in a specific extension, like this mv *.png This command will permanently delete every single file that has the <strong>.png</strong> extension, that ends in <strong>.png</strong>, inside the current working directory.</p><p>Or, you can target files that start with a specific word, like this cp mstf* ~/Documents/myFiles. This command will copy every file that starts with <strong>mstf</strong>, and send the copies to <strong>myFiles</strong> folder, in the <strong>Documents</strong> directory.</p><p>You can also target files that have a specific word in the middle - ls *image*. This command will list the contents of every directory that has the word <strong>image</strong> in the middle of its name.</p><p>Be careful using this! If you make a mistake you can mess up a lot of files.</p><h3>6. Edit</h3><p>Almost done! It’s time to edit files using the command line, text files especially, as those are the ones you’ll deal with the most as you develop your own Apps.</p><h4>touch - create a file</h4><pre>$ touch &lt;file&gt;</pre><p>Creating a new text file using GUI can take some steps, using the command line you can create a text file, or a bunch of them, on the fly.</p><p>touch newFile.txt file2.md file3.js file4.md This will make a bunch of files for you, inside your current working directory.</p><p>Obviously, you don’t need to be inside the folder to make a new file there. If I want to create a new file at the <strong>Desktop</strong> using an absolute path, I can write this command touch ~/Desktop/newfile.txt.</p><h4>open - open files</h4><pre>$ open &lt;file&gt;</pre><p>The first way to edit a text file is to open the file using GUI and edit it.</p><p>open file.txt This will open <strong>file.txt</strong>, using the default app and you can edit it and save it, then get back to the terminal.</p><h4>cat - concatenate and print files</h4><pre>$ cat &lt;file&gt;</pre><p>Use the cat command to have a quick peek inside text files.</p><p>It stands for concatenate, to link or connect together. But, its simplest use case is a quick peek into a text file.</p><p>No need to open the file then it will display inside your terminal.</p><h4>echo - return arguments</h4><p>Echo is a simple command that returns whatever argument you give it. It takes your input and turns it into output. This might, at first, seem useless, but it can be used to quickly pass text into a file (without first opening it!)</p><p>If I have <strong>file.txt</strong> in my current working directory, I can echo something into it, this way: echo &#39;Hey There&#39; &gt; file.txt. But using just one greater than sign <strong>&gt;</strong> will replace all the text inside the file with <strong>Hey There</strong>.</p><p>To add or append to the end of the file do it this way: echo &#39;append this son&#39; file.txt&#39; &gt;&gt; file.txt</p><h4>nano - a simple command line text editor</h4><p>Another way to edit a text file is to use nano.</p><pre>nano &lt;file&gt;</pre><p>Nano is a simple command-line text editor. It will open a file inside your terminal for you to edit it. nano newFile.txt</p><p>If the file exists it will open it inside nano, if not it will create a new file and open it inside nano.</p><p>To exit nano, look at the guide at the bottom. Press ctrl X. Then y to save change or n to not save. if you save you can rename the file or keep the same name. Press enter to keep the same name.</p><h4>vim - an advanced text editor</h4><p>One final way to create and edit text files is using Vim.</p><pre>vim &lt;file&gt;</pre><p>Vim is an advanced command-line text editor. It allows you to do everything inside a text editor without ever needing to touch a mouse.</p><p>The problem with Vim is you can’t use it unless someone tells you how!</p><p>That’s why most people’s first encounter with Vim, myself included, is getting stuck and not being able to exit!!</p><p>Vim needs its own intro so, for now, just use open, or nano and in the future, we can dive into Vim.</p><p>To exit Vim, press <strong>ESC</strong>, then write :q!, then press <strong>return</strong>, and you&#39;ll safely return to the terminal.</p><h3>7. Customize</h3><p>Hang in there we’re almost done!</p><p>I’ll give you 2 ways to start customizing your command line XP. Off course, there’s a lot more that can be done when it comes to customization, which we’ll explore later. But this is just a start.</p><h4>alias - make a command shortcut</h4><pre>$ alias &lt;aliasName&gt;<strong>=</strong>&#39;&lt;command&gt;&#39;</pre><p>The first thing you can do to customize your terminal XP, is to create aliases.</p><p>An alias is just a shortcut to long commands that you repeatedly use.</p><p>You can also use aliases to cd, change directory (head to), and your most-used folders. For example: alias myFolder=&#39;cd ~/Documents/myFolder.</p><p>Typing an alias directly into the terminal will set it only for this session. Once this terminal window is closed, the alias will be gone!</p><p>To make an alias permanent you need to add it to a file that manages the settings of your terminal. This filename depends on which shell you use, most probably your system will be using the <strong>bash</strong> shell, or if you have a new mac it will be <strong>zsh</strong>.</p><p>For <strong>bash</strong> open the file ~/.bashrc using open or nano and add the alias to an empty line. For zsh: open ~/.zshrc and add your alias. These are hidden files inside your home <strong>~</strong> directory.</p><p>After you add your alias to the ~/.bashrc file, you need to restart the terminal for it to start working or write the command source ~/.bashrc to reload the terminal&#39;s settings from it.</p><p>If you want a list of all the aliases you have currently set. You can just write the command alias. This would be useful if you forgot what aliases you&#39;ve set.</p><h4>ps1=&#39;$ &#39; - prompt variable</h4><p>And finally, if you want to customize the look of your prompt, you can edit the value of the variable <strong>ps1</strong> in the ~/.bashrc file.</p><p>I prefer a minimal look with only the prompt.</p><p>You need to source ~/.bashrc for this to take effect or start a new terminal tab.</p><h3>8. What’s next? Command Line Resources</h3><p>Some resources that can help you learn more about using the command line.</p><h4>Command Line Cheatsheets</h4><p>There is no need to memorize any command.</p><p>Understand what a command does, when you get introduced to it, and how it works, then choose a cheat sheet to get back to when you forget it. Or even better, make your own cheat sheet, with your favorite commands.</p><p><a href="https://mstflotfy.com/dev/command-line-cheat-sheet/">Here’s my cheatsheet</a></p><p>There is also a <a href="https://www.codecademy.com/learn/learn-the-command-line/modules/learn-the-command-line-navigation/cheatsheet">cheatsheet by Codecademy</a>, if you don’t like how I structured my cheatsheet.</p><p>Or, just look up other Command-line cheatsheets online, and find one you like.</p><h4>Books To Self Study The Command Line</h4><p><a href="https://flaviocopes.com/page/linux-commands-handbook/"><strong>The Linux commands handbook by Flavio</strong></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ah2uVZufmYZfJTcs.jpeg" /></figure><p>This is a short book of commands and quick explanations, that the author thinks are used by shell users 80% of the time.</p><p><a href="https://www.linuxcommand.org/tlcl.php"><strong>The Linux command line Book by William Shots</strong></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*6ZpO1SvrJ6V2e7sO.png" /></figure><p>A very recommended book that dives deep into the command line and that is suited for beginners.</p><h4>Online Class</h4><p><strong>The Missing Semester of Your CS Education, a class by MIT.</strong></p><p>This class is a part of the <a href="https://github.com/ossu/computer-science">Open source society Uni</a> ‘s path to a free self taught education in computer science.</p><h4>Tune in</h4><p>I will continue to explore the command line on my website: <a href="https://mstflotfy.com/">mstflotfy.com</a>, and YT channel: <a href="https://www.youtube.com/c/mstflotfyindieDev">mstflotfy — indieDev</a> . I’ll explore commands that used to confuse me, shell scripts, and vim. I will also explore other Dev subjects, as well as Ui and Ux Design.</p><p><em>Originally published at </em><a href="https://mstflotfy.com/dev/command-line-simplified/"><em>https://mstflotfy.com</em></a><em> on April 22, 2022.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4a695c627b17" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>