<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Nitin Jadhav on Medium]]></title>
        <description><![CDATA[Stories by Nitin Jadhav on Medium]]></description>
        <link>https://medium.com/@nitinj?source=rss-f702d79f1988------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Mtb9IplJXs-EI-eh3Gg2MQ.jpeg</url>
            <title>Stories by Nitin Jadhav on Medium</title>
            <link>https://medium.com/@nitinj?source=rss-f702d79f1988------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 22:59:24 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@nitinj/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Easy theming with CSS Variables: Add dark mode to your app]]></title>
            <link>https://medium.com/@nitinj/easy-theming-with-css-variables-add-dark-mode-to-your-app-d4f3fecdf3bf?source=rss-f702d79f1988------2</link>
            <guid isPermaLink="false">https://medium.com/p/d4f3fecdf3bf</guid>
            <category><![CDATA[theming]]></category>
            <category><![CDATA[css-variables]]></category>
            <category><![CDATA[css]]></category>
            <category><![CDATA[dark-mode]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Nitin Jadhav]]></dc:creator>
            <pubDate>Wed, 27 May 2020 07:31:47 GMT</pubDate>
            <atom:updated>2020-05-27T07:31:47.642Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vSk-YPo0lQ03KLWK0slh7w.gif" /></figure><h3>Why join the dark side (｡▽皿▽) ?</h3><p>Adding dark mode to websites/web-apps are trending now. Here are some of its benefits:</p><ul><li>Dark mode is easy on eyes for some users</li><li>You can add various themes along with dark mode (for example, Sepia). This makes your app more interesting.</li><li>Your app looks infinitely better with dark mode.</li><li>Users may save some battery using dark mode.</li></ul><p>It’s really easy (will take a day or so for small-sized website or app).</p><h3>Demo</h3><p>here is a demo: <a href="https://codesandbox.io/s/theming-css-variables-7tsnw">Codesandbox</a></p><h3>CSS Variables</h3><p>If you are living under a rock, CSS variables are like JavaScript variables. We can define CSS variables at one place in the stylesheet and can use those variables all over stylesheets instead of hardcoded values. These are the building blocks of model CSS architecture.</p><pre>body {<br>	--myFavColor: #BADA55; // variable defination<br>}</pre><pre>.myDiv {<br>	background-color: var(--myFavColor); //usage<br>}</pre><p>You need to have a basic html page. I will use a simple html login form and some basic styling.</p><pre>&lt;body&gt;<br>      &lt;form action=&quot;&quot; class=&quot;myForm&quot;&gt;<br>        &lt;h1&gt;Login Form&lt;/h1&gt;<br>        &lt;div class=&quot;field&quot;&gt;<br>          &lt;label for=&quot;username&quot;&gt;User Name&lt;/label&gt;<br>          &lt;input type=&quot;text&quot; id=&quot;username&quot; name=&quot;useraname&quot; /&gt;<br>        &lt;/div&gt;<br>        &lt;div class=&quot;field&quot;&gt;<br>          &lt;label for=&quot;password&quot;&gt;Password&lt;/label&gt;<br>          &lt;input type=&quot;password&quot; id=&quot;password&quot; name=&quot;password&quot; /&gt;<br>        &lt;/div&gt;</pre><pre>        &lt;label&gt; &lt;input type=&quot;checkbox&quot; name=&quot;rememberme&quot; /&gt; Remember Me &lt;/label&gt;<br>        &lt;div class=&quot;button-container&quot;&gt;<br>          &lt;button class=&quot;button&quot; type=&quot;submit&quot;&gt;Login&lt;/button&gt;<br>        &lt;/div&gt;<br>      &lt;/form&gt;<br>    &lt;script src=&quot;src/index.js&quot;&gt;&lt;/script&gt;<br>&lt;/body&gt;</pre><p>Note that all the styling is done through CSS classes, <em>no inline styles are used</em>.</p><h4>Step #1: Add light CSS class with some CSS variable definitions</h4><p>Add a light class. This will be a default light theme for our app.</p><pre>.light {<br>  --background: #f1faee;<br>  --background-alt: #a8dadc;<br>  --foreground: #1d3557;<br>  --accent: #0e8185;<br>}</pre><p>We can use these variables in our stylesheet, instead of hardcoded values.</p><pre>body {<br>  padding: 0;<br>  margin: 0;<br>  font-family: sans-serif;<br>  display: flex;<br>  justify-content: center;<br>  align-items: center;<br>  height: 100vh;<br>  color: var(--foreground);<br>  background-color: var(--background);<br>}</pre><pre>.myForm {<br>  padding: 2rem;<br>  background-color: var(--background-alt);<br>  width: 24rem;<br>}<br>.myForm .field {<br>  padding: 1rem 0;<br>}<br>.myForm .field label {<br>  display: block;<br>  margin-bottom: 0.5rem;<br>}<br>.myForm .field input {<br>  border: 2px solid var(--accent);<br>  padding: 0.5rem;<br>  width: 100%;<br>}</pre><pre>.button-container {<br>  text-align: right;<br>}</pre><pre>.button {<br>  color: var(--background);<br>  background-color: var(--foreground);<br>  padding: 0.5rem 2rem;<br>  border: 0;<br>}</pre><p><strong>Optional</strong>: We may also want to add some CSS variables that are independent of any theme. Usually, they are defined in html tag.</p><pre>/* these variables are theme-independent */<br>html {<br>  --purewhite: #ffffff;<br>  --pureblack: #000000;<br>}</pre><h4>Step #2: Add light class to your body tag</h4><pre>&lt;body class=&quot;light&quot;&gt;<br>	&lt;!-- html here -- &gt;<br>&lt;/body&gt;</pre><h4>Step #3: Add dark CSS class with exact variable definitions as of light class, but with different colours that are suitable for dark mode</h4><pre>.dark {<br>  --background: #1d3557;<br>  --background-alt: #457b9d;<br>  --foreground: #f1faee;<br>  --accent: #84a59d;<br>}</pre><p>Once again, we have to add all of the variables that are there is light class.</p><p>Colours will usually be inverted (e.g. light text on dark background) as opposed to light class.</p><h4>Step #4: Add a button to switch between themes</h4><p>We have to add an action, which will replace the light class of body tag with dark class (and vice versa).</p><p>classList.toggle() method toggles a CSS class in the given element&#39;s classes.</p><pre>&lt;button id=&quot;theme-toggle&quot;&gt;Toggle Dark Theme&lt;/button&gt;</pre><pre>//javascript<br>document.getElementById(&quot;theme-toggle&quot;).addEventListener(&quot;click&quot;, function() {<br>  document.body.classList.toggle(&quot;light&quot;);<br>  document.body.classList.toggle(&quot;dark&quot;);<br>});</pre><p><strong>Optional</strong>: You can add more themes like Sepia and use something like dropdown as theme switcher. You may also want to save/restore theme choice to/from local storage for persistence.</p><p>See the completed demo here: <a href="https://codesandbox.io/s/theming-css-variables-7tsnw">Codesandbox</a></p><p>That’s it!</p><p>You just added a dark mode to your website/app.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d4f3fecdf3bf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[HTTP/2: As web developer, What you need to change]]></title>
            <link>https://medium.com/@nitinj/http-2-as-web-developer-what-you-need-to-change-bc21011f782f?source=rss-f702d79f1988------2</link>
            <guid isPermaLink="false">https://medium.com/p/bc21011f782f</guid>
            <category><![CDATA[webdev]]></category>
            <category><![CDATA[performance]]></category>
            <category><![CDATA[http2]]></category>
            <dc:creator><![CDATA[Nitin Jadhav]]></dc:creator>
            <pubDate>Mon, 09 Mar 2020 14:08:16 GMT</pubDate>
            <atom:updated>2020-03-09T14:08:16.349Z</atom:updated>
            <content:encoded><![CDATA[<h3>As of March 2020, HTTP/2 is used by 43.8% of all the websites. This numbers will only grow. This is short summary of my recent exploration of subject.</h3><h3><strong>A Quick Overview of HTTP/2</strong></h3><ul><li>HTTP/2 is a new Protocol that is replacing HTTP/1.1 thats currently de-facto standard of web.</li><li>Main motivation behind it is Performance.</li><li>Its backward compatible. Clients and browsers can use HTTP/1.1 as usual if they don’t support HTTP/2.</li><li>With HTTP/2, SSL is recommended for performance reasons, but not compulsory.</li></ul><h3><strong>What improvements HTTP/2 brings?</strong></h3><ul><li><strong>Multiplexing:</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/821/1*aesfBgoLNA-SFi6vZB2IdQ.png" /><figcaption>HTTP/1.1 request vs HTTP/2 requests</figcaption></figure><p>Http/2 can fetch multiple files (usually HTML, JS CSS files etc) simultaneously from server. It uses same TCP connection for multiple files, hence multiplexing. Only one TCP connection is necessary.<br>In comparison, Http/1.1 allows 4–8 max connections to server (per domain) at same time, restricting number of files you can fetch. One request has to wait for previous request to finish.</p><ul><li>Uses <strong>Binary encoding</strong> for request/response as compared to http/1.1 which uses text encoding. That means <strong>more accurate handling of Line endings, whitespace encoding</strong> etc. Binary encoding is also efficient to parse and use.</li><li><strong>Stream Prioritization</strong><br>Each request stream can be prioritised. So browser can download a critical css file on priority while JS files may load with lower priority. (I haven’t seen example of this in wild, but will update this point when the more details are available).</li><li><strong>Stream dependencies</strong>: Dependencies between streams can also be specified. So we can say that one js file can be dependent on another one.</li><li><strong>HTTP header compression</strong><br>Http/2 supports header compression. That means less data on wire.</li><li><strong>Server Initiated Push</strong><br>Unlike Http/1.1, Http/2 server can start pushing files to client on its own even before client requests those. This reduced latency and wait for html-parsing-and-asset-request.</li></ul><h3><strong>How to prepare for HTTP/2?</strong></h3><p><strong>Stop bundling assets:</strong><br>No need to bundle css/JS files since http/2 supports multiplexing. There is almost no overhead in making many web requests. It may also mean that we don’t have to deploy entire bundle when only couple of files are updated.</p><p><strong>Stop inlining JS/CSS/Images/SVG:</strong><br>Fetch those as separate files. You might get advantage of browser caching with seperate files.</p><p><strong>Use lazy loading:</strong> for JS/css files. This is more efficient and reduces initial load time.</p><p><strong>Stop creating image Sprites</strong>:<br>This in now unnecessary due to multiplexing. This also means simpler workflow and build script.</p><p><strong>Stop domain sharding</strong>:<br>No need to spread your files across multiple domains, since we can fetch everything now from same domain.</p><p><strong>Start Using HTTPS</strong>:<br>Its recommended standard with HTTP/2. You get more secure website/app by default.</p><p>But As always,</p><ul><li>Make sure your audience is using latest browsers(HTTP/2 is now supported in nearly all browsers, except our usual suspect, IE &lt; v10)</li><li>HTTP/2 is enabled on your server.</li></ul><p>See you on HTTP2!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bc21011f782f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Improve your JavaScript with functional programming]]></title>
            <link>https://medium.com/@nitinj/improve-your-javascript-with-functional-programming-7c1068862104?source=rss-f702d79f1988------2</link>
            <guid isPermaLink="false">https://medium.com/p/7c1068862104</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[functional-programming]]></category>
            <dc:creator><![CDATA[Nitin Jadhav]]></dc:creator>
            <pubDate>Wed, 31 Jul 2019 08:35:33 GMT</pubDate>
            <atom:updated>2019-07-31T08:35:33.614Z</atom:updated>
            <content:encoded><![CDATA[<p>If you want to write your JavaScript code in a better way, one of the most effective techniques is functional programming (FP). It’s no difficult than the language itself — don’t let anyone else tell you otherwise. This series will have multiple posts.</p><h3>Use Pure functions</h3><p>A pure function is one which</p><ol><li>Does not access anything else other than provided arguments.</li><li>Does not modify anything outside of a function. It may return the calculated value based on arguments. This means that they will always return the same output when provided with the same input.</li></ol><h4>Example of pure function</h4><pre>function calculateArea = (radius) =&gt; 3.14 * radious * radius;</pre><h3>Use map() instead of for/forEach for array conversions</h3><p>(you are probably already doing this)</p><p>Process and covert an array into a new array using for/forEach</p><pre>const nums = [1,2,3,4,5,6];<br>const doubles = [];<br>for(let i = 0; i &lt; nums.length; i++){<br>  doubles.push(nums[i] * 2);<br>}<br>// nums.forEach(item =&gt; doubles.push(item * 2)); // foreach version<br>console.log(doubles)</pre><p>Instead, you should be using map() function (which is built-in in JavaScipt)</p><pre>const nums = [1,2,3,4,5,6];<br>const doubles = nums.map(item =&gt; item * 2);<br>console.log(doubles)</pre><h4>Why use the map() instead of the above methods?</h4><ul><li>The code is almost human-readable (“map this array to that with function x”), easy to understand</li><li>It’s minimalistic, uses fewer keystrokes, hence fewer potential bugs</li><li>Its faster than other versions</li></ul><h3>Use reduce() instead of for loop for additive calculations</h3><p>If you want to calculate something which depends on every value of array, use reduce() function. e.g. you need to add up every element of an array.</p><p>for/forEach method:</p><pre>const array1 = [1, 2, 3, 4];<br>let sum = 0;<br>for(let i=0; i&lt; array1.length; i++){<br>  sum+=array1[i];<br>}<br>// array1.forEach(item =&gt; sum+= item); //forEach version</pre><pre>// 1 + 2 + 3 + 4<br>console.log(sum);</pre><pre>const array1 = [1, 2, 3, 4];<br>const sum = array1.reduce((sum, current) =&gt; sum+current, 0);</pre><pre>// 1 + 2 + 3 + 4<br>console.log(sum);</pre><h4>Why use the reduce() instead of the above methods?</h4><ul><li>less boilerplate than for loop</li><li>A common construct, much cleaner to read</li><li>can be chained with other array functions like map: array1.map(i =&gt; i*2).reduce((sum, current) =&gt; sum+current)</li></ul><h3>use filter() method for array filter operations:</h3><p>Filtering array with for loop for even numbers:</p><pre>const array1 = [1, 2, 3, 4];</pre><pre>const evenArray1 = [];<br>for(let i = 0; i&lt;array1.length; i++){<br>  if(array1[i] % 2 === 0){<br>    evenArray1.push(array1[i]); //copy only even elements<br>  }<br>}<br>console.log(evenArray1);</pre><h4>User filter() method instead:</h4><pre>const array1 = [1, 2, 3, 4];</pre><pre>const evenArray1 = array1.filter(item =&gt; item % 2 === 0);<br>console.log(evenArray1);</pre><h3>Use every() and some() instead of manual search with for loops</h3><p>Checking if all items in an array satisfy certain criteria (even)</p><pre>const array1 = [2,4,8];</pre><pre>let isAllEven = true;<br>for(let i = 0; i&lt;array1.length; i++){<br>  if(array1[i] % 2 !== 0){<br>    isAllEven = false;<br>    break;<br>  }<br>}<br>console.log(isAllEven);</pre><p>Use every() for the same:</p><pre>const array1 = [2,4,8, 3];</pre><pre>let isAllEven = array1.every(item =&gt; item % 2 === 0)<br>console.log(isAllEven);</pre><p>Checking if at least one item in an array satisfy certain criteria (even)</p><pre>const array1 = [1, 3];</pre><pre>let isAtleastOneEven = false;<br>for(let i = 0; i&lt;array1.length; i++){<br>  if(array1[i] % 2 === 0){<br>    isAtleastOneEven = true;<br>    break;<br>  }<br>}<br>console.log(isAtleastOneEven);</pre><p>Use some() for the same:</p><pre>const array1 = [1, 2, 3];</pre><pre>let isAtleastOneEven =  array1.some(item =&gt; item % 2 ===0)<br>console.log(isAtleastOneEven);</pre><h3>Use Partial functions to create new functions from existing functions using bind()</h3><p>You can derive new functions from existing functions. E.g. you have a power function that calculates the power of number.</p><pre>const power = (p, num) =&gt; num ** p;</pre><p>you can create a new function square() and cube() that uses an existing function</p><pre>const square = power.bind(null, 2);<br>const cube = power.bind(null, 3);</pre><pre>console.log(square(5))  // 25<br>console.log(cube(5))  // 125</pre><p>In the next article, we will discuss some of the advanced functional programming concepts. Thanks!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7c1068862104" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Quickly start a Hot-reloaded web  project with ParcelJS]]></title>
            <link>https://medium.com/@nitinj/quickly-start-a-hot-reloaded-web-project-with-parceljs-52e4d3afb404?source=rss-f702d79f1988------2</link>
            <guid isPermaLink="false">https://medium.com/p/52e4d3afb404</guid>
            <category><![CDATA[parcel-js]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Nitin Jadhav]]></dc:creator>
            <pubDate>Sat, 26 Jan 2019 06:21:40 GMT</pubDate>
            <atom:updated>2019-01-26T06:21:40.127Z</atom:updated>
            <content:encoded><![CDATA[<h3>Quickly start a Hot-reloaded web project with ParcelJS</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/0*sTbgxMusvyK1nn9u.png" /></figure><p>Want to start a quick Web/HTML+SASS+HTML modules project with auto reload? You don&#39;t have to fiddle with nodemon/local-server/webpack/other such tools anymore!</p><p>ParcelJS is the new module bundler that out of the box supports everything (well, almost everything) with no config at all. With Parcel, you not only get a zero-config auto-reloading local dev server but much more out of the box:</p><ul><li>Hot module reloading, obviously</li><li>SASS, postCSS, postHTML, Stylus</li><li>Code splitting using JS dynamic import</li><li>And much more!11!!1!</li></ul><p>here is how to get started:</p><ul><li>Create a new directory “my-project” and insider it, start new npm project using</li></ul><pre>npm init -y</pre><ul><li>Create index.html file in this directory with some content</li></ul><pre>&lt;html&gt;<br>&lt;body&gt;<br>  &lt;script src=&quot;./index.js&quot;&gt;&lt;/script&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</pre><p>…and JS file</p><pre>console.log(&quot;js here&quot;);</pre><ul><li>Add parcel to the mix</li></ul><pre>npm install -g parcel-bundler</pre><p>(you can also add parcel globally if you don&#39;t want it in your package.json)</p><ul><li>Start project</li></ul><pre>parcel index.html</pre><p>This will start a hot-reload web server and open index.html in the browser.</p><ul><li>Add SASS to project</li></ul><pre>npm install sass --save-dev</pre><p>Now you can use sass files as usual.</p><p>Don&#39;t forget to import sass file in your index.js file:</p><pre>import &quot;./styles.scss&quot;;</pre><ul><li>You can create various HTML files for say, header, footer etc and include those with</li></ul><pre>&lt;include src=&quot;./src/header.html&quot;&gt;&lt;/include&gt;</pre><p>But for this to work, you have to add postHTML support:</p><pre>npm install posthtml-include --save-dev</pre><p>…and create a <strong>.posthtmlrc.js</strong> in the project root directory with content:</p><pre>module.exports = {<br>  plugins: {<br>    &quot;posthtml-include&quot;: {<br>      root: __dirname<br>    }<br>  }<br>};</pre><ul><li>For optimized production bundle, run</li></ul><pre>parcel build index.html</pre><p>All set. Enjoy a fully functional, hot-reloaded web project with all the goodies!</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FBSx6mzbW1ew7K%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FBSx6mzbW1ew7K%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2FBSx6mzbW1ew7K%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="391" frameborder="0" scrolling="no"><a href="https://medium.com/media/82991fb2e5ff67cd07c3cbbe8c5f94a4/href">https://medium.com/media/82991fb2e5ff67cd07c3cbbe8c5f94a4/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=52e4d3afb404" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Tailwind CSS reduced my frontend development time]]></title>
            <link>https://medium.com/@nitinj/how-tailwind-css-reduced-my-frontend-development-time-a98365258737?source=rss-f702d79f1988------2</link>
            <guid isPermaLink="false">https://medium.com/p/a98365258737</guid>
            <category><![CDATA[design-systems]]></category>
            <category><![CDATA[design-thinking]]></category>
            <category><![CDATA[css]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Nitin Jadhav]]></dc:creator>
            <pubDate>Tue, 15 Jan 2019 05:06:57 GMT</pubDate>
            <atom:updated>2019-01-15T05:06:57.204Z</atom:updated>
            <content:encoded><![CDATA[<p>Tailwind CSS has reduced my style-development time to half. It’s amazing and something that you should try!</p><p>Tailwind CSS is a utility first CSS framework that enables rapid CSS development — it’s basically a set of CSS classes that we can apply on HTML tags to get results and try things quickly. I am sure you have used bootstrap at some point of time and you know for responsiveness, bootstrap has classes like row, <em>col</em> and <em>col-lg-2</em>. Apply and forget.</p><pre>&lt;div class=&quot;container&quot;&gt;<br>  &lt;div class=&quot;row justify-content-md-center&quot;&gt;<br>    &lt;div class=&quot;col col-lg-2&quot;&gt;<br>      1 of 3<br>    &lt;/div&gt;<br>    &lt;div class=&quot;col-md-auto&quot;&gt;<br>      Variable width content<br>    &lt;/div&gt;<br>    &lt;div class=&quot;col col-lg-2&quot;&gt;<br>      3 of 3<br>    &lt;/div&gt;<br>  &lt;/div&gt;<br>&lt;/div&gt;</pre><p><strong>Classes like row, col are utility classes.</strong></p><p>We don&#39;t have to write dedicated CCS classes for grid functionality. Similarly, tailwind CSS provides a comprehensive suite of CSS classes for everything from <em>flexbox</em> to <em>font</em> properties like <em>font-weight</em> and <em>font-decoration</em>. just as we did in the above example, we can compose required CSS classes to achieve the required functionality.</p><p><strong>See the following HTML code and output:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/410/1*OgX0mq6M4Jg8M4JQaFyDvw.png" /><figcaption>The output of following code snippet</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u1U7nYB1_fx-lNMsvy6_7w.png" /><figcaption>Ordinary HTML and CSS code</figcaption></figure><p><strong>In Ordinary HTML/CSS:</strong></p><ul><li>First, you have to write HTML and invent some class names and hierarchy. Many times, they clash with existing names.</li><li>In the possibly separate CSS file, define those classes. Frequent file switch.</li><li>Even to try out things, we have to do the above steps — who knows when it will look perfect and we can just leave it there?</li><li>You have to write lengthy CSS properties yourself like “background-color: blue;”. This slows down things.</li><li>Unless you are using CSS or SASS variables, you might end up in having a mixture of all sort of colors and sizes.</li></ul><p><strong>Now with Tailwind CSS,</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sPhgCqXxbFi_nx2HvYzupw.png" /><figcaption>Code with Tailwind CSS utility classes</figcaption></figure><ul><li>You need to write HTML and quickly apply utility CSS classes as you go.</li><li>No separate CSS file to fiddle with and look up frequently.</li><li>Try out things rapidly — without bothering of separate dedicated CSS classes. Should this div be a blue-border? Just add <em>border-blue</em> and forget.</li><li>Shorter code like <em>bg-blue</em> instead of <em>background-color: blue;</em></li><li>Utility classes for your colors, sizes are predefined (more on this later) and fixed. Everybody used those classes — this ensures a common standard.</li></ul><p>All this combined gives us a rapid UI Style development toolkit that enables excellent DX (Developer experience).</p><p><strong>You can customize tailwind classes for your design system.</strong></p><p>First, you have to write a tailwind configuration file. You can add all type of things like font sizes and rounded borders. It looks like this:</p><pre>let colors = {</pre><pre>black: &quot;#22292f&quot;,</pre><pre>&quot;grey-darker&quot;: &quot;#606f7b&quot;,</pre><pre>grey: &quot;#b8c2cc&quot;,</pre><pre>&quot;grey-light&quot;: &quot;#dae1e7&quot;,</pre><pre>white: &quot;#ffffff&quot;,</pre><pre>beige: &quot;#f8f8f8&quot;,</pre><pre>&quot;red-light&quot;: &quot;#ef5753&quot;,</pre><pre>&quot;green-light&quot;: &quot;#51d88a&quot;,</pre><pre>blue: &quot;#3490DC&quot;,</pre><pre>&quot;blue-light&quot;: &quot;#6CB2EB&quot;,</pre><pre>&quot;blue-dark&quot;: &quot;#34495e&quot;</pre><pre>};</pre><pre>width: {</pre><pre>auto: &quot;auto&quot;,</pre><pre>px: &quot;1px&quot;,</pre><pre>&quot;1&quot;: &quot;0.25rem&quot;,</pre><pre>&quot;2&quot;: &quot;0.5rem&quot;,</pre><pre>&quot;3&quot;: &quot;0.75rem&quot;,</pre><pre>&quot;4&quot;: &quot;1rem&quot;,</pre><pre>&quot;5&quot;: &quot;1.25rem&quot;,</pre><pre>&quot;6&quot;: &quot;1.5rem&quot;,</pre><pre>&quot;8&quot;: &quot;2rem&quot;</pre><pre>}</pre><pre>// and many, many more things like these</pre><p>After that, tailwind utility will generate CSS utility classes like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Cg8bx2CICDyCIpc0YOrxIg.png" /></figure><p>A complete tutorial on how to configure tailwind for your design system will soon follow!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a98365258737" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[React] COmponent state: setState(function) or setState(object)?]]></title>
            <link>https://medium.com/@nitinj/react-component-state-setstate-function-or-setstate-object-a59d275e45d7?source=rss-f702d79f1988------2</link>
            <guid isPermaLink="false">https://medium.com/p/a59d275e45d7</guid>
            <category><![CDATA[best-practices]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Nitin Jadhav]]></dc:creator>
            <pubDate>Wed, 21 Nov 2018 13:38:27 GMT</pubDate>
            <atom:updated>2018-11-25T07:58:16.807Z</atom:updated>
            <content:encoded><![CDATA[<h3>[React] Component state: setState(function) or setState(object)?</h3><figure><img alt="Image result for react setstate" src="https://cdn-images-1.medium.com/proxy/1*JLfnJyOTlxwknAB9oQ4FFg.png" /><figcaption>⚛️ Local components state is still important, even after Hooks.</figcaption></figure><p>React has two ways of setting a local state. The setState() function with state object as a parameter, while the second way is setState() function with function as a parameter. Which one you should use in your code? what’s the benefit of one over other? let’s see.</p><p><strong>First form with state object as a parameter.</strong></p><pre>this.setState({<br>    someValue: state.somevalue + 1<br>});</pre><p>The problem with this approach is when you repeatedly call this function, react tries to batch the state update and you might lose some of your updates.</p><pre>...</pre><pre>const someFunc() {<br>    ....<br>    setState({myVar: myVar+1});<br>    setState({myVar: myVar+1});<br>    setState({myVar: myVar+1});<br>}</pre><p>In the above code, you may lose some of these updates altogether. this is unsuitable for production and might cause severe hard-to-find bugs.</p><p><strong>The second form is with a function as a parameter.</strong></p><pre>this.setState((state, props)=&gt;({<br>    someValue: state.somevalue + 1<br>}));</pre><p>This approach is preferred because even if you call this form frequently, Every update will go thru perfectly. This happens since each time react calls provided function, providing state and getting the new state in return. This new state will be passed as a parameter to the next subsequent function (this is clear from the documentation). This is important if you are making a lot of subsequent updates.</p><p>As a thumb rule, you should always use the function form of setState(). This would result in more robust code.</p><p><strong>There is a Gotcha: consider this form handling method</strong></p><pre>handleTextChange = event =&gt; {</pre><pre>    this.setState(value =&gt; ({ value: event.target.value }));</pre><pre>};</pre><p>for a simple form:</p><pre>//form</pre><pre>&lt;form onSubmit={this.handleSubmit}&gt;</pre><pre>&lt;label&gt;Name:</pre><pre>&lt;input type=&quot;text&quot; value={this.state.value} <br>onChange={this.handleTextChange} /&gt;<br>&lt;/label&gt;</pre><pre>&lt;button type=&quot;submit&quot;&gt;Ok&lt;/button&gt;</pre><pre>&lt;/form&gt;</pre><p>This won’t work!</p><p>because react has synthetic events which are reused when it’s handling is done. calling function form of setState will defer evaluation of <strong>event.target.value</strong> in future, where the event may be reused for something else and may not have value at all.</p><p>So, correct version would be</p><pre>handleTextChange = event =&gt; {</pre><pre>   const val = event.target.value;</pre><pre>   this.setState(state =&gt; ({ value: val }));</pre><pre>};</pre><p>Save the value of target before calling function form of setState and then use it.</p><p>Thanks for reading.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a59d275e45d7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My Experience: Learning Angular 5 as a long time react developer]]></title>
            <link>https://medium.com/@nitinj/my-experience-learning-angular-5-as-a-long-time-react-developer-584c87d4987a?source=rss-f702d79f1988------2</link>
            <guid isPermaLink="false">https://medium.com/p/584c87d4987a</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Nitin Jadhav]]></dc:creator>
            <pubDate>Tue, 03 Apr 2018 17:28:45 GMT</pubDate>
            <atom:updated>2018-05-08T09:24:05.609Z</atom:updated>
            <content:encoded><![CDATA[<p>I started with frontend programming 5 years back with jQuery and AngularJS. I later switched to React. For project requirement, I recently learned Angular 5.</p><p><strong>Update</strong>: I opted for library “ngxs” instead of ngrx for state management. It is much more elegant (IMO) and have very less boilerplate. I feel much more productive with ngxs than with ngrx.</p><p>Here is my opinion on how these frameworks fare in comparison:</p><pre>Angular 2+ vs React  <br>                                                                                                       * Learning curve<br><strong>Angular:</strong> Huge learning curve. There are many of new concepts to learn which are simply non-existent in react world.                                                                                                                  <strong>React:</strong> Relatively small learning curve.                                                                                                                                                                                                </pre><pre>* Time required to be productive                                                                                                                                                                                                                            <strong>Angular:</strong> 4 Days<br><strong>React: </strong>1.5 Days</pre><pre>* Coding language<br><strong>Angular: </strong>Typescript - took 0.5 day to learn. Editor shows type errors  upfront, it saves time. It definitely has advantages, but those come at an overhead of all the extra code and thinking you have to do.<br><strong>React: </strong>Es6+. No brainer. Coding is faster as compared to typescript. Editor will not show type errors due to lack of types. You can enjoy all the cutting edge ES Next features with babel, which may not be possible with typescript.</pre><pre>* Boilerplate<br><strong>Angular:</strong> Needs more boilerplate code than react. Ngrx needs less boilerplate code than redux.                                                                                                                                <strong>React:</strong> There is boilerplate, but not as much as Angular. Functional components can be one liners.                                                                                                                                      </pre><pre>* State Management<br><strong>Angular:</strong> Ngrx (Ng-Redux), even if I knew most of the state management concepts, took me 1 Day to learn. Learning material was not as qualitative as redux.                                                                           <strong>React:</strong> Redux took approx. 0.5 day to learn. <br>-- Both of above are identical in many ways.                                                                                                                                                                                           </pre><pre>* Form Handling<br><strong>Angular: </strong>Angular reactive forms - official angular package - is highly productive thing. Json extraction, async validation - everything is there. I am loving it - it makes life so much easier without getting in way.<br><strong>React:</strong> Plain react form handling is PITA. I have tried redux-form and it felt strange. But there are other form handling libs I have not tried yet - they may be good.</pre><pre>* UI Component libraries<br><strong>Angular: </strong>Official Material component library is fast and polished, but lot of components are missing from it (e.g.  breadcrumbs). There are some really nice 3rd party libraries like Clarity. Overall average components ecosystem.<br><strong>React:</strong> There are large number of polished component libraries - Ant UI is one of the best.</pre><pre>* Third party individual, specialized UI components<br><strong>Angular:</strong> Lots of 3rd party components, but variety is little disappointing.                                                                                                                                                          <strong>React: </strong>Rich components system, you will find components for every imaginable thing.</pre><pre>* Dev tools<br><strong>Angular: </strong>Augury is main dev tool. Its powerful but not sure if its official. Ngrx uses redux devtools. Apart from these, not many devtools. Overall disappointing tools ecosystem.                                                  <strong>React: </strong>React devtools are powerful and official. There are many 3rd party ones like &quot;Reselect devtools&quot; and &quot;Storybook&quot;. Even redux has its own many 3rd party dev tools.</pre><pre>* Command line tools<br><strong>Angular:</strong> Has powerful cli tools. It can generate components, directives etc. on the fly. It is huge time saver.                                                                                                              <strong>React:</strong> lacks any cli tool (apart from create react app, which is covered separately and can&#39;t generate individual components).</pre><pre>* Project bootstrapping<br><strong>Angular: </strong>Angular cli generates basic project. Its good enough and cli tool gets updated frequently. It supports SCSS.                                                                                                                <strong>React: </strong>create-react-app is the bootstrapping tool that generates basic project. Its pretty good. It does not support SCSS.</pre><pre>* How productive I felt after learning?<br><strong>Angular: </strong>All the extra angular things - made me less productive than React. I felt overwhelmed with these new but not-so-productive concepts.                                                                                        <strong>React: </strong>I felt much more productive instantly. Writing components is pleasure.</pre><pre>* Unit testing<br><strong>Angular: </strong>Protractor - angular testing tool was a nightmare in angular 1.x. I haven&#39;t tries it&#39;s modern Angular avatar, so cat say if it is any good.                                                                                    <strong>React: </strong>Jest and enzyme is a pleasure to work with. Unit testing is effortless.</pre><pre>* Community                                          <br><strong>Angular: </strong>I found there is good dev community around angular, but smaller than React.                                                                                                                                                 <strong>React: </strong>has gigantic dev community. You can easily find multiple solutions, advices on problems and approaches.</pre><pre>* My overall experience<br><strong>Angular: </strong>Good, but not great. I must mention that in some areas like form handling, it is much better than react though.                                                                                                                                       <strong>React: </strong>Development experience in React is delightful. With each new version, it becomes even more wonderful.</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=584c87d4987a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I hosted my React based website on github for free]]></title>
            <link>https://medium.com/@nitinj/how-i-hosted-my-react-based-website-on-github-for-free-8d623b9697f6?source=rss-f702d79f1988------2</link>
            <guid isPermaLink="false">https://medium.com/p/8d623b9697f6</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[website]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[web-hosting]]></category>
            <dc:creator><![CDATA[Nitin Jadhav]]></dc:creator>
            <pubDate>Thu, 14 Dec 2017 14:35:18 GMT</pubDate>
            <atom:updated>2017-12-14T14:35:18.053Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9sA3QAuby9KoCDoG91TGnQ.png" /></figure><p>You probably know github hosting is free for open source projects. But incase you are not aware —<strong> you can also host your personal website there for free</strong>! Few months back — I purchased my domain name. Here are all steps how build my freely hosted react-based website.</p><p><strong>STEP 1</strong></p><p>Purchase a domain name — mine is <a href="http://nitinj.com/">http://nitinj.com</a> (warning: Its work in progress!), got from an indian domain provider.</p><p><strong>STEP 2</strong></p><p>Start a new react project with <a href="https://github.com/facebookincubator/create-react-app"><strong>create-react-app</strong></a><strong> </strong>(I know, react can be overkill for personal websites, but I am planning to add some advanced &amp; interesting stuff).</p><p><strong>STEP 3</strong></p><p>build the project with command</p><pre>yarn build</pre><p>It will create a directory “build” in the root of the project. You can run local development server with</p><pre>yarn start</pre><p>and see a default react project page.</p><p>Now create a new directory “my-project”. Copy content from “build” directory to this “my-project” directory. Inside my-project, create a directory named “source”. Copy all source files from react project to this source directory.</p><p><strong>Why this?</strong> Because github only allows serving of website files from root directory of repo. So our source will reside in source subdir while out built code will reside in project root directory. You may want to use github submodules or separate projects for this purpose. I wanted to put source plus output in same project.</p><p>Your directory structure should look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/895/1*PQyEv-UVOKYE2fNWF7zTDQ.png" /><figcaption>Outer directory with compiled files as content</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/932/1*5ToR_-eE8rgnzNFIXGKkfg.png" /><figcaption>Inner source directory with source code</figcaption></figure><p><strong>STEP 4</strong></p><p>Create a new file in root directory with name “CNAME” and content as just</p><pre>yourdomain.com</pre><p>No http:// needed. commit everything, including build output and source in repository.</p><p><strong>STEP 5</strong></p><p>Create a new public github project “nitinja.github.io”. You can give a name of your choice — but at the time of creating site, github was forcing such a name format for project if one plans to use the repo for personal website.</p><p>Open command line, Go to your react project root directory and add this repo as origin</p><pre>git remote add origin <a href="https://github.com/user/repo.git">https://github.com/user/repo.git</a></pre><p>this will connect your project to remote github repo.</p><p>Check “Settings section” of your github repo by visiting github.com &gt; your repo &gt; settings &gt; GitHub Pages section. It should look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_UV0yjM3f9mzCU86jfz4dg.png" /><figcaption>Git hub settings should look like this.</figcaption></figure><p><strong>STEP 6</strong></p><p>Add following “A Record” configuration to your domain provider settings — it may be well hidden in settings. Basically, you need to add two A records for these IP addresses: <strong>192.30.252.153</strong>; <strong>192.30.252.154</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Dtf_Rnw6XcEhCNdEY6euww.png" /><figcaption>My Domain A record setting</figcaption></figure><p>After some time, check your domain in browser — It should show react start page!</p><p><strong>STEP 7</strong></p><p>Time to add real content to your site. Modify source project, add whatever stuff you need. Build project again with</p><pre>yarn build</pre><p>Copy content from “build” directory to root directory of your project. Rinse and repeat.</p><p>You may want to write a script that does a building, copying and committing files.</p><p>Suggestion? Let me know in comments. Thanks!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8d623b9697f6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CSS-Only Stylish Checkboxes and Radios]]></title>
            <link>https://medium.com/@nitinj/css-only-stylish-checkboxes-and-radios-d66de5a9e57a?source=rss-f702d79f1988------2</link>
            <guid isPermaLink="false">https://medium.com/p/d66de5a9e57a</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[css]]></category>
            <category><![CDATA[forms-design]]></category>
            <category><![CDATA[visual-design]]></category>
            <dc:creator><![CDATA[Nitin Jadhav]]></dc:creator>
            <pubDate>Thu, 25 May 2017 04:58:41 GMT</pubDate>
            <atom:updated>2017-05-25T04:58:41.284Z</atom:updated>
            <content:encoded><![CDATA[<p>I recently struggled with styling checkboxes and radios with CSS. While I could use libraries like <a href="http://icheck.fronteed.com/">iCheck</a>, I wanted to avoid Javascript and jQuery. Why add another library to application just for the sake of visual styles?</p><p>Here is my implementation of CSS-Only solution to this problem.</p><p>Check Live <a href="http://nitinj.com/code-experiments/css-examples-experiments/stylish-checkboxes-radios.html">Demo</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lX_0tV8XirZimtkrany_Rw.png" /><figcaption>Checkboxes and radio buttons after styling</figcaption></figure><p>It&#39;s easy:</p><p>Create a plain checkbox in this format:</p><pre>&lt;<strong>div class=&#39;example&#39; </strong>&gt;<br>    &lt;<strong>input type=&#39;checkbox&#39; id=&#39;my-checkbox&#39; </strong>&gt;<br>    &lt;<strong>label for=&#39;my-checkbox&#39; </strong>&gt;My Checkbox&lt;/<strong>label </strong>&gt;<br>&lt;/<strong>div </strong>&gt;<br>&lt;<strong>div class=&#39;example&#39; </strong>&gt;<br>    &lt;<strong>input type=&#39;radio&#39; name=&#39;radio-group-1&#39; id=&#39;my-radio1&#39; </strong>&gt;<br>    &lt;<strong>label for=&#39;my-radio1&#39; </strong>&gt;My Radio 1&lt;/<strong>label </strong>&gt;<br>    &lt;<strong>input type=&#39;radio&#39; name=&#39;radio-group-1&#39; id=&#39;my-radio2&#39; </strong>&gt;<br>    &lt;<strong>label for=&#39;my-radio2&#39; </strong>&gt;My Radio 1&lt;/<strong>label </strong>&gt;<br>&lt;/<strong>div </strong>&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*iv3puCn6maIPkuCtqWRq1Q.png" /><figcaption>regular checkbox and radio buttons</figcaption></figure><p>Apply following CSS styles. I have added comments with each style, it should be self explanatory.</p><pre><em>/* Hide the checkbox/radio. We will simulate it later using label */<br></em><strong>input</strong>[<strong>type</strong>=<strong>checkbox</strong>], <strong>input</strong>[<strong>type</strong>=<strong>radio</strong>] {<br>    <strong>opacity</strong>: 0;<br>    <strong>position</strong>: <strong>absolute</strong>;<br>}<br><br><em>/* Some basic styling for alignment and more */<br></em><strong>input</strong>[<strong>type</strong>=<strong>checkbox</strong>], <strong>input</strong>[<strong>type</strong>=<strong>checkbox</strong>] + <strong>label</strong>, <strong>input</strong>[<strong>type</strong>=<strong>radio</strong>], <strong>input</strong>[<strong>type</strong>=<strong>radio</strong>] + <strong>label </strong>{<br>    <strong>display</strong>: <strong>inline-block</strong>;<br>    <strong>vertical-align</strong>: <strong>middle</strong>;<br>    <strong>cursor</strong>: <strong>pointer</strong>;<br>    <strong>user-select</strong>: <strong>none</strong>;<br>}<br><br><em>/* CSS Pseudo class &quot;before&quot; to show checkbox/radio box. Will be attached to every label adjacent to input checkbox.*/<br></em><strong>input</strong>[<strong>type</strong>=<strong>checkbox</strong>] + <strong>label</strong>:<strong>before</strong>, <strong>input</strong>[<strong>type</strong>=<strong>radio</strong>] + <strong>label</strong>:<strong>before </strong>{<br>    <strong>font-family</strong>: <strong>&#39;FontAwesome&#39;</strong>;<br>    <strong>background</strong>: <strong>#f1fff6</strong>;<br>    <strong>display</strong>: <strong>inline-block</strong>;<br>    <strong>vertical-align</strong>: <strong>middle</strong>;<br>    <strong>width</strong>: 20<strong>px</strong>;<br>    <strong>margin-right</strong>: 10<strong>px</strong>;<br>    <strong>text-align</strong>: <strong>center</strong>;<br>    <strong>font-size</strong>: 12<strong>px</strong>;<br>    <strong>padding</strong>: 4<strong>px </strong>0;<br>    <strong>color</strong>: <strong>#e4efe5</strong>;<br>    <strong>transition</strong>: <strong>color </strong>.4<strong>s</strong>;<br>    <strong>border</strong>: 1<strong>px solid #3faf2d</strong>;<br>}<br><br><em>/* Tick inside checkbox. I am using Font-awesome&#39;s tick, but you can use plain unicode tick */<br>/* or any other symbol you want. */<br></em><strong>input</strong>[<strong>type</strong>=<strong>checkbox</strong>] + <strong>label</strong>:<strong>before </strong>{<br>    <strong>content</strong>: <strong>&#39;\f00c&#39;</strong>;<br>    <strong>border-radius</strong>: 2<strong>px</strong>;<br>}<br><br><em>/* Circle inside radio circle. Border-radius to make it a circle. */<br></em><strong>input</strong>[<strong>type</strong>=<strong>radio</strong>] + <strong>label</strong>:<strong>before </strong>{<br>    <strong>content</strong>: <strong>&#39;\f111&#39;</strong>;<br>    <strong>border-radius</strong>: 50%;<br>}<br><br><em>/* Styles when checkbox/radio is checked */<br></em><strong>input</strong>:<strong>checked </strong>+ <strong>label</strong>:<strong>before </strong>{<br>    <strong>background</strong>: <strong>#288619</strong>;<br>    <strong>color</strong>: <strong>#FFF</strong>;<br>}<br><br><em>/* Styles when checkbox/radio is disabled  */<br></em><strong>input</strong>[<strong>type</strong>=<strong>checkbox</strong>][<strong>disabled</strong>] + <strong>label</strong>:<strong>before</strong>, <strong>input</strong>[<strong>type</strong>=<strong>radio</strong>][<strong>disabled</strong>] + <strong>label</strong>:<strong>before </strong>{<br>    <strong>color</strong>: <strong>#d0d0d0</strong>;<br>    <strong>background</strong>: <strong>#bfbfbf</strong>;<br>    <strong>border</strong>: 1<strong>px solid #656b64</strong>;<br>}</pre><p>Here is full example:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d698385fe9e4f78e0926af268f38be33/href">https://medium.com/media/d698385fe9e4f78e0926af268f38be33/href</a></iframe><p>It works with most modern browsers, including IE9+ (tested in IE11, but should work in IE9)</p><p>Credit goes to multiple posts on stackoverflow as well as many blog posts.</p><p>Steal this code at your own Peril!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d66de5a9e57a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My UI Development Workflow]]></title>
            <link>https://medium.com/@nitinj/my-ui-development-workflow-1fa406a87574?source=rss-f702d79f1988------2</link>
            <guid isPermaLink="false">https://medium.com/p/1fa406a87574</guid>
            <category><![CDATA[ux]]></category>
            <category><![CDATA[design-thinking]]></category>
            <category><![CDATA[ui]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[workflow]]></category>
            <dc:creator><![CDATA[Nitin Jadhav]]></dc:creator>
            <pubDate>Sat, 08 Apr 2017 06:07:13 GMT</pubDate>
            <atom:updated>2017-04-08T06:29:26.580Z</atom:updated>
            <content:encoded><![CDATA[<p>Over the years, I have developed many UIs. I have learned many approaches for the same — and here I have distilled down my “UI Development Workflow” that I have developed over years. No matter what the technology stack is, this process is applicable. It makes sure that we have required things (or at least contracts for those things) before we start coding.</p><p>This workflow is for UI development of one complete functionality (“Story” in agile terms). It makes sure that we avoid many pitfalls of UI development.</p><p><strong>Step 1: Requirements</strong></p><p>What&#39;s the Purpose of this functionality?</p><p>Do we have business prerequisite in place? Does this functionality makes sense right now?</p><p>Requirement — What are the exact requirement?</p><p><strong>Step 2: Study</strong></p><p>Dig out any available information on the topic if you are not well aware of it. internal wiki pages, related requirement documents, emails, PDFs — Read it.</p><p><strong>Step 3: Data</strong></p><p>Is the data required for building this UI available?</p><ul><li>If UI fetches server data, confirm that every single API Endpoint needed if available.</li><li>In case of metadata (e.g. JSON Schema, or other static data) is needed, make sure it is available and agreed upon.</li><li>If data not available, write formal email (or comment in Issue tracker, in slack group — you get the idea) to respective developers and ask for those endpoints.</li></ul><p><em>hint: I add subtasks to main JIRA story for API and assign to respective developers.</em></p><p><strong>Step 4: UX/Wireframe</strong></p><p>Do you have a dedicated UX/wireframe designer? Get complete (or at least a rough wireframe) UX design of the functionality from him/her in advance.</p><p>No UX/wireframe designer?</p><p>Re-examine the requirement and come up with a quick minimum UX/wireframe/Mock that solves the problem. No need to add bells and whistles, small details — this can be done in later stages.</p><p>Why no details? Your design may be thrown out of window, so unless people really like your quick-and-dirty UX/Wireframe, don&#39;t add details.</p><p>Put your design in the slack channel/Email/comment in issue tracker for the story — let people see it. You may get suggestions or even approval/rejection early on.</p><p><strong>Step 5: Proposal</strong></p><p>Write down comment in issue tracker (or email) — your perception of problem and how you are planning to implement solution (small details of how UI will work is desirable here). Add UX if not already done.</p><p>Why? Interested people will read it and point out any unnecessary/incorrect features, improvements. This will save lot of time.</p><p><strong>Step 6: Skeleton</strong></p><p>Add UI placeholders/stubs — pages, routes, tabs, dialogs, buttons, links. initial commit. Entire functionality should be navigable using above stubs. Popups should be accessible on button clicks. Pages should be with titles/headers, save buttons etc. Make sure that these placeholders are responsive.</p><p>Why? Creating skeleton of UI that you are going to implement gives you a overall frame — you can now focus on individual pages, tables, dialogues. In my experience, this greatly reduces complexity of complex, multi page functionality, freeing up you to focus on individual chunks.</p><p><strong>Step 7: Minimum viable UI Implementation</strong></p><p>This is where we add flesh. Code UI with actual data (or use hardcoded stubs in case data isn&#39;t available), logic routines, angular services/ redux reducers, basic error handling etc. No detailed visual styles/animations are necessary at this stage.</p><p><em>The idea is to produce a barebone working UI in minimum time.</em> Visually pleasing elements and good to have features like comment that is expandable and shows “…” can be done at later stages. This way, in case you don’t have sufficient time to complete UI, you atleast have a working one.</p><p><strong>Step 8: Feature complete</strong></p><p>Here we complete every feature that&#39;s needed, extensive error handling, corner cases, responsive nature of elements, confirmation dialogs etc.</p><p><strong>Step 9: Visual Glitter</strong></p><p>Add visual styles/eye candy, background images, icons in buttons, animations, transition effects.</p><p>In my experience, minimal visual styles are better.</p><p><strong>Step 10: Review</strong></p><p>Do a <em>self review</em> of what you have done. Focus should be on functionality and correctness.</p><p>Remove any extra code, comments etc. Self code review &amp; bug fixes.</p><p>Are there any corner cases that needs to be taken care of?</p><p><strong>Step 11: Notify Users</strong></p><p>Comment on issue tracker (or email, chat) that UI is now complete — arrange a meeting and invite stakeholders for review,</p><p>Mark Story as complete — Acknowledge any known issue/bugs and notes for QA people.</p><p>That’s it! This process may sound obvious, but it resulted in better UI development and totally worked for me. I hope it&#39;s useful to fellow UI developers!</p><p>If you liked this story, give it a 💚!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1fa406a87574" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>