<?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: Charlène</title>
    <description>The latest articles on DEV Community by Charlène (@chachaz).</description>
    <link>https://dev.to/chachaz</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%2F2521581%2F68bfbfbb-8e3a-46a5-afa5-3acd90849696.jpeg</url>
      <title>DEV Community: Charlène</title>
      <link>https://dev.to/chachaz</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/chachaz"/>
    <language>en</language>
    <item>
      <title>Why are "quotes" important in tailwind.css</title>
      <dc:creator>Charlène</dc:creator>
      <pubDate>Thu, 05 Dec 2024 14:47:20 +0000</pubDate>
      <link>https://dev.to/chachaz/why-are-quotes-important-in-tailwindcss-2ml8</link>
      <guid>https://dev.to/chachaz/why-are-quotes-important-in-tailwindcss-2ml8</guid>
      <description>&lt;h1&gt;
  
  
  Today, I discovered something silly about quotes in &lt;strong&gt;tailwind.css&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;While working on our Adonis6.js project, we installed &lt;strong&gt;tailwind.css&lt;/strong&gt; to work faster on our page's style.&lt;/p&gt;

&lt;p&gt;But, while doing the indentation, we accidently took off the &lt;strong&gt;"quotes"&lt;/strong&gt; on this line :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;text-xl&lt;/span&gt; &lt;span class="na"&gt;max-w-2xl&lt;/span&gt; &lt;span class="na"&gt;mx-auto&lt;/span&gt; &lt;span class="na"&gt;mt-6&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;em&gt;We didn't immediatly notice&lt;/em&gt; !&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We took 20 mins searching why only the &lt;code&gt;text-xl&lt;/code&gt; was working, until we noticed unlike our other lines, the &lt;strong&gt;"quotes" were missing&lt;/strong&gt;. Then we wondered why the first attribute was still working.&lt;/p&gt;

&lt;h2&gt;
  
  
  But why are quotes mendatory in tailwind.css ?
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Well, in our example :
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;text-xl&lt;/span&gt; &lt;span class="na"&gt;max-w-2xl&lt;/span&gt; &lt;span class="na"&gt;mx-auto&lt;/span&gt; &lt;span class="na"&gt;mt-6&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The browser reads &lt;code&gt;class=text-xl&lt;/code&gt; as &lt;strong&gt;valid&lt;/strong&gt;, but then treats &lt;code&gt;max-w-2xl&lt;/code&gt;, &lt;code&gt;mx-auto&lt;/code&gt;, and &lt;code&gt;mt-6&lt;/code&gt; as &lt;strong&gt;separate invalid attributes&lt;/strong&gt;, which won't work as intended.&lt;/p&gt;

&lt;h3&gt;
  
  
  When you use quotes :
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"text-xl max-w-2xl mx-auto mt-6"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The entire value is grouped together properly as the value of the &lt;code&gt;class&lt;/code&gt; attribute.&lt;/p&gt;

&lt;h2&gt;
  
  
  So, that's why quotes in tailwind.css are important !
&lt;/h2&gt;

</description>
    </item>
    <item>
      <title>What is AdonisJS 6 context ? (ctx)</title>
      <dc:creator>Charlène</dc:creator>
      <pubDate>Wed, 04 Dec 2024 16:22:36 +0000</pubDate>
      <link>https://dev.to/chachaz/today-i-learned-041224-3bdm</link>
      <guid>https://dev.to/chachaz/today-i-learned-041224-3bdm</guid>
      <description>&lt;p&gt;&lt;strong&gt;This is a MD training&lt;/strong&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Today I learned the use of 'ctx' in an AdonisJS project.
&lt;/h1&gt;

&lt;p&gt;&lt;em&gt;While following a lesson on AdonisJS6, when making the routes we had to use the 'ctx' object.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  But what is 'ctx' then ?
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Well, it was use in that context :
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nx"&gt;route&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/movies&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;My awesome Movie!&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;'ctx' stands for context, it's an object provided by the framework AdonisJS, it contains information about the incoming HTTP request and outgoing HTTP response. So, everything I need to handle the request and craft a response !&lt;/p&gt;

&lt;h2&gt;
  
  
  Why is ctx important ?
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;It makes working with requests and responses easier by putting all the important information in one place.&lt;/em&gt; Depending on the framework, the structure of ctx may vary, but it still will have the same job : &lt;strong&gt;to represent the context of the current HTTP request and response cycle.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;So yes, this is what I learned today ! :)&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
