<?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: Arthur Borba</title>
    <description>The latest articles on DEV Community by Arthur Borba (@artsborba).</description>
    <link>https://dev.to/artsborba</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F888111%2F3675ceb6-d9b4-4c5a-ace9-ae3324871f79.jpeg</url>
      <title>DEV Community: Arthur Borba</title>
      <link>https://dev.to/artsborba</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/artsborba"/>
    <language>en</language>
    <item>
      <title>Let’s make the web responsive with just one installation line? I’m looking for contributors!</title>
      <dc:creator>Arthur Borba</dc:creator>
      <pubDate>Mon, 04 Nov 2024 16:51:59 +0000</pubDate>
      <link>https://dev.to/artsborba/lets-make-the-web-responsive-with-just-one-installation-line-im-looking-for-contributors-c35</link>
      <guid>https://dev.to/artsborba/lets-make-the-web-responsive-with-just-one-installation-line-im-looking-for-contributors-c35</guid>
      <description>&lt;p&gt;Recently I published a NPM package with the mission described in the title: to make projects responsive with just one line of code!&lt;/p&gt;

&lt;p&gt;I share with you the &lt;a href="https://www.npmjs.com/package/responsive-app" rel="noopener noreferrer"&gt;responsive-app [beta]&lt;/a&gt; package&lt;/p&gt;

&lt;p&gt;It took me a few years experimenting and developing this technique, which currently consists on:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Setting the HTML tag font-size dynamically (through a JS script), taking in consideration: (1) the screen resolution and (2) the browser font-size (for web acessibility)&lt;/li&gt;
&lt;li&gt;Pre-process pixel definitions into rem&lt;/li&gt;
&lt;li&gt;Centralize elements in mobile screens (experimental feature)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The result is all element proportions and relative sizes as the same across all screen resolutions:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2F3g9r3gs92yu524s3ah46.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F3g9r3gs92yu524s3ah46.gif" alt="Image description" width="800" height="236"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With just one line installation, for example using Rollup:&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="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;responsive&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;rollup-plugin-responsive-app&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="err"&gt;…&lt;/span&gt;
   &lt;span class="na"&gt;plugins&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
   &lt;span class="err"&gt;…&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
   &lt;span class="c1"&gt;// Last plugin on the list&lt;/span&gt;
   &lt;span class="nf"&gt;responsive&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;Or placing the browser bundled version into the page:&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;head&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"https://cdn.jsdelivr.net/npm/responsive-app@1.0.7-beta.0/dist/browser-bundle.min.js"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The main goal here is saving time when creating a new project by not having to deal with the responsiveness at all, just trusting that the interface will look good on all screen resolutions. Sounds great, right?&lt;/p&gt;

&lt;p&gt;So, after launching this beta version, I’m looking for support and contributors. Initially, the idea is to test this package in different contexts, projects, and frameworks (React, Angular, Vue…) to make the process as comprehensive as possible.&lt;/p&gt;

&lt;p&gt;Who’s up for this challenge? Test steps are:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Install or add the script tag into your fresh or existing app
1.1 If you have existing responsive rules, bypass them&lt;/li&gt;
&lt;li&gt;Check your interface across multiple resolutions&lt;/li&gt;
&lt;li&gt;Let me know how it worked for you :)&lt;/li&gt;
&lt;/ol&gt;

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