<?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: Nitipit Nontasuwan</title>
    <description>The latest articles on Forem by Nitipit Nontasuwan (@nitipit).</description>
    <link>https://forem.com/nitipit</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%2F198083%2F61a81eb6-59b9-4b9d-a4e1-63b9c4c9827c.jpg</url>
      <title>Forem: Nitipit Nontasuwan</title>
      <link>https://forem.com/nitipit</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/nitipit"/>
    <language>en</language>
    <item>
      <title>Shadow DOM "the right way" in 2024 - Isolation, not complication 🤷</title>
      <dc:creator>Nitipit Nontasuwan</dc:creator>
      <pubDate>Tue, 16 Jan 2024 07:18:51 +0000</pubDate>
      <link>https://forem.com/nitipit/shadow-dom-the-right-way-in-2024-574i</link>
      <guid>https://forem.com/nitipit/shadow-dom-the-right-way-in-2024-574i</guid>
      <description>&lt;p&gt;For many years, I've read about &lt;strong&gt;Shadow DOM&lt;/strong&gt; in Web Component from many places then just wonder why the implementation is so complicated.&lt;/p&gt;

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

&lt;p&gt;While I'm working on Adaptive Style Component Framework: &lt;a href="https://keenlycode.github.io/adapter/" rel="noopener noreferrer"&gt;Adapter&lt;/a&gt;. I found many complicated things when I tried to implement style with Shadow DOM encapsulation. That make me rethink again, is there any easier way to use Shadom DOM ?&lt;/p&gt;




&lt;h1&gt;
  
  
  To the solution
&lt;/h1&gt;

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

&lt;p&gt;If you want to get into the solution right away, this is the idea codes (Not the ideal one but you can get the point). You can read the reason furthur below.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;isolate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;element&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;HTMLElement&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;isolationElement&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;HTMLElement&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;isolationElement&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;isolationElement&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createElement&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;div&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nx"&gt;isolationElement&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;attachShadow&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;&lt;span class="na"&gt;mode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;open&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;element&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;parentElement&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;insertBefore&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;isolationElement&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;element&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nx"&gt;element&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;shadowRoot&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;element&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;Code above will create &lt;code&gt;div&lt;/code&gt; with &lt;code&gt;shadowRoot&lt;/code&gt; and append the whole element inside the &lt;code&gt;shadowRoot&lt;/code&gt;, make it isolated just in place. Then you can code your &lt;code&gt;element&lt;/code&gt; as you do in Normal DOM&lt;/p&gt;

&lt;p&gt;Next example shows an idea how to implement it in Web Component class&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;class&lt;/span&gt; &lt;span class="nc"&gt;Component&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nc"&gt;HTMLElement&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;isolated&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;element&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;HTMLElement&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;element&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;element&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createElement&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;div&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="nx"&gt;element&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;attachShadow&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;mode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;open&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="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;parentElement&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;insertBefore&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;element&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="nx"&gt;element&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;shadowRoot&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;appendChild&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&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;h1&gt;
  
  
  Why ?
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Shadow DOM&lt;/strong&gt; brings &lt;strong&gt;"Component Isolation"&lt;/strong&gt; concept to Web Application. However, the way developers implements it so far is different from what I'm thinking recently.&lt;/p&gt;

&lt;p&gt;Let's take a look at the code from &lt;a href="https://web.dev/articles/shadowdom-v1" rel="noopener noreferrer"&gt;https://web.dev/articles/shadowdom-v1&lt;/a&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;

&lt;span class="c1"&gt;// Use custom elements API v1 to register a new HTML tag and define its JS behavior&lt;/span&gt;
&lt;span class="c1"&gt;// using an ES6 class. Every instance of &amp;lt;fancy-tab&amp;gt; will have this same prototype.&lt;/span&gt;
&lt;span class="nx"&gt;customElements&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;define&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;fancy-tabs&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;extends&lt;/span&gt; &lt;span class="nx"&gt;HTMLElement&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;constructor&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;super&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="c1"&gt;// always call super() first in the constructor.&lt;/span&gt;

    &lt;span class="c1"&gt;// Attach a shadow root to &amp;lt;fancy-tabs&amp;gt;.&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;shadowRoot&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;attachShadow&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;&lt;span class="na"&gt;mode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;open&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;});&lt;/span&gt;
    &lt;span class="nx"&gt;shadowRoot&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerHTML&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;`
        &amp;lt;style&amp;gt;#tabs { ... }&amp;lt;/style&amp;gt; &amp;lt;!-- styles are scoped to fancy-tabs! --&amp;gt;
        &amp;lt;div id="tabs"&amp;gt;...&amp;lt;/div&amp;gt;
        &amp;lt;div id="panels"&amp;gt;...&amp;lt;/div&amp;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;This is the default pattern introduced by &lt;strong&gt;many famous web component documentations&lt;/strong&gt;. It's the easiest way to jump straight to use Shadow DOM in Web Component, but it cause many following complicatations.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;It separates DOM access between &lt;strong&gt;Host&lt;/strong&gt; and &lt;strong&gt;Shadow DOM&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;It separated CSS application from &lt;strong&gt;Host&lt;/strong&gt; and &lt;strong&gt;Shadow DOM&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

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

&lt;p&gt;This is where the complication start. When we use Shadom DOM like this in web component, we have to think from the start if the component will contain shadowRoot or not. Then it separate Web Component into 2 types, "Shadow" or "Light" DOM&lt;br&gt;
Which also brings a lot of awkward way to implement component methods and CSS.&lt;/p&gt;

&lt;p&gt;When you want to access child nodes from &lt;strong&gt;Shadow Host&lt;/strong&gt;, you have to access &lt;code&gt;shadowRoot&lt;/code&gt;. When you want to apply css on host node, you have to use &lt;code&gt;:host {}&lt;/code&gt;. This add an extra layer to program or style component which doesn't exist in normal components.&lt;/p&gt;

&lt;p&gt;Does it have to be like that ? On my second thought, I come up with another solution.&lt;/p&gt;

&lt;p&gt;Let's use Shadow DOM in the right way ?&lt;br&gt;
You can read my solution above again.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>webcomponents</category>
    </item>
    <item>
      <title>Adapter - Adaptive Style Web Component Framework</title>
      <dc:creator>Nitipit Nontasuwan</dc:creator>
      <pubDate>Sun, 07 Jan 2024 18:41:12 +0000</pubDate>
      <link>https://forem.com/nitipit/adapter-adaptive-style-web-component-framework-4pc5</link>
      <guid>https://forem.com/nitipit/adapter-adaptive-style-web-component-framework-4pc5</guid>
      <description>&lt;p&gt;Hi, recently I have created a new project call &lt;strong&gt;Adapter&lt;/strong&gt; which bring CSS to the next Level with Web-Component. I'm very excited to share .&lt;br&gt;
for more info: &lt;a href="https://keenlycode.github.io/adapter/"&gt;https://keenlycode.github.io/adapter/&lt;/a&gt;&lt;/p&gt;
&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;
&lt;h2&gt;
  
  
  What is Adapter ?
&lt;/h2&gt;



&lt;p&gt;&lt;strong&gt;Adapter&lt;/strong&gt; is a JavaScript framework designed to seamlessly integrate&lt;br&gt;
&lt;strong&gt;CSS-in-JS&lt;/strong&gt; with &lt;strong&gt;Web Components&lt;/strong&gt;. Setting it apart from other&lt;br&gt;
&lt;strong&gt;CSS&lt;/strong&gt; libraries, Adapter is framework which focus is on&lt;br&gt;
&lt;strong&gt;Web Component Styling&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Despite its simplicity, &lt;strong&gt;Adapter&lt;/strong&gt; unlocks endless possibilities&lt;br&gt;
for enhancing UX/UI in web applications. While traditional &lt;strong&gt;CSS&lt;/strong&gt; frameworks&lt;br&gt;
have faced limitations, on the other hand, &lt;strong&gt;Adapter&lt;/strong&gt; can implement features&lt;br&gt;
such as encapsulation, inheritance, composition, event-interaction,&lt;br&gt;
and other complex styling requirements which opens up new potential&lt;br&gt;
for creating dynamic and feature-rich user interfaces.&lt;/p&gt;
&lt;h2&gt;
  
  
  Examples
&lt;/h2&gt;


&lt;h3&gt;
  
  
  OOP
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Adapter&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@devcapsule/adapter&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;FlexBox&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nc"&gt;Adapter&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="nx"&gt;css&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;`
        display: flex;
        justify-content: center;
    `&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="cm"&gt;/** WrapFlexBox also inhertit styles from FlexBox */&lt;/span&gt;
&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;WrapFlexBox&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nc"&gt;Flexbox&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="nx"&gt;css&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;`
        flex-wrap: wrap;
    `&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;WrapFlexBox&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;define&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;el-wrap-flexbox&lt;/span&gt;&lt;span class="dl"&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 will produce CSS as&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;el-wrap-flexbox&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;flex&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;justify-content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;flex-wrap&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;wrap&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;Then, you can use them in html or create an instance by javascript&lt;/p&gt;



&lt;p&gt;Javascript&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Create &amp;lt;el-flexbox&amp;gt; in OOP manner.&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;flexBox&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;FlexBox&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;flexBox&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;







&lt;p&gt;HTML&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;el-wrap-flexbox&amp;gt;&amp;lt;/el-wrap-flexbox&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;h3&gt;
  
  
  Variables and Functions
&lt;/h3&gt;



&lt;p&gt;Javascript&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;Color&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;color&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;bgColor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;color&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s2"&gt;`
        background-color: &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;color&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;;
        color: &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nc"&gt;Color&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;color&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;isDark&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="s1"&gt;white&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;black&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;;
    `&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;trim&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;RedFlexBox&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nc"&gt;FlexBox&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="nx"&gt;css&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nf"&gt;bgColor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;red&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;bgColor&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;RedFlexBox&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;h3&gt;
  
  
  Variables / Functions / OOP / Modules , That's it !
&lt;/h3&gt;

&lt;h3&gt;
  
  
  CSS now is programmable with ES6 ! ... What else do we need ? 😉
&lt;/h3&gt;

&lt;h2&gt;
  
  
  What problem is the adapter trying to solve ?
&lt;/h2&gt;




&lt;p&gt;One of the most common problems for &lt;strong&gt;CSS&lt;/strong&gt; which is hard to implement&lt;br&gt;
is &lt;strong&gt;Style Encapsulation and Inheritance&lt;/strong&gt;, since we can't easily make sure that element styles&lt;br&gt;
won't &lt;strong&gt;unintentionally&lt;/strong&gt; be inherited or overridden from somewhere else.&lt;/p&gt;

&lt;p&gt;Consider this situation where button style has been defined&lt;br&gt;
in one of &lt;code&gt;&amp;lt;style&amp;gt;&lt;/code&gt; tag&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;style&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nt"&gt;button&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;background-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="nt"&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If we have a component somewhere which contains &lt;code&gt;&amp;lt;button&amp;gt;&lt;/code&gt; without using&lt;br&gt;
&lt;code&gt;customElements&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"componentA"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;div&amp;gt;&amp;lt;button&amp;gt;&lt;/span&gt;Button&lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this situation, your components style &lt;strong&gt;might&lt;/strong&gt; be overridden by&lt;br&gt;
global &lt;code&gt;&amp;lt;style&amp;gt;&lt;/code&gt; from somewhere if you don't make &lt;strong&gt;CSS&lt;/strong&gt; selector&lt;br&gt;
more specific like,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;style&amp;gt;&lt;/span&gt;
&lt;span class="c"&gt;/* this won't work */&lt;/span&gt;
&lt;span class="nc"&gt;.componentA&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="err"&gt;div&lt;/span&gt; &lt;span class="err"&gt;button&lt;/span&gt; &lt;span class="err"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;blue&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="err"&gt;}&lt;/span&gt;

&lt;span class="c"&gt;/* this work */&lt;/span&gt;
&lt;span class="nc"&gt;.componentA&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="err"&gt;div&lt;/span&gt; &lt;span class="err"&gt;&amp;gt;&lt;/span&gt; &lt;span class="err"&gt;button&lt;/span&gt; &lt;span class="err"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;blue&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="err"&gt;}&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is just a simple example. Imagine when we have many elements&lt;br&gt;
and more style properties; this could be a headache&lt;br&gt;
and prone to causing errors in component styling,&lt;br&gt;
or at least it prevents us from achieving a composed style&lt;br&gt;
between elements/components or libraries.&lt;/p&gt;

&lt;h3&gt;
  
  
  Component Styling to save the world !
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Web Component Styling&lt;/strong&gt; can solve this problems, because&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;When you use &lt;code&gt;customElements.define()&lt;/code&gt;, it will show errors
if the custom element has already been defined somewhere else,
allowing you to decide how to deal with it.&lt;/li&gt;
&lt;li&gt;Defined custom elements have their own unique tags,
preventing global styles from &lt;strong&gt;unintentionally&lt;/strong&gt; overriding components
and their elements. However, you still have full control of a component
from global styles if desired, making it ideal for theming
which &lt;strong&gt;Shadow DOM lacks this features&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Let's see how to implement CSS Styling in Adapter Component.&lt;/p&gt;



&lt;p&gt;JS&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;class&lt;/span&gt; &lt;span class="nc"&gt;ComponentA&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nc"&gt;Adapter&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="cm"&gt;/** CSS will be isolated in ComponentA
     * Moreover, we can write CSS for this component without worrying
     * about this component tagName.
     */&lt;/span&gt;
    &lt;span class="kd"&gt;static&lt;/span&gt; &lt;span class="nx"&gt;css&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;`div button { background-color: blue} `&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;ComponentA&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;define&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;el-component-a&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;







&lt;p&gt;HTML&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;el-component-a&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;div&amp;gt;&amp;lt;button&amp;gt;&lt;/span&gt;Button&lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/el-component-a&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





</description>
    </item>
    <item>
      <title>CSS management is easy with &lt;web-component/&gt;</title>
      <dc:creator>Nitipit Nontasuwan</dc:creator>
      <pubDate>Wed, 30 Nov 2022 11:19:29 +0000</pubDate>
      <link>https://forem.com/nitipit/css-management-is-easy-with-34ml</link>
      <guid>https://forem.com/nitipit/css-management-is-easy-with-34ml</guid>
      <description>&lt;p&gt;I've coded &lt;strong&gt;CSS&lt;/strong&gt; for more than 15 years. &lt;strong&gt;CSS&lt;/strong&gt; in complex &lt;strong&gt;WebApp&lt;/strong&gt; nowadays is getting messy. That's why many &lt;strong&gt;CSS&lt;/strong&gt; methodologies have been invented so far such as OOCSS, BEM, SMACSS, Atomic CSS. However, each methodology still has it's own advantages and disadvantages to debate.&lt;/p&gt;

&lt;p&gt;Although there're many methodologies to choose. I still feel pain to manage &lt;strong&gt;CSS&lt;/strong&gt; which make me always think that there's something still missing. After thinking and researhing, I think I've found the conclusion that &lt;strong&gt;CSS&lt;/strong&gt; is just a styling language. It lacks of &lt;strong&gt;Object Oriented&lt;/strong&gt; features. That's why it's hard to maintain and scale.&lt;/p&gt;

&lt;p&gt;What's so close to make &lt;strong&gt;CSS&lt;/strong&gt; becomes like &lt;strong&gt;Object&lt;/strong&gt; is &lt;strong&gt;OOCSS&lt;/strong&gt;. However, &lt;strong&gt;CSS&lt;/strong&gt; methodology alone can't help much. That's why I've created &lt;a href="https://keenlycode.github.io/adapter/" rel="noopener noreferrer"&gt;&lt;strong&gt;Adapter&lt;/strong&gt;&lt;/a&gt; project to introduce a new concept which use &lt;strong&gt;Javascript&lt;/strong&gt; and &lt;strong&gt;&amp;lt;web-component/&amp;gt;&lt;/strong&gt; technology together with &lt;strong&gt;CSS&lt;/strong&gt; . Start with simple &lt;strong&gt;APIs&lt;/strong&gt; :&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="c1"&gt;// Javascript&lt;/span&gt;
&lt;span class="nf"&gt;define&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;el-card&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;Card&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;Card&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;tagStyle&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`background-color: white;`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;Card&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;classStyle&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;lift&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`
    box-shadow: 0 2px 5px 0 rgb(0 0 0 / 50%);
`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;card_id_highlight&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;#highlight&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;card_id_highlight&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addStyle&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`font-size: 1.5rem;`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="c"&gt;&amp;lt;!-- HTML --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;el-card&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"highlight"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    Card content goes here.
&lt;span class="nt"&gt;&amp;lt;/el-card&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;el-card&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"lift"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    Lifted card.
&lt;span class="nt"&gt;&amp;lt;/el-card&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I think that's a very interesting idea. With this implementation, I can use &lt;strong&gt;CSS&lt;/strong&gt; in &lt;strong&gt;Object-Oriented&lt;/strong&gt; space. &lt;code&gt;import&lt;/code&gt; &lt;code&gt;export&lt;/code&gt; &lt;code&gt;variables&lt;/code&gt; &lt;code&gt;function&lt;/code&gt; &lt;code&gt;scope&lt;/code&gt; &lt;code&gt;class&lt;/code&gt; &lt;code&gt;module&lt;/code&gt; &lt;code&gt;packaging&lt;/code&gt; .. that's a lot of features which can help to maintain and scale &lt;strong&gt;CSS&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The rest of this story is in &lt;strong&gt;Adapter&lt;/strong&gt; project. You can take a look at &lt;a href="https://keenlycode.github.io/adapter/" rel="noopener noreferrer"&gt;Adapter : Adaptive Style Web Component&lt;/a&gt; . Hope that it can blow &lt;strong&gt;CSS&lt;/strong&gt; pain away. ;)&lt;/p&gt;

</description>
      <category>watercooler</category>
    </item>
    <item>
      <title>Adwaita Icon Web v2.1.1</title>
      <dc:creator>Nitipit Nontasuwan</dc:creator>
      <pubDate>Tue, 22 Jun 2021 10:10:36 +0000</pubDate>
      <link>https://forem.com/nitipit/adwaita-icon-web-v2-1-1-bc4</link>
      <guid>https://forem.com/nitipit/adwaita-icon-web-v2-1-1-bc4</guid>
      <description>&lt;p&gt;Hi, just release Adwaita Icon Web v2.1.1&lt;br&gt;
Update icons from Gnome 40, :)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--KDtCL-9B--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://nitipit.github.io/adwaita-icon-web/adwaita-screenshot.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--KDtCL-9B--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://nitipit.github.io/adwaita-icon-web/adwaita-screenshot.png" alt="Adwaita Icon"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>html</category>
      <category>icon</category>
      <category>symbolic</category>
    </item>
    <item>
      <title>Adwaita Icon for Website</title>
      <dc:creator>Nitipit Nontasuwan</dc:creator>
      <pubDate>Sun, 29 Sep 2019 15:59:44 +0000</pubDate>
      <link>https://forem.com/nitipit/adwaita-icon-for-website-1fen</link>
      <guid>https://forem.com/nitipit/adwaita-icon-for-website-1fen</guid>
      <description>&lt;p&gt;Just update Adwaita Icon for website using Adwaita-Icon-Theme for Gnome 3.34. Get it here &lt;a href="https://github.com/nitipit/adwaita-icon-web"&gt;https://github.com/nitipit/adwaita-icon-web&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--n8g6EghM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/t00cqsf264b938pk0517.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--n8g6EghM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/t00cqsf264b938pk0517.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>html</category>
      <category>icon</category>
      <category>webdev</category>
    </item>
    <item>
      <title>bits-ui.com : Simple and elegant UI Library</title>
      <dc:creator>Nitipit Nontasuwan</dc:creator>
      <pubDate>Fri, 06 Sep 2019 16:24:34 +0000</pubDate>
      <link>https://forem.com/nitipit/bits-ui-com-4jbl</link>
      <guid>https://forem.com/nitipit/bits-ui-com-4jbl</guid>
      <description>&lt;p&gt;Would like to share Web Components and CSS Library for building website.&lt;br&gt;
&lt;a href="https://bits-ui.com" rel="noopener noreferrer"&gt;bits-ui.com&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fqdx1zf72c3gpx0spnl1u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fqdx1zf72c3gpx0spnl1u.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

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