<?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: Anh Tran</title>
    <description>The latest articles on DEV Community by Anh Tran (@rilwis).</description>
    <link>https://dev.to/rilwis</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%2F555399%2Fab97911a-e502-4b88-8d82-d82e00d8dc4b.jpg</url>
      <title>DEV Community: Anh Tran</title>
      <link>https://dev.to/rilwis</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rilwis"/>
    <language>en</language>
    <item>
      <title>Bamboo CSS - A classless CSS library</title>
      <dc:creator>Anh Tran</dc:creator>
      <pubDate>Mon, 08 Mar 2021 06:18:45 +0000</pubDate>
      <link>https://dev.to/rilwis/bamboo-css-a-classless-css-library-5cco</link>
      <guid>https://dev.to/rilwis/bamboo-css-a-classless-css-library-5cco</guid>
      <description>&lt;p&gt;I usually create demos for JavaScript or React like &lt;a href="https://codesandbox.io/s/form-data-to-object-3rt4x?file=/index.html"&gt;creating object from form data&lt;/a&gt;. For such demos, I always have to add some basic styles for HTML elements to make them look good. Using a CSS framework like Bootstrap or Tailwind CSS is overkill, so I decided to create a CSS library to do that. And it's &lt;strong&gt;Bamboo CSS&lt;/strong&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Bamboo CSS is a classless CSS library that adds nice default styles for HTML elements.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://rilwis.github.io/bamboo/demo/"&gt;View demo&lt;/a&gt; | &lt;a href="https://github.com/rilwis/bamboo"&gt;See Github repo&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When creating Bamboo CSS, I search for similar projects and I found some of them like &lt;a href="https://watercss.kognise.dev"&gt;water.css&lt;/a&gt; and &lt;a href="https://newcss.net"&gt;new.css&lt;/a&gt;. But they're too opinionated that I can't use them as base style for my blog or websites.&lt;/p&gt;

&lt;p&gt;It's worth noting that the goal of Bamboo CSS is &lt;em&gt;not only being used as a standalone CSS library, but also with other CSS frameworks&lt;/em&gt;. That means you can use Bamboo CSS as a base style and build your website/blog on that.&lt;/p&gt;

&lt;p&gt;So, I fork new.css to Bamboo CSS because new.css is less opinionated and supports more HTML elements. When doing so, I setup these goals for Bamboo CSS to make it better the other available classless libraries:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Less opinionated&lt;/li&gt;
&lt;li&gt;  Can be used as a base style for your website/blog or with other CSS frameworks&lt;/li&gt;
&lt;li&gt;  Beautiful&lt;/li&gt;
&lt;li&gt;  Supports for as much HTML elements as possible&lt;/li&gt;
&lt;li&gt;  Responsive&lt;/li&gt;
&lt;li&gt;  Consistent styling across browsers&lt;/li&gt;
&lt;li&gt;  Lightweight&lt;/li&gt;
&lt;li&gt;  Incorporate with best CSS practices&lt;/li&gt;
&lt;li&gt;  Supports light and dark mode&lt;/li&gt;
&lt;li&gt;  Themeable with scoped CSS variables&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How to use Bamboo CSS
&lt;/h2&gt;

&lt;p&gt;Using Bamboo CSS is simple, just add the following line into your HTML:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;link rel="stylesheet" href="https://unpkg.com/bamboo.css"&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The default stylesheet provides automatic light/dark mode switching based on system preference.&lt;/p&gt;

&lt;p&gt;If you prefer a light or dark mode, use the snippets below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;!-- Light theme --&amp;gt;
&amp;lt;link rel="stylesheet" href="https://unpkg.com/bamboo.css@1.3.4/dist/light.min.css"&amp;gt;

&amp;lt;!-- Dark theme --&amp;gt;
&amp;lt;link rel="stylesheet" href="https://unpkg.com/bamboo.css@1.3.4/dist/dark.min.css"&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you want to use it with your JavaScript app, you can install it via NPM:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install --save bamboo.css
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Bamboo CSS provides the following CSS variables for theming:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;:root {
    --b-font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    --b-font-mono: Consolas, Monaco, monospace;

    --b-txt: #2e3440;
    --b-bg-1: #fff;
    --b-bg-2: #eceff4;
    --b-line: #eceff4;
    --b-link: #bf616a;
    --b-btn-bg: #242933;
    --b-btn-txt: #fff;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;All CSS variables are prefixed with &lt;code&gt;--b&lt;/code&gt; so it's safe to use Bamboo CSS with your existing websites.&lt;/p&gt;

&lt;p&gt;Check more about the library &lt;a href="https://github.com/rilwis/bamboo"&gt;on Github&lt;/a&gt; and if you like it, please give it a star!&lt;/p&gt;

</description>
      <category>css</category>
      <category>library</category>
      <category>frontend</category>
    </item>
  </channel>
</rss>
