<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Phong Duong</title>
    <description>The latest articles on Forem by Phong Duong (@phongduong).</description>
    <link>https://forem.com/phongduong</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F84264%2F6422c616-d1f6-491b-bec0-6239ffcccb37.png</url>
      <title>Forem: Phong Duong</title>
      <link>https://forem.com/phongduong</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/phongduong"/>
    <language>en</language>
    <item>
      <title>Create gradient text</title>
      <dc:creator>Phong Duong</dc:creator>
      <pubDate>Fri, 25 Dec 2020 13:41:57 +0000</pubDate>
      <link>https://forem.com/phongduong/create-gradient-text-2h0h</link>
      <guid>https://forem.com/phongduong/create-gradient-text-2h0h</guid>
      <description>&lt;p&gt;You can create text with a single color or combine multiple colors to create gradient text with CSS. In this tutorial, I will show you how to create gradient text using &lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/background-clip"&gt;&lt;code&gt;background-clip&lt;/code&gt;&lt;/a&gt; CSS property.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/background-clip"&gt;&lt;code&gt;background-clip&lt;/code&gt;&lt;/a&gt; sets an element's background extends underneath its border box, padding box, content box or within the foreground text. You will use &lt;code&gt;text&lt;/code&gt; value for this property in this tutorial.&lt;/p&gt;

&lt;p&gt;You create a paragraph first.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;p Lorem ipsum dolor sit amet, consectetur adipiscing elit. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The paragraph needs a background with a gradient color. You set the &lt;code&gt;background-clip&lt;/code&gt; property to &lt;code&gt;text&lt;/code&gt; value. It is the main point of this tutorial.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight scss"&gt;&lt;code&gt;&lt;span class="nt"&gt;p&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;background-image&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;repeating-linear-gradient&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mh"&gt;#01fd69&lt;/span&gt; &lt;span class="m"&gt;2rem&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="no"&gt;tomato&lt;/span&gt; &lt;span class="m"&gt;3rem&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nl"&gt;background-clip&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;text&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You won't see the color of the text changes because you only set the background and the paragraph is still using the default color. To change it, you set the &lt;code&gt;color&lt;/code&gt; of the paragraph to &lt;code&gt;transparent&lt;/code&gt; value.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight scss"&gt;&lt;code&gt;&lt;span class="nt"&gt;p&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;background-image&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;repeating-linear-gradient&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mh"&gt;#01fd69&lt;/span&gt; &lt;span class="m"&gt;2rem&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="no"&gt;tomato&lt;/span&gt; &lt;span class="m"&gt;3rem&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nl"&gt;background-clip&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;text&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;transparent&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now you can see the text with two colors: green and tomato. There is an interesting thing that you can create gradient text for a specific element of the text like the first line or the first letter with CSS &lt;code&gt;pseudo-element&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;To create gradient text for the first line of the text you change the CSS code above&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight scss"&gt;&lt;code&gt;&lt;span class="na"&gt;p&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="n"&gt;first-line&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For the first letter&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight scss"&gt;&lt;code&gt;&lt;span class="na"&gt;p&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="n"&gt;first-letter&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is full code of the project. I create three paragraphs for three examples.&lt;/p&gt;

&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/phongduong/embed/KKgmMaV?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>css</category>
    </item>
    <item>
      <title>Custom link underline with CSS box-shadow</title>
      <dc:creator>Phong Duong</dc:creator>
      <pubDate>Wed, 16 Dec 2020 07:29:16 +0000</pubDate>
      <link>https://forem.com/phongduong/custom-link-underline-with-css-box-shadow-2h93</link>
      <guid>https://forem.com/phongduong/custom-link-underline-with-css-box-shadow-2h93</guid>
      <description>&lt;p&gt;When you create a website, you can customize the text color with &lt;code&gt;color&lt;/code&gt; property. It will change the color of your text as well as the link underline color. But what if you want to set the link underline a different color from the text's color? There are various ways to do that. In this tutorial, I will show you how to use &lt;code&gt;box-shadow&lt;/code&gt; property to customize the link underline.&lt;/p&gt;

&lt;p&gt;To start, you create an anchor element.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a(href="/") This is a link
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In CSS, you disable the &lt;code&gt;text-decoration&lt;/code&gt; property with &lt;code&gt;none&lt;/code&gt; value. The reason we set the text color &lt;code&gt;black&lt;/code&gt; is that it won't change after the link is activated. You use &lt;code&gt;tomato&lt;/code&gt; color for the underline. We need to create space between the text and the underline. We set the &lt;code&gt;padding&lt;/code&gt; of the link &lt;code&gt;4px&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight scss"&gt;&lt;code&gt;&lt;span class="nt"&gt;a&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;text-decoration&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;none&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;black&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;4px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;box-shadow&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="m"&gt;3px&lt;/span&gt; &lt;span class="no"&gt;tomato&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can see that your link underline has a new color. But it doesn't give the user any feedback when they hover over the link. We will make it responds to when the user interacts with the link.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight scss"&gt;&lt;code&gt;&lt;span class="nt"&gt;a&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;text-decoration&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;none&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;black&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;4px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;box-shadow&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="m"&gt;3px&lt;/span&gt; &lt;span class="no"&gt;tomato&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="k"&gt;&amp;amp;&lt;/span&gt;&lt;span class="nd"&gt;:hover&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nl"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;tomato&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;white&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="nl"&gt;box-shadow&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0px&lt;/span&gt; &lt;span class="m"&gt;10px&lt;/span&gt; &lt;span class="m"&gt;10px&lt;/span&gt; &lt;span class="m"&gt;0px&lt;/span&gt; &lt;span class="no"&gt;gray&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The link will be &lt;code&gt;white&lt;/code&gt; with &lt;code&gt;tomato&lt;/code&gt; background. It also had a gray shadow under when you hover the link. But it's quite lagging. To make it smoother, we will use &lt;code&gt;transition&lt;/code&gt; property.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight scss"&gt;&lt;code&gt;&lt;span class="nt"&gt;a&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;transition&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;background&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="mi"&gt;.1s&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;box-shadow&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="mi"&gt;.3s&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;color&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="mi"&gt;.1s&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The text color and the background will change in &lt;code&gt;0.1s&lt;/code&gt; while the box-shadow is in &lt;code&gt;0.3s&lt;/code&gt;. It is smoother now. You can change the transition duration to any value you want. &lt;/p&gt;

&lt;p&gt;Full code&lt;/p&gt;

&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/phongduong/embed/OJRRqBj?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>css</category>
    </item>
    <item>
      <title>caret-color CSS property</title>
      <dc:creator>Phong Duong</dc:creator>
      <pubDate>Fri, 11 Dec 2020 15:11:53 +0000</pubDate>
      <link>https://forem.com/phongduong/caret-color-css-property-1220</link>
      <guid>https://forem.com/phongduong/caret-color-css-property-1220</guid>
      <description>&lt;p&gt;Caret is a cursor in the &lt;code&gt;input&lt;/code&gt;, &lt;code&gt;textarea&lt;/code&gt; elements. It shows where the next typed character will be inserted. &lt;code&gt;caret-color&lt;/code&gt; property sets the color of the caret. It can also be used for the elements with &lt;code&gt;contenteditable&lt;/code&gt; attribute. The default value of this attribute is &lt;code&gt;auto&lt;/code&gt;. It will take &lt;code&gt;currentcolor&lt;/code&gt; and usually black.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;input
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;input&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;red&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When you type the text in the input, the text color is red. &lt;code&gt;caret-color&lt;/code&gt; will take the value of &lt;code&gt;color&lt;/code&gt; property.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;textarea(rows="5")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;textarea&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="py"&gt;caret-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;transparent&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;caret-color&lt;/code&gt; can take &lt;code&gt;transparent&lt;/code&gt; value but it is hard to see where the cursor is especially when you are inserting in between the text.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;p(contenteditable="true") Please click this text and edit it

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

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="nt"&gt;contenteditable&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;"true"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;black&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;yellowgreen&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="py"&gt;caret-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;tomato&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;Although &lt;code&gt;caret-color&lt;/code&gt; takes the value of &lt;code&gt;color&lt;/code&gt; property by default, you can set a different value to ensure good visibility.&lt;/p&gt;

&lt;p&gt;Here is the full example&lt;/p&gt;

&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/phongduong/embed/pobVQbY?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>css</category>
    </item>
    <item>
      <title>Motivate myself everyday</title>
      <dc:creator>Phong Duong</dc:creator>
      <pubDate>Fri, 04 Dec 2020 12:29:44 +0000</pubDate>
      <link>https://forem.com/phongduong/motivate-myself-everyday-3786</link>
      <guid>https://forem.com/phongduong/motivate-myself-everyday-3786</guid>
      <description>&lt;p&gt;Every day I get up, I find it hard to keep up the momentum. Things don't happen as I expected. When I publish a piece of content, I expect many people would consume it. But it doesn't. Although it's fun to create content and express my creativity, I'm sometimes frustrated because it doesn't get any engagement.&lt;/p&gt;

&lt;p&gt;I have to motivate myself to keep going. I have watched an anime series recently. It's Run with the Wind. The series is about a group of 10 college students who are trying to take part in a marathon contest. They don't have any experience in running and have to run 5km in 16 minutes to meet the qualification. After all, they meet the qualification and take part in the contest. They get in the top 10.&lt;/p&gt;

&lt;p&gt;There are many inspiring quotes in the series. I rewatch it 3 times and will watch one more time. These quotes help to motivate me. I find myself in the series. I am doing what I like and happy with it. But I can't be happy all the time. My process is not always linear.&lt;/p&gt;

&lt;p&gt;To motivate myself, I choose to consume other creator's content. I read blogs and books, watch videos and anime. While consuming content, I can have new ideas for my content. It also inspires me to keep going because if they can, me too.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Perfection is a process, not the result</title>
      <dc:creator>Phong Duong</dc:creator>
      <pubDate>Thu, 03 Dec 2020 04:33:24 +0000</pubDate>
      <link>https://forem.com/phongduong/perfection-is-a-process-not-the-result-5eln</link>
      <guid>https://forem.com/phongduong/perfection-is-a-process-not-the-result-5eln</guid>
      <description>&lt;p&gt;For me, perfection is that I don't want to have any errors in what I do. It's hard and exhausted to keep everything perfect. When I publish a piece of content, I want it to be perfect. But I always feel something was wrong and afraid someone would point out the error. After all, I just make a little modification and leave it behind because it's wasting time.&lt;/p&gt;

&lt;p&gt;I have so much content I want to create. I don't want to stick with a piece of content for too long. When I start creating another piece of content, I try to avoid previous mistakes. I also try something new in it. The joy of creating content is you can try something new and see if it works.&lt;/p&gt;

&lt;p&gt;This is the issue that makes me hesitate to create content. I want my content to be useful to my audiences. I also want to create as much content as possible. After trying some ways, I think I should prioritize the quantity rather than quality. Because I can improve my content by creating more.&lt;/p&gt;

&lt;p&gt;Now, perfection for me is not the result of a piece of content. It's a process in which I try, modify, and improve pieces by pieces. If I satisfy with a blog post or video, I just publish it and create another. When I find a mistake, I will fix it.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Custom outline style with CSS</title>
      <dc:creator>Phong Duong</dc:creator>
      <pubDate>Fri, 27 Nov 2020 03:40:25 +0000</pubDate>
      <link>https://forem.com/phongduong/custom-outline-style-with-css-4dg</link>
      <guid>https://forem.com/phongduong/custom-outline-style-with-css-4dg</guid>
      <description>&lt;p&gt;You can custom the outline of the component when you focus on it. CSS allows you to custom these properties:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;outline-color&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;outline-style&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;outline-width&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The order of these properties doesn't matter. You can use just one, two, or all three of them.&lt;/p&gt;

&lt;h2&gt;
  
  
  For example:
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;button&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;tomato&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;white&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;border&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;none&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nt"&gt;button&lt;/span&gt;&lt;span class="nd"&gt;:focus&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;outline&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;blue&lt;/span&gt; &lt;span class="nb"&gt;dotted&lt;/span&gt; &lt;span class="m"&gt;5px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When you click the button, you will see the blue dotted outline around the button.&lt;/p&gt;

&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/phongduong/embed/KKgPvYO?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;The outline doesn't take up space. It won't affect the layout when it shows up.&lt;/p&gt;

</description>
      <category>css</category>
    </item>
    <item>
      <title>Tips for creating content</title>
      <dc:creator>Phong Duong</dc:creator>
      <pubDate>Thu, 26 Nov 2020 11:05:54 +0000</pubDate>
      <link>https://forem.com/phongduong/tips-for-creating-content-4104</link>
      <guid>https://forem.com/phongduong/tips-for-creating-content-4104</guid>
      <description>&lt;p&gt;Creating content is the best way to build your online presence, share knowledge, and promote your product. There are many formats of content: videos, blog posts, images, stories, streams, you name it.&lt;/p&gt;

&lt;p&gt;When I started creating content, I usually asked myself what format I should create and what type of content people would like. I kept asking myself and didn't create anything.&lt;/p&gt;

&lt;p&gt;But it had changed when I watched &lt;a href="https://www.youtube.com/watch?v=RVKofRN1dyI"&gt;this video&lt;/a&gt;. Gary's idea was so brilliant: you document your life. You do what you like and share it with the world instead of creating something new from the void. I liked this idea so much.&lt;/p&gt;

&lt;p&gt;It's been 4 months since I started creating content. In this post, I am going to share some tips I use to create content on some popular platforms. I &lt;a href="https://phongduong.dev/blog/"&gt;write blogs&lt;/a&gt;, &lt;a href="https://www.youtube.com/channel/UCXykqt3V2-9bYXKWZRcH0rA"&gt;make videos on Youtube&lt;/a&gt;, &lt;a href="https://www.twitch.tv/koogio"&gt;stream on Twitch&lt;/a&gt;, and &lt;a href="http://koogio.substack.com/"&gt;publish a weekly newsletter&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  You are a unique piece of content
&lt;/h2&gt;

&lt;p&gt;Your knowledge, experience, and thought are also unique pieces of content. They are valuable to someone out there. They can help people around you. You can create notes of what you are learning and doing. This is also a good way to learn and build in public. Communities like &lt;a href="https://twitter.com/search?q=%23100DaysofCode"&gt;#100DaysOfCode&lt;/a&gt;, &lt;a href="http://dev.to/"&gt;Dev.to&lt;/a&gt;, and &lt;a href="https://www.indiehackers.com/"&gt;Indie Hackers&lt;/a&gt; are the best places to share your progress. If you are reading a useful blog post or watching an interesting video, please share it with people. If it can help you, it also helps people.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bundle and unbundle
&lt;/h2&gt;

&lt;p&gt;Creating content is like playing Lego. You can assemble small pieces into a big piece. You can also break the big piece into small pieces. When you make notes, you can turn them into a blog post later. You can also take quotes from a blog and post it to platforms. I think this is the most amazing aspect of creating content.&lt;/p&gt;

&lt;h2&gt;
  
  
  Consume other's content
&lt;/h2&gt;

&lt;p&gt;If you want to create more content, you should consume more content. The process is continuous. You can have new ideas for your content from what you consumed. If you give the creator a compliment, it is also counted as a piece of content. You can create a newsletter by bundling all the content you consumed in the week. &lt;/p&gt;

&lt;h2&gt;
  
  
  There is no right or wrong answer
&lt;/h2&gt;

&lt;p&gt;There is no one size fits all tip in creating content. That's the truth. My tips work for me but may not work for you. Because you have your own content that's you feel comfortable to create and share. You shouldn't blindly follow any advice or tips you receive. This is when the last tip comes into play. &lt;/p&gt;

&lt;h2&gt;
  
  
  Your creativity
&lt;/h2&gt;

&lt;p&gt;The only way to know what content works best for you is to keep consuming, creating, and trying. Don't be afraid of failure. You will find out your way. &lt;/p&gt;

&lt;h2&gt;
  
  
  The last tip
&lt;/h2&gt;

&lt;p&gt;If people don't consume your content, that's fine. Don't get frustrated. At least they still see you. The most important thing is that you like what you create and enjoy it. That's enough.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Add the pagination on Gridsome site</title>
      <dc:creator>Phong Duong</dc:creator>
      <pubDate>Fri, 20 Nov 2020 13:54:52 +0000</pubDate>
      <link>https://forem.com/phongduong/add-the-pagination-on-gridsome-site-59i8</link>
      <guid>https://forem.com/phongduong/add-the-pagination-on-gridsome-site-59i8</guid>
      <description>&lt;p&gt;To add the pagination for the site, you use &lt;code&gt;@paginate&lt;/code&gt; in your GraphQL query. The query will receive a &lt;code&gt;$page: Int&lt;/code&gt; parameter. The default number of nodes per page is 25.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;page-query&amp;gt;
query ($page: Int) {
  allPost(page: $page) @paginate {
    pageInfo {
      totalPages
      currentPage
    }
    ...
  }
}
&amp;lt;/page-query&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Gridsome provides a &lt;code&gt;Pager&lt;/code&gt; component for pagination. You import the component from &lt;code&gt;gridsome&lt;/code&gt; and place it in your template. It requires a page's &lt;code&gt;info&lt;/code&gt; property. This property is an object that 2 properties: &lt;code&gt;totalPages&lt;/code&gt; and &lt;code&gt;currentPage&lt;/code&gt;. You can get these 2 properties from &lt;code&gt;pageInfo&lt;/code&gt; of your query.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;template&amp;gt;
  &amp;lt;Layout&amp;gt;
    &amp;lt;Pager 
      :info="$page.allPost.pageInfo" 
      :showNavigation="false" 
      range="10"
      linkClass="pager-link"
     /&amp;gt;
  &amp;lt;/Layout&amp;gt;
&amp;lt;/template&amp;gt;

&amp;lt;script&amp;gt;
import { Pager } from 'gridsome'

export default {
  components: {
    Pager
  }
}
&amp;lt;/script&amp;gt;

&amp;lt;page-query&amp;gt;
query ($page: Int) {
  allPost(page: $page) @paginate {
    pageInfo {
      totalPages
      currentPage
    }
    ...
  }
}
&amp;lt;/page-query&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can also customize the &lt;code&gt;Pager&lt;/code&gt; component's properties like show links and navigation, the number of links to show, or the custom class of links for styling.&lt;/p&gt;

</description>
      <category>vue</category>
      <category>gridsome</category>
      <category>javascript</category>
      <category>graphql</category>
    </item>
    <item>
      <title>When life gives you lemons, make lemonade and plant lemon trees</title>
      <dc:creator>Phong Duong</dc:creator>
      <pubDate>Thu, 19 Nov 2020 06:53:17 +0000</pubDate>
      <link>https://forem.com/phongduong/when-life-gives-you-lemons-make-lemonade-and-plant-lemon-trees-5ie</link>
      <guid>https://forem.com/phongduong/when-life-gives-you-lemons-make-lemonade-and-plant-lemon-trees-5ie</guid>
      <description>&lt;p&gt;Sometimes everything doesn't happen as you expected. You may get stuck in difficult situations. You may lose your job, your house, or your family. You would get hurt and frustrated but don't give up. But you can improve your situation and make it better.&lt;/p&gt;

&lt;p&gt;More, you can make use of difficult situations as a source of growth. They will teach you invaluable lessons.&lt;/p&gt;

&lt;p&gt;You can view every situation as a lemon and its seeds as lessons. When life gives you one lemon, you make lemonade. You improve the situation.&lt;/p&gt;

&lt;p&gt;But what about its seeds? After you have the seeds, you can take them to plant new lemon trees. You will harvest your own lemons. This is when you apply your lessons in difficult situations in the future. You are going to know how to solve the problem and improve it.&lt;/p&gt;

&lt;p&gt;The more trees you plant, the large your lemon garden is. You will learn more lessons and become a better person.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;You don't need to be scared of difficult situations, just love and make use of them.&lt;/p&gt;
&lt;/blockquote&gt;

</description>
    </item>
    <item>
      <title>Get the current position of the cursor on the page</title>
      <dc:creator>Phong Duong</dc:creator>
      <pubDate>Wed, 18 Nov 2020 14:41:58 +0000</pubDate>
      <link>https://forem.com/phongduong/get-the-current-position-of-the-cursor-on-the-page-1p7d</link>
      <guid>https://forem.com/phongduong/get-the-current-position-of-the-cursor-on-the-page-1p7d</guid>
      <description>&lt;p&gt;To get the current position of the cursor on the page, you retrieve &lt;code&gt;pageX&lt;/code&gt; and &lt;code&gt;pageY&lt;/code&gt; property of the &lt;code&gt;MouseEvent&lt;/code&gt; interface. These properties are the X and Y coordinates of the event on the document. They are in pixels and relative to the left and top edges of the document.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;mousemove&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;pageX&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;pageY&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;pageX&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;pageY&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These positions can change if you scroll the page. For example: if you scroll the page down 800px and move the cursor to 200px from the top edge of the document, &lt;code&gt;pageY&lt;/code&gt; returns 1000.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Embed social media in Gridsome site with remark plugin</title>
      <dc:creator>Phong Duong</dc:creator>
      <pubDate>Thu, 12 Nov 2020 07:08:37 +0000</pubDate>
      <link>https://forem.com/phongduong/embed-social-media-in-gridsome-site-with-remark-plugin-4f0</link>
      <guid>https://forem.com/phongduong/embed-social-media-in-gridsome-site-with-remark-plugin-4f0</guid>
      <description>&lt;p&gt;When you write your blog, you may want to embed your social media like a tweet, a Facebook post, a Codepen pen, or a Youtube video. They not only make your post more understandable but reduce the needed work especially you write programming tutorials.&lt;/p&gt;

&lt;p&gt;But Gridsome's transformer plugin doesn't transform social media links into the embed code. When you paste your link into the Markdown file, it will stay still and be transformed into a paragraph instead of an embed code.&lt;/p&gt;

&lt;p&gt;In this tutorial, I will show you how to transform your social media links into the embed code with &lt;a href="https://gridsome.org/plugins/@noxify/gridsome-plugin-remark-embed"&gt;gridsome-plugin-remark-embed&lt;/a&gt; plugin. This plugin transforms popular providers embed like Youtube, Facebook, Codepen, Codesanbox, etc...&lt;/p&gt;

&lt;h2&gt;
  
  
  Installation
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;yarn add -D @noxify/gridsome-plugin-remark-embed
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Set up
&lt;/h2&gt;

&lt;p&gt;In the &lt;code&gt;plugins&lt;/code&gt; configuration of Remark, you add the embed plugin&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;remark&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;
      &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@noxify/gridsome-plugin-remark-embed&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;enabledProviders&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Youtube&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Twitter&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Codepen&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
      &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;];&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this configuration, I enable Youtube, Twitter, and Codepen embed providers. I use the provider's default configuration.&lt;/p&gt;

&lt;h2&gt;
  
  
  Add the URL
&lt;/h2&gt;

&lt;p&gt;When you add the URL to your Markdown file, make sure it is in a new paragraph. If you place it in the paragraph with text, the plugin can't transform the link.&lt;/p&gt;

&lt;h2&gt;
  
  
  Run the site
&lt;/h2&gt;

&lt;p&gt;After setting up and adding the URL, you run your site and check the transformation. Different providers may be transformed in different ways. You can see the provider's configuration and customize it to suit your site.&lt;/p&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://webstone.info/documentation/gridsome-plugin-remark-embed"&gt;Remark embed document&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>node</category>
      <category>gridsome</category>
    </item>
    <item>
      <title>Check if a file exists with Nodejs</title>
      <dc:creator>Phong Duong</dc:creator>
      <pubDate>Wed, 11 Nov 2020 13:49:42 +0000</pubDate>
      <link>https://forem.com/phongduong/check-if-a-file-exists-with-nodejs-1n9p</link>
      <guid>https://forem.com/phongduong/check-if-a-file-exists-with-nodejs-1n9p</guid>
      <description>&lt;p&gt;If you need to check if a file exists without opening or modifying with Nodejs, you use &lt;code&gt;fs.access()&lt;/code&gt; method.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;fs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;fs&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="nx"&gt;fs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;access&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;file.txt&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; 
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;not exist&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;exist&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The callback's argument is an &lt;code&gt;Error&lt;/code&gt; object if the check fails.&lt;/p&gt;

</description>
      <category>node</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
