<?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: You Already Know </title>
    <description>The latest articles on DEV Community by You Already Know  (@sauelalmonte).</description>
    <link>https://dev.to/sauelalmonte</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%2F563678%2F12f3ef3d-d6aa-4e89-a89c-bd20f675a59c.jpeg</url>
      <title>DEV Community: You Already Know </title>
      <link>https://dev.to/sauelalmonte</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sauelalmonte"/>
    <language>en</language>
    <item>
      <title>CSS Media Queries</title>
      <dc:creator>You Already Know </dc:creator>
      <pubDate>Fri, 19 Jan 2024 01:15:30 +0000</pubDate>
      <link>https://dev.to/sauelalmonte/css-media-queries-1a5b</link>
      <guid>https://dev.to/sauelalmonte/css-media-queries-1a5b</guid>
      <description>&lt;p&gt;&lt;strong&gt;Introduction:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Media queries offer a powerful means to adapt our styles based on factors such as the device type, viewport size, screen pixel density, or device orientation.&lt;br&gt;
For those already familiar with media queries, this post serves as a quick guide, unveiling some clever tricks that might not be widely known.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fundamental Media Queries:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Media queries are constructed using the &lt;a class="mentioned-user" href="https://dev.to/media"&gt;@media&lt;/a&gt; at rule, incorporating a media type, zero or more media features, or a combination of both a media type and media feature(s). The permissible media types include all, print, screen, and speech. If not explicitly mentioned, the type "all" is assumed.&lt;/p&gt;

&lt;p&gt;It is possible to employ multiple media types simultaneously, with each type separated by commas:&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdxug09av4f1v5wciup2k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdxug09av4f1v5wciup2k.png" alt="Image description" width="800" height="119"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the following simple example, the default background color is red, but screen devices with a viewport width that's 650px or less will have a background color of blue instead:&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Faq3sdw1kz9eptka5ispy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Faq3sdw1kz9eptka5ispy.png" alt="Image description" width="800" height="191"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Example of simple media queries that specify either a media type, a media feature or both:&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1rtzeut0o6q7zka5jibp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1rtzeut0o6q7zka5jibp.png" alt="Image description" width="800" height="223"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Utilizing Multiple Media Features:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To meet specific requirements in a media query, you can designate multiple media features by employing the logical operator "and" between them. When utilizing "and," the query will only be a match if all the features evaluate to true:&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkshfhp7sedecec3lm09d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkshfhp7sedecec3lm09d.png" alt="Image description" width="800" height="271"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Using the "or" Logical Operator:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;By defining multiple queries separated by commas, you introduce logical "or" operators. The media query then transforms into a list of queries, applying if any of the comma-separated queries matches the conditions.&lt;br&gt;
In the example below, the media query holds true if the device's viewport has a minimum width of 2rem or a maximum aspect ratio of 4/1:&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp7hw3g7498foiqy0nlbq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp7hw3g7498foiqy0nlbq.png" alt="Image description" width="800" height="99"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Employing the "not" Logical Operator:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;By placing "not" at the beginning of a query, you can achieve the opposite effect. This is particularly useful for applying styles when the browser or device fails to meet specific conditions. An example scenario is when the primary pointing device lacks the ability to hover over elements.&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnwn13vp38g7dqlq93y7l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnwn13vp38g7dqlq93y7l.png" alt="Image description" width="800" height="103"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;When employing "not," it's essential to specify the media type. Additionally, it's crucial to note that "not" applies to each individual query and not to an entire list of queries separated by commas. Each query within the list is subject to the "not" condition independently.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Exclusive Use of the "only" Logical Operator:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The "only" logical operator holds a unique characteristic—it conceals the entire query for older browsers. In simpler terms, older browsers that do not comprehend the "only" keyword will ignore the entire media query. Otherwise, the "only" keyword itself has no impact on the query's behavior.&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9tmfj4a7yd5j8hl9ohaq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9tmfj4a7yd5j8hl9ohaq.png" alt="Image description" width="800" height="109"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>css</category>
      <category>beginners</category>
      <category>frontend</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Why I use Tailwind CSS instead of Bootstrap</title>
      <dc:creator>You Already Know </dc:creator>
      <pubDate>Fri, 05 Mar 2021 18:43:27 +0000</pubDate>
      <link>https://dev.to/sauelalmonte/why-i-use-tailwind-css-instead-of-bootstrap-279j</link>
      <guid>https://dev.to/sauelalmonte/why-i-use-tailwind-css-instead-of-bootstrap-279j</guid>
      <description>&lt;p&gt;If you are creating a new website or with a small web development team in a short amount of time, most developers lean towards Bootstrap to help with the design. The reason for this, is ease of use, tons of documentation and plenty of "predefined css components" which is why Bootstrap is popular.&lt;/p&gt;

&lt;p&gt;But!, when project's get bigger and more traffik comes to the site(s), concerns of page overload and performance arise. While using Bootstrap it is very unlikely one will use all of it's available framework classes, which equals to considerable amount of css overload as well as unused components.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tailwind to the rescue!!!&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;Tailwind is a CSS utility framework, some call it a "utility bundle" for rapid UI development, (my go to for quick development). Why? Tailwind doesn't provide a default theme or any predefined UI components, it is unlikely to get two different web pages, designed by 2 different developers and the web pages would look the same or similar, allowing the developer to have an identity/signature.&lt;/p&gt;

&lt;p&gt;With Tailwind CSS, there is no limit to the imagination, designing is structured in a way so developer's are able to create their own ruleset to avoid css overload or repeated properties.&lt;/p&gt;

&lt;p&gt;All utility classes can be reviewed in the &lt;a href="https://tailwindcss.com/docs" rel="noopener noreferrer"&gt;Tailwind CSS documentation&lt;/a&gt; as well as the tailwind.config.js file, which will be located in the root of a project after &lt;a href="https://tailwindcss.com/docs/installation#post-css-7-compatibility-build" rel="noopener noreferrer"&gt;installation&lt;/a&gt;. Every available class can be configured for small and larger project's.&lt;/p&gt;

&lt;p&gt;Example of styling a button using tailwind and Bootstrap: &lt;br&gt;
&lt;em&gt;I am using VSCode as my Text Editor&lt;/em&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%2Fslbeqq24vuykyt0vgsqx.jpg" 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%2Fslbeqq24vuykyt0vgsqx.jpg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Output:&lt;br&gt;
&lt;em&gt;Tailwind CSS vs Bootstrap&lt;/em&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%2Ff5ph0m6usk8ua5j47vp5.jpg" 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%2Ff5ph0m6usk8ua5j47vp5.jpg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Bootstrap predefined button design is achieved. To achieve a custom look when using Bootstrap we need to write custom css. Using Tailwind CSS utility classes, it is possible to achieve any look and feel of the button without writing any css.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;WHY!?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You will have the ability to create personal UI design, identity and branding without writing a bunch of custom CSS (you don't have to be CSS expert)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The ease of creating Responsive websites/web apps&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Tailwind utility class behave in a responsive behaviour. This allows for effortless creation of responsive components without writing additional CSS. Tailwind provides a simple method of putting already existing utility classes into a responsive context. Using the prefix {screen size}:{class}. Look at the above example, if you want to change its color, size etc. depending on the screen size (desktop monitor, laptop or mobile smart device) we have to add the following:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Look at line 23&lt;/em&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%2F2eqp4165hedqa0k3kw6e.jpg" 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%2F2eqp4165hedqa0k3kw6e.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Output:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Site being viewed on a laptop&lt;/em&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%2Fojsj6z8rdu8bli04wsux.jpg" 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%2Fojsj6z8rdu8bli04wsux.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Site being viewed via smart device&lt;/em&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%2F1llcq4i0q6vnp32xat1u.jpg" 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%2F1llcq4i0q6vnp32xat1u.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Tailwind responsiveness implies that the page is going to be created for mobile screens first. Adding bg-red-500 tells the background of the element changes to red if the size of the screen is small. If the size of the screen is medium-xl than the size has to be applied"md:class lg:class axl:class " represents the color of the background change to yellow (bg-yellow-500).&lt;/p&gt;

&lt;p&gt;These are the predefined screen size options in Tailwind:&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%2F98lfb7tk4780t3f9wxwn.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%2F98lfb7tk4780t3f9wxwn.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The possibilities are endless!&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;You can configure/customize Tailwind Utilities&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The biggest strengths of Tailwind is its configurability. In every Tailwind project is the tailwind.config.js file located in the root of the project (must be in the root of project/directory). It contains all the configurable utility classes and colors. This file doesn't exist unless the user generates it. If there is no config file the utility classes are the same as mentioned in the official documentation. To learn more go to &lt;a href="https://tailwindcss.com/docs" rel="noopener noreferrer"&gt;Tailwind documentation&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Tailwind is simple, professionally made, well documented and worth your time. It made my workflow better, faster and helped me understand CSS (also known as Vanilla CSS), made made projects uniform and reduced the amount of CSS I wrote over the course learning it. None of my projects look the same, the creator of Tailwind &lt;a href="https://adamwathan.me/" rel="noopener noreferrer"&gt;(Adam Wathan)&lt;/a&gt; is an experienced guy in the industry and is continuously improving Tailwind. &lt;a href="https://adamwathan.me/" rel="noopener noreferrer"&gt;(Adam Wathan)&lt;/a&gt; also wrote a book &lt;a href="https://refactoringui.com/book/" rel="noopener noreferrer"&gt;Refactoring UI&lt;/a&gt; that I recommend you read!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;In short, Tailwind is the love of my life...&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>tailwindcss</category>
      <category>css</category>
      <category>bootstrap</category>
    </item>
  </channel>
</rss>
