<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: forsigner</title>
    <description>The latest articles on DEV Community by forsigner (@forsigner).</description>
    <link>https://dev.to/forsigner</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%2F618216%2Febff53a9-96bc-48d4-b789-af939b23d394.jpeg</url>
      <title>DEV Community: forsigner</title>
      <link>https://dev.to/forsigner</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/forsigner"/>
    <language>en</language>
    <item>
      <title>Fomir: A Schema-First form library</title>
      <dc:creator>forsigner</dc:creator>
      <pubDate>Sun, 13 Feb 2022 13:06:57 +0000</pubDate>
      <link>https://dev.to/forsigner/fomir-a-schema-first-form-library-30m9</link>
      <guid>https://dev.to/forsigner/fomir-a-schema-first-form-library-30m9</guid>
      <description>&lt;h2&gt;
  
  
  What is Fomir?
&lt;/h2&gt;

&lt;p&gt;Fomir is a Schema-First library for building form.&lt;/p&gt;

&lt;p&gt;Source code in Github: &lt;a href="https://github.com/forsigner/fomir"&gt;&lt;strong&gt;Fomir&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why create a new form library?
&lt;/h2&gt;

&lt;p&gt;I have tried many form libraries, like redux-form, formik, final-form, react-hook-form... None of them suit my taste. I would expect a forms library with these features:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Using schema&lt;/li&gt;
&lt;li&gt;Easy to update form state&lt;/li&gt;
&lt;li&gt;High Performance&lt;/li&gt;
&lt;li&gt;More abstract&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So I create a new form library, and name it to &lt;a href="https://github.com/forsigner/fomir"&gt;&lt;strong&gt;Fomir&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Philosophy
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Schema-First
&lt;/h3&gt;

&lt;p&gt;Fomir create form by passing a form schema which is a json tree. the form schema is very flexible, you can create any form by the schema.&lt;/p&gt;

&lt;h3&gt;
  
  
  State-Driven
&lt;/h3&gt;

&lt;p&gt;Every thing in form schema is state, you can build the form interface easily. it's useful when you create a dynamic form.&lt;/p&gt;

&lt;h3&gt;
  
  
  High Performance
&lt;/h3&gt;

&lt;p&gt;In some case, form performance is very important. Performance of Fomir is high because of subscription-based form state management. It will not rerender the whole form when you update a single field.&lt;/p&gt;

&lt;h3&gt;
  
  
  Sharing and Collaborating
&lt;/h3&gt;

&lt;p&gt;In fomir, the component property in form schema decide how to render the form field. Fomir will push you to create some form component like Input, Select, DatePicker... this will make it easy to share form component in you team.&lt;/p&gt;

&lt;h3&gt;
  
  
  Low-code friendly
&lt;/h3&gt;

&lt;p&gt;Fomir builds form with schema, so fomir is very easy to use in low-code scenarios. when you want to create something like form builder, Fomir might be a good choice.&lt;/p&gt;

&lt;h3&gt;
  
  
  Strongly Typed
&lt;/h3&gt;

&lt;p&gt;Fomir Form provides strong typing via Typescript to allow you to catch common bugs at coding time, and providing the coding intellisense.&lt;/p&gt;

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



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install &lt;/span&gt;fomir fomir-react
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Basic Usage
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;BasicForm&lt;/span&gt;&lt;span class="p"&gt;()&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;form&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;useForm&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="nx"&gt;onSubmit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;values&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;alert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;values&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&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="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;values&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;values&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="na"&gt;children&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="na"&gt;label&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;First Name&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;firstName&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;component&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Input&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&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="na"&gt;label&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Last Name&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;lastName&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;component&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Input&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&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="na"&gt;component&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Submit&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;text&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;submit&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="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Form&lt;/span&gt; &lt;span class="na"&gt;form&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;form&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Documentation
&lt;/h2&gt;

&lt;p&gt;For more detailed usage, please see the documentation: &lt;a href="https://fomir.vercel.app/"&gt;fomir.vercel.app&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>form</category>
      <category>react</category>
      <category>schema</category>
    </item>
    <item>
      <title>A developer-first layout engine for web</title>
      <dc:creator>forsigner</dc:creator>
      <pubDate>Tue, 27 Apr 2021 09:39:57 +0000</pubDate>
      <link>https://dev.to/forsigner/a-developer-first-layout-engine-for-web-1c86</link>
      <guid>https://dev.to/forsigner/a-developer-first-layout-engine-for-web-1c86</guid>
      <description>&lt;p&gt;First of all, this article has a bit of a headline, and I apologize to the readers. The headline of this article is &lt;strong&gt;the layout engine&lt;/strong&gt;. But I suggest that you must read this headline party article, and you will definitely gain something after reading it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why write this article?
&lt;/h2&gt;

&lt;p&gt;A few days ago, I released one of my front-end open source projects named: &lt;a href="https://github.com/forsigner/fower" rel="noopener noreferrer"&gt;Fower&lt;/a&gt;. Many users have asked me what is the difference between Fower and Tailwindcss. My answer is that Fower has the same philosophy in utilty-first. In fact, CSS framework with the utilty-first concept has existed for a long time, such as: &lt;a href="https://acss.io/" rel="noopener noreferrer"&gt;ACSS&lt;/a&gt;, &lt;a href="https://tachyons.io/" rel="noopener noreferrer"&gt;Tachyons&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;One of the biggest differences between Fower and Tailwindcss is that Fower provides a very easy-to-use layout tool: Fower Layout toolkit, which is the reason for writing this article. Below I will share in detail the original intention of developing the Fower layout and its design ideas.&lt;/p&gt;

&lt;h2&gt;
  
  
  Web layout history
&lt;/h2&gt;

&lt;p&gt;Let's briefly review the history of Web layout. During the entire evolution of Web layout, we have experienced no layout, table layout, positioning layout, floating layout, Flexbox layout, and Grid layout.&lt;br&gt;
I will not elaborate on the characteristics and advantages and disadvantages of each layout here. I will only talk about my personal views and conclusions: at the current stage, considering the functionality, ease of use, browser compatibility, etc., using Flexbox layout is the best choice. Some people who are interested in learning more can read the following article.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="http://grid-layout.com/history.html" rel="noopener noreferrer"&gt;Web layout history&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layout/Flexbox" rel="noopener noreferrer"&gt;Flexbox&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Grid_Layout" rel="noopener noreferrer"&gt;CSS Grid Layout&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  The core of the layout
&lt;/h2&gt;

&lt;p&gt;In my opinion, the core of layout is to deal with the spatial relationship between container and items in a certain direction (x, y). There are four essential elements here: container, element, direction, and spatial relationship. In fact, this is also the core of flexbox layout. Almost all concepts and usages of flexbox layout are developed around these four elements. When we get a design draft, if we can quickly identify the containers and elements in it, and clarify their spatial relationship, we can quickly build the interface.&lt;/p&gt;
&lt;h2&gt;
  
  
  Layout in Sketch and Figma
&lt;/h2&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%2Fcgwy5t6n5v9to3agvsys.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%2Fcgwy5t6n5v9to3agvsys.png" alt="Alt Text"&gt;&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxk3gw01sl2f2azsv6j7m.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%2Fxk3gw01sl2f2azsv6j7m.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Figma and Sketch are two very well-known design software. We can see that they consistently use very vivid directives in the processing of element spatial relations: align to top, align to right, align to bottom, align to left , Align base on space. This is also the most intuitive way.&lt;/p&gt;
&lt;h2&gt;
  
  
  Layout In Swift UI and Flutter
&lt;/h2&gt;

&lt;p&gt;Now we look at two modern UI solutions: Swift UI and Flutter, how they deal with UI layout.&lt;/p&gt;

&lt;p&gt;In Swift UI, we can see keywords such as HStack, VStack, aligment, space, etc. We found that Swift UI is also developed around four elements: container, element, direction, and spatial relationship:&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="nx"&gt;struct&lt;/span&gt; &lt;span class="nx"&gt;ContentView&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;View&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;some&lt;/span&gt; &lt;span class="nx"&gt;View&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nc"&gt;HStack&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;alignment&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;top&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="nx"&gt;VStack&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="nc"&gt;CalendarView&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
                &lt;span class="nc"&gt;Spacer&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;
            &lt;span class="nc"&gt;VStack&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;alignment&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;leading&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="nc"&gt;Text&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Event title&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;font&lt;/span&gt;&lt;span class="p"&gt;(.&lt;/span&gt;&lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                &lt;span class="nc"&gt;Text&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Location&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="nc"&gt;Spacer&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="p"&gt;}.&lt;/span&gt;&lt;span class="nf"&gt;padding&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 Flutter, we can see keywords such as Row, Column, aligment, and space. We find that Flutter is also developed around the four elements of container, element, direction, and spatial relationship:&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="nc"&gt;Row&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="nx"&gt;mainAxisAlignment&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;MainAxisAlignment&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;spaceEvenly&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;children&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="nx"&gt;Image&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;asset&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;images/pic1.jpg&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="nx"&gt;Image&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;asset&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;images/pic2.jpg&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="nx"&gt;Image&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;asset&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;images/pic3.jpg&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="nc"&gt;Column&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="nx"&gt;mainAxisAlignment&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;MainAxisAlignment&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;spaceEvenly&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;children&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="nx"&gt;Image&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;asset&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;images/pic1.jpg&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="nx"&gt;Image&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;asset&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;images/pic2.jpg&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="nx"&gt;Image&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;asset&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;images/pic3.jpg&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;We found that the layout concept of Swift UI and Flutter is very similar to Flexbox layout. In addition, we found that their layout code is directly attached to the container and elements, unlike the traditional Web, where the style code needs to be separated into a single CSS File. Fower and Swift UI and Fluter use similar concepts, style is part of the container and elements, which is also the choice of modern UI development&lt;/p&gt;

&lt;p&gt;Some references:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.swiftbysundell.com/articles/swiftui-layout-system-guide-part-1/" rel="noopener noreferrer"&gt;https://www.swiftbysundell.com/articles/swiftui-layout-system-guide-part-1/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://flutter.dev/docs/development/ui/layout" rel="noopener noreferrer"&gt;https://flutter.dev/docs/development/ui/layout&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Disadvantages of Flexbox layout
&lt;/h2&gt;

&lt;p&gt;The above mentioned the layout methods of design software and modern UI frameworks. They are very similar to the Flexbox layout concept. What are the shortcomings of the Flexbox layout?&lt;/p&gt;

&lt;p&gt;Although Flexbox is excellent, but for me, it has one of the biggest shortcoming that it's not developer-first. Flexbox layout is not easy to use enough, and the developer experience is not good enough.&lt;/p&gt;

&lt;p&gt;Flexbox has many concepts: main axis, cross axis, direction, align-item, justify-content, flex-start, flex-end, flex-center, etc. The biggest problem is that when the direction of the main axis changes, attributes such as &lt;code&gt;align-items&lt;/code&gt;, &lt;code&gt;justify-content&lt;/code&gt; make the presentation of the UI very inconsistent with human intuition. Especially for me who are not always writing UI (I often need to write backend, do miscellaneous, etc.), every once in a while, I may forget the usage of &lt;code&gt;align-items&lt;/code&gt;, &lt;code&gt;justify-content&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  My ideal layout (design plan)
&lt;/h2&gt;

&lt;p&gt;Above we talked about the shortcomings of Flexbox layout: not developer-first.&lt;/p&gt;

&lt;p&gt;My ideal layout method should be as easy to use as modern design software. We only need to pay attention to the four elements of the layout: container, element, direction, and spatial relationship. The usage is to find the container and the element, set the direction of the element in the container, and then set the spatial relationship.&lt;/p&gt;

&lt;p&gt;The core here is how to express spatial relationships. I think the most intuitive way of expression is to design software. I abstract this way of expression as: &lt;strong&gt;toCenter&lt;/strong&gt;, &lt;strong&gt;toCenterX&lt;/strong&gt;, &lt;strong&gt;toCenterY&lt;/strong&gt;, &lt;strong&gt;toTop&lt;/strong&gt;, &lt;strong&gt;toRight&lt;/strong&gt;, &lt;strong&gt;toBottom&lt;/strong&gt;, &lt;strong&gt;toLeft&lt;/strong&gt;, &lt;strong&gt;toBetween&lt;/strong&gt;, &lt;strong&gt;toAround&lt;/strong&gt;, &lt;strong&gt;toEvenly&lt;/strong&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;toCenter&lt;/strong&gt;, make children elements align to center, see &lt;a href="https://fower.vercel.app/docs/to-center" rel="noopener noreferrer"&gt;Online Demo&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;toCenterX&lt;/strong&gt;, make children elements align to center horizontal, see &lt;a href="https://fower.vercel.app/docs/to-center-x" rel="noopener noreferrer"&gt;Online Demo&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;toCenterY&lt;/strong&gt;, make children elements align to center vertical, see &lt;a href="https://fower.vercel.app/docs/to-center-y" rel="noopener noreferrer"&gt;Online Demo&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;toTop&lt;/strong&gt;, make children elements align to left, see &lt;a href="https://fower.vercel.app/docs/to-left" rel="noopener noreferrer"&gt;Online Demo&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;toRight&lt;/strong&gt;, make children elements align to right, see &lt;a href="https://fower.vercel.app/docs/to-right" rel="noopener noreferrer"&gt;Online Demo&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;toBottom&lt;/strong&gt;, make children elements align to bottom, see &lt;a href="https://fower.vercel.app/docs/to-bottom" rel="noopener noreferrer"&gt;Online Demo&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;toLeft&lt;/strong&gt;, make children elements align to left, see &lt;a href="https://fower.vercel.app/docs/to-left" rel="noopener noreferrer"&gt;Online Demo&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;toBetween&lt;/strong&gt;, make children elements space between, see &lt;a href="https://fower.vercel.app/docs/to-between" rel="noopener noreferrer"&gt;Online Demo&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;toEvenly&lt;/strong&gt;, make children elements space evenly, see &lt;a href="https://fower.vercel.app/docs/to-evenly" rel="noopener noreferrer"&gt;Online Demo&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;toAround&lt;/strong&gt;, make children elements space around, see &lt;a href="https://fower.vercel.app/docs/to-around" rel="noopener noreferrer"&gt;Online Demo&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Regardless of whether your container is horizontal (row) or vertical (column), the expressions of these directives such as toRight and toBottom will conform to your visual habits.&lt;/p&gt;

&lt;p&gt;Why is this abstract expression better? I think there are several advantages:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It is more in line with human intuition. You only need to remember to deal with the spatial relationship according to the direction, such as: toRight, toBotom, etc. There is nothing more in line with human intuition. The other advantage is that your memory burden will become very small.&lt;/li&gt;
&lt;li&gt;Less code, better maintainability, higher development efficiency&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;My ideal way of writing code (pseudo code):&lt;/p&gt;

&lt;p&gt;1.The following code will automatically center the elements in the container horizontally and vertically, and the container direction is row by default, so it can be omitted:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Container&lt;/span&gt; &lt;span class="na"&gt;toCenter&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;ItemA&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;Container&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The effect is as follows:&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F15q9rp9igliteeeakn66.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%2F15q9rp9igliteeeakn66.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;2.The following code will align the three elements A, B, C to the right in the container. The container defaults to row, so it can be omitted:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Container&lt;/span&gt; &lt;span class="na"&gt;toRight&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;ItemA&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;ItemB&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;ItemC&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;Container&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The effect is as follows:&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7lfdv5cr75hdfunwtb9s.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%2F7lfdv5cr75hdfunwtb9s.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;3.The following code will align the two elements A and B to the right in the container. This time we declare column, so the elements are arranged vertically:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Container&lt;/span&gt; &lt;span class="na"&gt;column&lt;/span&gt; &lt;span class="na"&gt;toRight&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;ItemA&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;ItemB&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;Container&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The effect is as follows:&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fucq0d2jod905ntve95v1.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%2Fucq0d2jod905ntve95v1.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;4.Use composition:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Container&lt;/span&gt; &lt;span class="na"&gt;toBetween&lt;/span&gt; &lt;span class="na"&gt;toCenterY&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;ItemA&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;ItemB&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;ItemC&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;Container&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The effect is as follows:&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqdrurgwpsqyp2icghltq.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%2Fqdrurgwpsqyp2icghltq.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here are just four pseudo-code examples. In fact, you can use "toLeft", "toRight" and other directives to implement most of the UI layout.&lt;/p&gt;

&lt;p&gt;Above, we abstracted the expression of spatial relations and applied directives to the container. Let's take a look at a layout effect, how would you build it with code?&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%2F8etoyhuw8d89ocqj70a9.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%2F8etoyhuw8d89ocqj70a9.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let me talk about my ideal plan, the pseudo code is as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Container&lt;/span&gt; &lt;span class="na"&gt;toBetween&lt;/span&gt; &lt;span class="na"&gt;toCenterY&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;ItemA&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;ItemB&lt;/span&gt; &lt;span class="na"&gt;selfBottom&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;ItemC&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;Container&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here we abstract another type of directives: &lt;strong&gt;selfTop&lt;/strong&gt;, &lt;strong&gt;selfRight&lt;/strong&gt;, &lt;strong&gt;selfBottom&lt;/strong&gt;, &lt;strong&gt;selfLeft&lt;/strong&gt;, &lt;strong&gt;selfStretch&lt;/strong&gt;. These directives can act on elements to individually control the alignment of elements.&lt;/p&gt;

&lt;p&gt;So we have some directives that act on elements:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;selfTop&lt;/strong&gt;, make elements seft align to top&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;selfRight&lt;/strong&gt;, make elements seft align to right&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;selfBottom&lt;/strong&gt;, make elements seft align to bottom&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;selfLeft&lt;/strong&gt;, make elements seft align to left&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;selfStretch&lt;/strong&gt;, make elements seft to Stretch&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Finally, summarize our layout tool design plan:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Container&lt;/strong&gt; Direction control directives, use &lt;strong&gt;row&lt;/strong&gt;, &lt;strong&gt;column&lt;/strong&gt;, if not declared, the default is &lt;strong&gt;row&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Container&lt;/strong&gt; Alignment directives for internal elements: &lt;strong&gt;toCenter&lt;/strong&gt;, &lt;strong&gt;toCenterX&lt;/strong&gt;, &lt;strong&gt;toCenterY&lt;/strong&gt;, &lt;strong&gt;toTop&lt;/strong&gt;, &lt;strong&gt;toRight&lt;/strong&gt;, &lt;strong&gt;toBottom&lt;/strong&gt;, &lt;strong&gt;toLeft&lt;/strong&gt;, &lt;strong&gt;toBetween&lt;/strong&gt;, &lt;strong&gt;toAround&lt;/strong&gt;, &lt;strong&gt;toEvenly&lt;/strong&gt;, these directives can be used to control the alignment of sub-elements, and have nothing to do with row and column directions&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Element&lt;/strong&gt; Self-alignment directives: &lt;strong&gt;selfTop&lt;/strong&gt;, &lt;strong&gt;selfRight&lt;/strong&gt;, &lt;strong&gt;selfBottom&lt;/strong&gt;, &lt;strong&gt;selfLeft&lt;/strong&gt;, &lt;strong&gt;selfStretch&lt;/strong&gt;. These directives individually control the alignment of the element itself&lt;/li&gt;
&lt;li&gt;When any &lt;strong&gt;container&lt;/strong&gt; instruction is used, the flexbox layout will be triggered automatically, no need to manually set the &lt;code&gt;display: flex;&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The above 4 design concepts are my personal ideal layout.&lt;/p&gt;

&lt;h2&gt;
  
  
  Fower Layout
&lt;/h2&gt;

&lt;p&gt;Back to our title: &lt;strong&gt;A developer-first layout engine for web&lt;/strong&gt;. In fact, flex layout cannot be called a layout engine, so what is it? Maybe we call it a layout toolkit will be more appropriate.&lt;/p&gt;

&lt;p&gt;The layout engine here refers to: &lt;a href="https://fower.vercel.app/docs/fower-layout-introduction" rel="noopener noreferrer"&gt;Fower layout toolkit&lt;/a&gt;，A layout tool based on flexbox.&lt;/p&gt;

&lt;p&gt;The biggest feature of Fower layout is developer-first, it is very simple to use and in line with people's intuition.&lt;/p&gt;

&lt;p&gt;For more detailed information about Fower Layout, you can look at the introduction of the official document: &lt;a href="https://fower.vercel.app/docs/fower-layout-introduction" rel="noopener noreferrer"&gt;Fower Layout Introduction&lt;/a&gt;&lt;/p&gt;

</description>
      <category>css</category>
      <category>react</category>
      <category>vue</category>
      <category>typescript</category>
    </item>
    <item>
      <title>Fower v1.0</title>
      <dc:creator>forsigner</dc:creator>
      <pubDate>Wed, 21 Apr 2021 06:35:58 +0000</pubDate>
      <link>https://dev.to/forsigner/fower-v1-0-3gh4</link>
      <guid>https://dev.to/forsigner/fower-v1-0-3gh4</guid>
      <description>&lt;p&gt;After half a year's efforts, today we're finally releasing Fower v1.0.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Fower?
&lt;/h2&gt;

&lt;p&gt;Fower is a styling tool library that allows you to efficiently develop UI. The goal is to make it easier for you to write CSS. The core features of Fower are Atomic, Type Safe, and CSS in JS. It pays great attention to the development experience, allowing you to build user interface quickly and happily.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Story
&lt;/h2&gt;

&lt;p&gt;A year ago, our team was developing Web, React native, and Mini Program projects at the same time. In these three types of projects, we used different styling tool:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In the Web project, we use styed-component to write style;&lt;/li&gt;
&lt;li&gt;In the React native project, we use the &lt;code&gt;StyleSheet.create&lt;/code&gt; that comes with React native;&lt;/li&gt;
&lt;li&gt;In the Mini Program project, We use Sass to write css;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The three style solutions are written in different way, which makes us particularly painful when writing styles:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The development experience is poor. When developing the same user interface, we need to write three types of css code, and need to constantly switch habits and thinking.&lt;/li&gt;
&lt;li&gt;The tool chain is too broad and too complicated,，Styled-component、Sass、StyleSheet.create...&lt;/li&gt;
&lt;li&gt;Development efficiency is low, and there are too many duplicate codes.&lt;/li&gt;
&lt;li&gt;CSS has many inherent shortcomings and poor maintainability.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Later，We discovered &lt;a href="https://tailwindcss.com/"&gt;Tailwindcss&lt;/a&gt;, A utility-first CSS framework. We started to use Tailwindcss in the web project. After some time, we found that the development experience is very good, the development efficiency is very high, especially suitable for our projects that require a highly customized interface. Unfortunately, Tailwindcss cannot be used directly in non-web projects such as React native.&lt;/p&gt;

&lt;p&gt;The members of our team like the style of Tailwindcss, so we create &lt;a href="https://github.com/forsigner/fower"&gt;Fower&lt;/a&gt;, it allows us to unify the way we write styles for all projects.&lt;/p&gt;

&lt;p&gt;Similar to Tailwindcss, we also use the concept of utility-first, but Fower is a bit different. Fower uses Atomic Props to write styles. The code is as follows:&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;toCenterY&lt;/span&gt; &lt;span class="na"&gt;p-10&lt;/span&gt; &lt;span class="na"&gt;w-260&lt;/span&gt; &lt;span class="na"&gt;rounded-10&lt;/span&gt; &lt;span class="na"&gt;shadow&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;circle-48&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"/img/jobs.jpg"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;ml-10&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;textXL&lt;/span&gt; &lt;span class="na"&gt;fontBold&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Steve Jobs&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;span&lt;/span&gt; &lt;span class="na"&gt;gray800&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Co-founder of Apple Inc.&lt;span class="nt"&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&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;h2&gt;
  
  
  Core concepts
&lt;/h2&gt;

&lt;p&gt;Fower is opinionated and we created it based on the following concepts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;utility-first&lt;/strong&gt;, it allows us to write styles more quickly. Unlike other "utility-first" CSS frameworks, Fower uses "Atomic style prop" to write styles.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Type safe&lt;/strong&gt;, Our team is a heavy user of TypeScript. The intellisense brought by Type safe make us hardly read the documents, and we do not rely on any editor plugin when writing code to get accurate auto-completion.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Framework-agnostic&lt;/strong&gt;, This is one of the main reasons we created Fower. Fower allows you to write styles in React, Vue, and React Native in a consistent way.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;CSS in JS&lt;/strong&gt;, We hate to write CSS in a separate CSS file. Pure CSS has many shortcomings, such as: unable to access JS variables; easy to produce style conflicts; easy to generate dead code... We like to use JS (CSS in JS) to write styles, which is more Suitable in the age component. In fact, Fower is not just CSS in JS, we also call it CSS in HTML.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Some Cool features
&lt;/h2&gt;

&lt;p&gt;Fower has many features, such as atomic classes, responsiveness, pseudo-classes, themes, design systems, CSS in JS..., I think these are the basic feature of Fower, not special feature.&lt;/p&gt;

&lt;p&gt;Fower has a few cool features:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Layout Toolkit
&lt;/h3&gt;

&lt;p&gt;If I were to choose a favorite feature in Fower, it would undoubtedly be the &lt;a href="https://fower.vercel.app/docs/fower-layout-introduction"&gt;Layout Toolkit&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Fower provides a powerful Flexbox-based layout toolkit. By adjusting the direction and alignment of the layout, you can build most of the layout and make the layout easier.&lt;/p&gt;

&lt;p&gt;Compared with the traditional flex layout, the layout of Fower is more abstract and streamlined. The layout of Fower is abstracted as &lt;code&gt;toCenter&lt;/code&gt;, &lt;code&gt;toCenterX&lt;/code&gt;, &lt;code&gt;toCenterY&lt;/code&gt;, &lt;code&gt;toLeft&lt;/code&gt;, &lt;code&gt;toTop&lt;/code&gt;, &lt;code&gt;toRight&lt;/code&gt;, &lt;code&gt;toBottom&lt;/code&gt;, &lt;code&gt;toBetween&lt;/code&gt; , &lt;code&gt;toEvenly&lt;/code&gt;, &lt;code&gt;toAround&lt;/code&gt; ten kinds of atomic alignment, you can forget the concept of main axis and cross axis in traditional flex layout when you use them, you only need to have a sense of direction.&lt;/p&gt;

&lt;p&gt;Use as below:&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;toCenter&lt;/span&gt; &lt;span class="na"&gt;bgGray100&lt;/span&gt; &lt;span class="na"&gt;square-200&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;square-60&lt;/span&gt; &lt;span class="na"&gt;bgAmber400&lt;/span&gt; &lt;span class="na"&gt;rounded-8&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;square-80&lt;/span&gt; &lt;span class="na"&gt;bgBlue400&lt;/span&gt; &lt;span class="na"&gt;rounded-8&lt;/span&gt;&lt;span class="nt"&gt;&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;For more detailed usage, please see the document: &lt;a href="https://fower.vercel.app/docs/fower-layout-introduction"&gt;Layout Toolkit&lt;/a&gt;。&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Predictable style
&lt;/h3&gt;

&lt;p&gt;Another cool feature of Fower is the predictable style. In traditional CSS, it's not predictable to override style.&lt;/p&gt;

&lt;p&gt;For example, if you have some css rule like below:&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="nc"&gt;.red&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;span class="nc"&gt;.blue&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;blue&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;And some html with css class "red blue" and "blue red":&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&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;span&lt;/span&gt; &lt;span class="na"&gt;className=&lt;/span&gt;&lt;span class="s"&gt;"red blue"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Fower&lt;span class="nt"&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;span&lt;/span&gt; &lt;span class="na"&gt;className=&lt;/span&gt;&lt;span class="s"&gt;"blue red"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Fower&lt;span class="nt"&gt;&amp;lt;/span&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;Can you judge the color of the text? It's hard to be sure, if we don't see the above CSS code, you can't directly judge the color of the text, you can only find out through debugging with developer tools.&lt;/p&gt;

&lt;p&gt;In Flower, you can easily judge the color of the following text:&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&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;red400&lt;/span&gt; &lt;span class="na"&gt;blue400&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;text will be color blue400&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;blue400&lt;/span&gt; &lt;span class="na"&gt;red400&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;text will be color red400&lt;span class="nt"&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;When we build a reusable component, it's very useful. We can override component style elegantly.&lt;/p&gt;

&lt;p&gt;For more detailed usage, please see the document: &lt;a href="https://fower.vercel.app/docs/predictable-style"&gt;Predictable style&lt;/a&gt;。&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Color helper
&lt;/h3&gt;

&lt;p&gt;Another cool feature of Fower is the color helper. you can handle color with some postfix.&lt;/p&gt;

&lt;p&gt;Use &lt;code&gt;--D{0-100}&lt;/code&gt; postfix to darken a color.&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;toEvenly&lt;/span&gt; &lt;span class="na"&gt;toCenterY&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;red300&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;normal&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;red300--D40&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;darken&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;color=&lt;/span&gt;&lt;span class="s"&gt;"#fff--D40"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;darken&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;bgRed300&lt;/span&gt; &lt;span class="na"&gt;square-84&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;bgRed300--D40&lt;/span&gt; &lt;span class="na"&gt;square-84&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;border&lt;/span&gt; &lt;span class="na"&gt;borderRed300&lt;/span&gt; &lt;span class="na"&gt;square-84&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;border&lt;/span&gt; &lt;span class="na"&gt;borderRed300--D40&lt;/span&gt; &lt;span class="na"&gt;square-84&lt;/span&gt;&lt;span class="nt"&gt;&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;Use &lt;code&gt;--L{0-100}&lt;/code&gt; to lighten a color.&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;toEvenly&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;red500&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;normal&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;red500--T40&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;transparentize&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;color=&lt;/span&gt;&lt;span class="s"&gt;"#000--T40"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;transparentize&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;bgRed500&lt;/span&gt; &lt;span class="na"&gt;square-84&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;bgRed500--T40&lt;/span&gt; &lt;span class="na"&gt;square-84&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;border&lt;/span&gt; &lt;span class="na"&gt;borderRed300&lt;/span&gt; &lt;span class="na"&gt;square-84&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;border&lt;/span&gt; &lt;span class="na"&gt;borderRed300--T40&lt;/span&gt; &lt;span class="na"&gt;square-84&lt;/span&gt;&lt;span class="nt"&gt;&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;Use &lt;code&gt;--T{0-100}&lt;/code&gt; to transparentize a color.&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;toEvenly&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;red500&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;normal&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;red500--T40&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;transparentize&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;color=&lt;/span&gt;&lt;span class="s"&gt;"#000--T40"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;transparentize&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;bgRed500&lt;/span&gt; &lt;span class="na"&gt;square-84&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;bgRed500--T40&lt;/span&gt; &lt;span class="na"&gt;square-84&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;border&lt;/span&gt; &lt;span class="na"&gt;borderRed300&lt;/span&gt; &lt;span class="na"&gt;square-84&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;border&lt;/span&gt; &lt;span class="na"&gt;borderRed300--T40&lt;/span&gt; &lt;span class="na"&gt;square-84&lt;/span&gt;&lt;span class="nt"&gt;&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;Use &lt;code&gt;--O{0-100}&lt;/code&gt; to opacify a color.&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;toEvenly&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;color=&lt;/span&gt;&lt;span class="s"&gt;"rgba(0,0,0,0.4)"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;0.4&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;color=&lt;/span&gt;&lt;span class="s"&gt;"rgba(0,0,0,0.4)--O40"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Opacify to 0.6&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;bg=&lt;/span&gt;&lt;span class="s"&gt;"rgba(0,0,0,0.4)"&lt;/span&gt; &lt;span class="na"&gt;square-84&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;bg=&lt;/span&gt;&lt;span class="s"&gt;"rgba(0,0,0,0.4)--O40"&lt;/span&gt; &lt;span class="na"&gt;square-84&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;border&lt;/span&gt; &lt;span class="na"&gt;borderColor=&lt;/span&gt;&lt;span class="s"&gt;"rgba(0,0,0,0.4)"&lt;/span&gt; &lt;span class="na"&gt;square-84&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;border&lt;/span&gt; &lt;span class="na"&gt;borderColor=&lt;/span&gt;&lt;span class="s"&gt;"rgba(0,0,0,0.4)--O40"&lt;/span&gt; &lt;span class="na"&gt;square-84&lt;/span&gt;&lt;span class="nt"&gt;&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;For more detailed usage, please see the document: &lt;a href="https://fower.vercel.app/docs/color-helper"&gt;Color helper&lt;/a&gt;。&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Composition Postfix
&lt;/h3&gt;

&lt;p&gt;Fower proveders some postfix to handle style, like: &lt;code&gt;--hover&lt;/code&gt;, &lt;code&gt;--focus&lt;/code&gt;, &lt;code&gt;--sm&lt;/code&gt;, &lt;code&gt;--dark&lt;/code&gt;, &lt;code&gt;--T{amount}&lt;/code&gt;...&lt;/p&gt;

&lt;p&gt;Another cool feature of Fower is Composition Postfix. You can combine some postfix, and The order is arbitrary:&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;square-84&lt;/span&gt; &lt;span class="na"&gt;bgOrange300&lt;/span&gt; &lt;span class="na"&gt;bgOrange400--D10--hover--sm&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The below code is equal above:&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;square-84&lt;/span&gt; &lt;span class="na"&gt;bgOrange300&lt;/span&gt; &lt;span class="na"&gt;bgOrange400--hover--sm--D10&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the end, Fower is a opinionated style tool, if you like it, you can give it a star in github: &lt;a href="https://github.com/forsigner/fower"&gt;Fower&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>react</category>
      <category>vue</category>
      <category>css</category>
    </item>
  </channel>
</rss>
