<?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: Rizki Citra</title>
    <description>The latest articles on DEV Community by Rizki Citra (@rimzzlabs).</description>
    <link>https://dev.to/rimzzlabs</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%2F589673%2Fb4acb181-6a91-406a-abe0-0b333f1d2d6b.jpg</url>
      <title>DEV Community: Rizki Citra</title>
      <link>https://dev.to/rimzzlabs</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rimzzlabs"/>
    <language>en</language>
    <item>
      <title>I Built a Free CV Builder With No Login, and Your Resume Never Leaves Your Browser</title>
      <dc:creator>Rizki Citra</dc:creator>
      <pubDate>Mon, 02 Nov 2026 15:07:57 +0000</pubDate>
      <link>https://dev.to/rimzzlabs/i-built-a-free-cv-builder-with-no-login-and-your-resume-never-leaves-your-browser-11i1</link>
      <guid>https://dev.to/rimzzlabs/i-built-a-free-cv-builder-with-no-login-and-your-resume-never-leaves-your-browser-11i1</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;You know the moment. You spend an hour on some resume builder, fixing your bullet points, picking a nice template. Then you click &lt;strong&gt;Download&lt;/strong&gt;, and it says: "Upgrade to Pro to export your PDF."&lt;/p&gt;

&lt;p&gt;Or it lets you download, but the PDF has their logo on the bottom. Or it wants your email first.&lt;/p&gt;

&lt;p&gt;I got tired of that. So I built the one I wanted, and I called it &lt;strong&gt;Lanjut&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;When I first wrote about it in July, it had six templates. On October 29 it hit &lt;strong&gt;1.0&lt;/strong&gt;, with a desktop app for Mac, Windows, and Linux. Today it's on &lt;strong&gt;1.6&lt;/strong&gt;, with twenty templates. And the three rules from day one are still the same:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;In short:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;No login.&lt;/strong&gt; No sign-up, no email, no password. Open it and write.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Free, and open source.&lt;/strong&gt; No paid plan, no trial, no watermark. The code is on GitHub under AGPL-3.0.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Your resume stays on your device.&lt;/strong&gt; It's saved in your browser. There's no server that stores it.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Try it at &lt;a href="https://lanjut.org" rel="noopener noreferrer"&gt;lanjut.org&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9g1sdf7kaht38v8l990g.png" 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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9g1sdf7kaht38v8l990g.png" alt="The Lanjut home page" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;By the way, Lanjut means "continue" in Indonesian. Which is also what "resume" means. I'm still a little proud of that one 😅&lt;/p&gt;

&lt;h2&gt;
  
  
  Rule 1: No Login
&lt;/h2&gt;

&lt;p&gt;Q: Do I need an account?&lt;br&gt;
A: No. Go to &lt;a href="https://lanjut.org/editor" rel="noopener noreferrer"&gt;lanjut.org/editor&lt;/a&gt; and start typing.&lt;/p&gt;

&lt;p&gt;Think about who needs a resume builder the most. Someone who's looking for a job. A fresh graduate, or someone who just got laid off last week. They don't need one more account, one more "verify your email", one more newsletter.&lt;/p&gt;

&lt;p&gt;So Lanjut has no accounts at all. Not "optional sign-up". None.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F6ebijrwa9xgjk6xxo9a0.png" 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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F6ebijrwa9xgjk6xxo9a0.png" alt="The editor: the form on the right, the live page in the middle" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Rule 2: Free, and Open Source
&lt;/h2&gt;

&lt;p&gt;No paid plan. No trial that ends after seven days. No watermark on your PDF. Download as many times as you want, in PDF, Word (.docx), or plain text.&lt;/p&gt;

&lt;p&gt;How can it be free? Because it costs me almost nothing to run. There's no database and no user accounts to keep. Cloudflare serves the site, and your browser does the rest. When the server bill is close to zero, a paywall would just be greed.&lt;/p&gt;

&lt;p&gt;And it's open source under &lt;a href="https://github.com/rimzzlabs/lanjut" rel="noopener noreferrer"&gt;AGPL-3.0&lt;/a&gt;. So you don't have to trust anything I write in this post. You can read the code.&lt;/p&gt;

&lt;h2&gt;
  
  
  Rule 3: Your Resume Stays on Your Device
&lt;/h2&gt;

&lt;p&gt;This is the one I care about the most.&lt;/p&gt;

&lt;p&gt;A resume has your phone number (some country requires it), your email, your city, and your whole work history. Most resume builders keep all of that in their database. Lanjut is &lt;strong&gt;local-first&lt;/strong&gt;: everything you write is saved in your browser's own storage (&lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API" rel="noopener noreferrer"&gt;IndexedDB&lt;/a&gt;), on your machine.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvfp6qtla42s5d6vvd9wu.png" 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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvfp6qtla42s5d6vvd9wu.png" alt="No account, no upload, your own backup" width="800" height="381"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Since you're reading this on dev.to, here's a fun test. Open DevTools, go to the &lt;strong&gt;Network&lt;/strong&gt; tab, and type in the editor for a minute. Your resume doesn't go anywhere. There's nothing to send it to.&lt;/p&gt;

&lt;p&gt;There's also a &lt;a href="https://lanjut.org/privacy" rel="noopener noreferrer"&gt;privacy page&lt;/a&gt; that lists every single time the site talks to a server, like loading the page or checking for a desktop update. It's a short list.&lt;/p&gt;

&lt;p&gt;Q: So what happens if I switch laptops?&lt;br&gt;
A: You download a backup. One small file holds a profile and all its resumes, and you open it on the other machine. That file goes wherever you send it. Not to me.&lt;/p&gt;

&lt;h2&gt;
  
  
  Does It Actually Pass the ATS?
&lt;/h2&gt;

&lt;p&gt;Quick context: an ATS (Applicant Tracking System) is the software many companies use to read your resume before a human does. It copies the text out of your PDF and sorts it into fields. If your layout confuses it, your job titles end up mixed with your hobbies, and nobody ever tells you.&lt;/p&gt;

&lt;p&gt;I'll be honest: no tool can promise you get through. Every company sets up its ATS differently. What Lanjut can do is make sure the file is right: real text, standard headings, and one reading order from top to bottom. That's why it has no tables and no two-column layouts. You still choose the fonts, spacing, colors, and section order.&lt;/p&gt;

&lt;p&gt;And instead of asking you to believe that, the home page shows it:&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fxzx9xg79sj2pich0zopm.png" 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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fxzx9xg79sj2pich0zopm.png" alt="What the recruiter sees, next to the text an ATS reads from the same PDF" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;On the left is the page a recruiter sees. On the right is the text pulled out of a real PDF, generated right there in your browser. Drag the handle to compare. If the right side reads in a clean order, so will most parsers.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's in 1.6
&lt;/h2&gt;

&lt;p&gt;The 1.6 release was a big one:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Fourteen new templates&lt;/strong&gt;, so twenty in total. Every one keeps the same reading order. Only the look changes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Colors&lt;/strong&gt; for your name, headings, lines, and links. Lanjut refuses a color that's too light to read on white.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Contact labels&lt;/strong&gt;, so you can show "LinkedIn" instead of a long URL. It also warns you, because some ATS only read the visible text.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A download page&lt;/strong&gt; that picks the right installer for your computer.&lt;/li&gt;
&lt;/ul&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4scovppzkjpt01uvmdhy.png" 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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4scovppzkjpt01uvmdhy.png" alt="Some of the twenty templates" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And a few things that were already there, but people keep asking me about:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Profiles.&lt;/strong&gt; Keep one profile per kind of job, like one for frontend roles and one for product roles. Each has its own resumes and contact details.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Import your old CV.&lt;/strong&gt; Drop in a PDF, and Lanjut sorts it into sections.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Works offline.&lt;/strong&gt; Open it once, and it keeps working without a connection. The desktop app works offline too.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;English and Indonesian&lt;/strong&gt;, for the app and for the resume itself.&lt;/li&gt;
&lt;/ul&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F63vnooj4b1u6g7inl1p2.png" 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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F63vnooj4b1u6g7inl1p2.png" alt="Profiles: one per kind of job" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  For Developers
&lt;/h2&gt;

&lt;p&gt;Okay, this is my favorite part. Open &lt;strong&gt;Preferences&lt;/strong&gt; and turn on &lt;strong&gt;Developer mode&lt;/strong&gt;. Now the editor has a Form/Code switch, and you can write your whole resume as Markdown, YAML, or JSON. The page updates as you type.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fq736zuhj5fvt70z2e7p4.png" 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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fq736zuhj5fvt70z2e7p4.png" alt="Writing a resume in Markdown, with the live page next to it" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I mean, we write README files all day. Why not a resume?&lt;/p&gt;

&lt;p&gt;The stack, if you're curious: &lt;a href="https://astro.build" rel="noopener noreferrer"&gt;Astro&lt;/a&gt; with React islands for the site, &lt;a href="https://zustand.docs.pmnd.rs" rel="noopener noreferrer"&gt;zustand&lt;/a&gt; for state, synced to IndexedDB. The PDF export runs in a Web Worker through WebAssembly, so even a big export never freezes the page. The desktop app is &lt;a href="https://tauri.app" rel="noopener noreferrer"&gt;Tauri&lt;/a&gt;, loading the same static build from disk. I wrote about the architecture in more detail on &lt;a href="https://rimzzlabs.com/notes/introducing-lanjut/" rel="noopener noreferrer"&gt;my site&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Closing
&lt;/h2&gt;

&lt;p&gt;Lanjut is v1 now. For me, that means the promise is locked: &lt;strong&gt;no login, free, open source, and your resume stays on your device&lt;/strong&gt;. New features will keep coming, but those four won't change. If a feature ever needs an account or a server copy of your resume, it won't ship.&lt;/p&gt;

&lt;p&gt;So if you're job hunting, or you know someone who is, give it a try:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use it in the browser at &lt;a href="https://lanjut.org" rel="noopener noreferrer"&gt;lanjut.org&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Get the &lt;a href="https://lanjut.org/download" rel="noopener noreferrer"&gt;desktop app&lt;/a&gt; for Mac, Windows, or Linux&lt;/li&gt;
&lt;li&gt;Read the code, open an issue, or leave a star on &lt;a href="https://github.com/rimzzlabs/lanjut" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And that's it, folks. Thank you for reading until the end, I hope this post is useful for you.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>opensource</category>
      <category>privacy</category>
      <category>career</category>
    </item>
    <item>
      <title>A Powerful CSS Pseudo Class, Let's Take a Look at CSS :has()</title>
      <dc:creator>Rizki Citra</dc:creator>
      <pubDate>Sun, 18 Dec 2022 17:23:29 +0000</pubDate>
      <link>https://dev.to/rimzzlabs/a-powerful-css-pseudo-class-lets-take-a-look-at-css-has-alh</link>
      <guid>https://dev.to/rimzzlabs/a-powerful-css-pseudo-class-lets-take-a-look-at-css-has-alh</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Well, since CSS got upgraded to version 3 in 1998, A lot of things happened, and until now, CSS has already got many features that we can use to enhance our website to be more beautiful and interactive.&lt;/p&gt;

&lt;p&gt;Web Developer will never leave their CSS behind because it's one of the cores of the technology behind the web, current CSS version let us use our creativity by crafting modern and accessible web applications.&lt;/p&gt;

&lt;p&gt;But more features mean we need more time to think about how it works &lt;em&gt;(again)&lt;/em&gt;, although most modern web apps use CSS framework for managing their stylesheet, enhancing our fundamentals about the core of the CSS framework itself is necessary.&lt;/p&gt;

&lt;p&gt;CSS has never been easy, not a few people understand how CSS works &lt;em&gt;(including me)&lt;/em&gt;, but there is a person out there ready to help you fall in love with CSS, &lt;a href="https://www.youtube.com/kevinpowell" rel="noopener noreferrer"&gt;check out his YouTube channel&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;One of the problems is that CSS is not a programming language, so it's very hard to debug when something goes wrong, and you might think &lt;em&gt;" CSS is quite easy, we change something, the UI reflected, what's the hard part?"&lt;/em&gt;. That's what I thought when I was using &lt;a href="https://getboostrap.com" rel="noopener noreferrer"&gt;Bootstrap&lt;/a&gt;, but the hard part is when you do all the stuff and some elements didn't quite fit with your expectation, like setting how to set &lt;em&gt;this style&lt;/em&gt; to a specific element that contains &lt;em&gt;this&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Well if you back to 1998 to do all those stuff, it's going to be challenging, but don't worry we now have the feature to do all those stuff.&lt;/p&gt;

&lt;p&gt;It's a &lt;strong&gt;CSS pseudo-class&lt;/strong&gt; that will handle all of those for you. Just imagine you want to target an element that contains something and also the element shouldn't contain something again, it's like a condition in a programming language.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;somethingOk&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nx"&gt;somethingOkToo&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// do the stuff&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Pretty cool right? now before we talk about this feature, let's talk a little bit about what &lt;strong&gt;CSS pseudo-class&lt;/strong&gt; is.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is CSS pseudo-class?
&lt;/h3&gt;

&lt;p&gt;In CSS, A pseudo-class is a keyword added to a selector that specifies a special state of the selected element(s). For example, the pseudo-class &lt;code&gt;:hover&lt;/code&gt; can be used to select a button when a user's pointer hovers over the button and this selected button can then be styled.&lt;/p&gt;

&lt;p&gt;I'm not going to talk much about what pseudo-class is, but here's a simple explanation of it, we will have a button with a black background color, and the text color will be white, I'm also going to add some padding.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.button&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0.75rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;black&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;white&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;Result:&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%2Fik.imagekit.io%2Fmlnzyx%2Fcss-has%2Fcss-has-btn" 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%2Fik.imagekit.io%2Fmlnzyx%2Fcss-has%2Fcss-has-btn" alt="result-1" width="313" height="199"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We have a nice button there, now let's add interaction, such as color change when the user hovers over the element with &lt;code&gt;:hover&lt;/code&gt; pseudo-class.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.button&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0.75rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;black&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;white&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.button&lt;/span&gt;&lt;span class="nd"&gt;:hover&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;red&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;Now the button would look like this:&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%2Fik.imagekit.io%2Fmlnzyx%2Fcss-has%2Fcss-has-btn-hover" 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%2Fik.imagekit.io%2Fmlnzyx%2Fcss-has%2Fcss-has-btn-hover" alt="button with hover" width="313" height="199"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After I added the &lt;code&gt;:hover&lt;/code&gt; pseudo-class, the button will change it's color if I hover over the element, that's my simple explanation about the pseudo-class.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is CSS :has() pseudo-class?
&lt;/h2&gt;

&lt;p&gt;The functional &lt;code&gt;:has()&lt;/code&gt; CSS pseudo-class represents an element if any of the relative selectors that are passed as an argument match at least one element when anchored against this element. This pseudo-class presents a way of selecting a parent element or a previous sibling element concerning a reference element by taking a forgiving relative selector list as an argument.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Q:&lt;/strong&gt; Why it's called a functional?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A:&lt;/strong&gt; Because this type of pseudo-class accepts parameters rather than just calling it like &lt;code&gt;:hover&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;CSS &lt;code&gt;:has()&lt;/code&gt; pseudo-class will accept &lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/Selector_list#forgiving_selector_list" rel="noopener noreferrer"&gt;forgiving relative element&lt;/a&gt; and will apply a style if the parameters are valid as &lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/Specificity" rel="noopener noreferrer"&gt;specificity&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;CSS &lt;code&gt;:has()&lt;/code&gt; pseudo-class often described as &lt;em&gt;"Parent Selector"&lt;/em&gt; because a lot of people use it to target the parent element but then they actually want to select a specific element that matches with the condition.&lt;/p&gt;

&lt;p&gt;As such, you might want to chill and understand how &lt;code&gt;:has()&lt;/code&gt; works, this might break your mental model about the CSS itseld, now to simplify how &lt;code&gt;:has()&lt;/code&gt; works, take a look at this CSS snippet:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="c"&gt;/* Matches &amp;lt;a&amp;gt; elements that contain an &amp;lt;span&amp;gt; child with a class colored */&lt;/span&gt;
&lt;span class="nt"&gt;a&lt;/span&gt;&lt;span class="nd"&gt;:has&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;span&lt;/span&gt;&lt;span class="nc"&gt;.colored&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c"&gt;/*...*/&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c"&gt;/* Matches &amp;lt;a&amp;gt; elements that directly contain an &amp;lt;img&amp;gt; child */&lt;/span&gt;
&lt;span class="nt"&gt;a&lt;/span&gt;&lt;span class="nd"&gt;:has&lt;/span&gt;&lt;span class="o"&gt;(&amp;gt;&lt;/span&gt; &lt;span class="nt"&gt;img&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c"&gt;/*...*/&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c"&gt;/* Matches &amp;lt;section&amp;gt; elements that DON'T contain any heading elements: */&lt;/span&gt;
&lt;span class="nt"&gt;section&lt;/span&gt;&lt;span class="nd"&gt;:not&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nd"&gt;:has&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;h1&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;h2&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;h3&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;h4&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;h5&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;h6&lt;/span&gt;&lt;span class="o"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c"&gt;/*...*/&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  CSS :has() examples
&lt;/h3&gt;

&lt;p&gt;Let's take a look at these example of how the CSS pseudo-class &lt;code&gt;:has()&lt;/code&gt; works&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;main&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;section&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;Punctuation&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;A simple punctuation will never arrive at a dragon's house tonight.&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/section&amp;gt;&lt;/span&gt;

  &lt;span class="nt"&gt;&amp;lt;section&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h1&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"vergil"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Punctuation&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;Hi Andrew can I borrow your pen?&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;Lorem ipsum dolor sit amet constectum adpisicing elit.&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/section&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/main&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;section&lt;/span&gt;&lt;span class="nd"&gt;:has&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;h1&lt;/span&gt;&lt;span class="nf"&gt;#vergil&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;blue&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;The result is going to look like this:&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%2Fik.imagekit.io%2Fmlnzyx%2Fcss-has%2Fcss-has-example" 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%2Fik.imagekit.io%2Fmlnzyx%2Fcss-has%2Fcss-has-example" alt="css has example" width="600" height="290"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So what is happening? as you can see, I'm targetting &lt;strong&gt;the section element&lt;/strong&gt; that has an &lt;code&gt;h1&lt;/code&gt; element with an &lt;strong&gt;id&lt;/strong&gt; of &lt;strong&gt;vergil&lt;/strong&gt;, and then &lt;strong&gt;the whole section&lt;/strong&gt; will have a text color of blue.&lt;/p&gt;

&lt;p&gt;It's kinda confusing if you read this pseudo-class for the first time, but you should feel comfortable later.&lt;/p&gt;

&lt;p&gt;Another example is when your website has a lot of images and some of the images will have a &lt;code&gt;figcaption&lt;/code&gt; in them. This way you can use a different style to the image that has a &lt;code&gt;figcaption&lt;/code&gt; by using CSS &lt;code&gt;:has()&lt;/code&gt; pseudo-class.&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;"container"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;figure&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"/mr-crab-dank.jpg"&lt;/span&gt; &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;"Mr. Crab"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/figure&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;figure&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"/your-ms-puff.jpg"&lt;/span&gt; &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;"Ms. Puff"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;figcaption&amp;gt;&lt;/span&gt;Ms. Puff waving at you&lt;span class="nt"&gt;&amp;lt;/figcaption&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/figure&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Also with a little bit of &lt;em&gt;base styling&lt;/em&gt; with this CSS&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;margin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.container&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;padding-top&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0.875rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;91%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;margin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="nb"&gt;auto&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;max-width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;524px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;flex&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;flex-direction&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;column&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;gap&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0.765rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.container&lt;/span&gt; &lt;span class="nt"&gt;figure&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;100%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nt"&gt;figure&lt;/span&gt; &lt;span class="nt"&gt;img&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;block&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;50%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;margin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="nb"&gt;auto&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;The result will look like this&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%2Fik.imagekit.io%2Fmlnzyx%2Ftr%3Aw-768%2Ch-582%2Fcss-has%2Fmr-crab-ms-puff" 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%2Fik.imagekit.io%2Fmlnzyx%2Ftr%3Aw-768%2Ch-582%2Fcss-has%2Fmr-crab-ms-puff" alt="mr crab &amp;amp; ms puff" width="768" height="582"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now we have 2 images that contain Mr. Crab and Ms. Puff, but you as can see between the images, only Ms. Puff who have a&lt;br&gt;
descriptive &lt;code&gt;figcaption&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Now let's style an image that contains &lt;code&gt;figcaption&lt;/code&gt; to be different from the other images. I'm going to style it to have padding and box-shadow.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;figure&lt;/span&gt;&lt;span class="nd"&gt;:has&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;img&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nt"&gt;figcaption&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0.75rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;box-shadow&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;2px&lt;/span&gt; &lt;span class="m"&gt;2px&lt;/span&gt; &lt;span class="m"&gt;4px&lt;/span&gt; &lt;span class="m"&gt;1px&lt;/span&gt; &lt;span class="nf"&gt;rgba&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;0.25&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;And the result will be like this&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%2Fik.imagekit.io%2Fmlnzyx%2Fcss-has%2Fmr-crab-ms-puff-edited" 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%2Fik.imagekit.io%2Fmlnzyx%2Fcss-has%2Fmr-crab-ms-puff-edited" alt="mr crab ms puff edit" width="666" height="619"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I simply add some padding with a box-shadow to the &lt;code&gt;&amp;lt;figure&amp;gt;&lt;/code&gt; element, if the &lt;code&gt;&amp;lt;figure&amp;gt;&lt;/code&gt; element has a child that is an &lt;code&gt;&amp;lt;img&amp;gt;&lt;/code&gt; element but also has &lt;code&gt;&amp;lt;figcaption&amp;gt;&lt;/code&gt; element that is a sibling of the &lt;code&gt;&amp;lt;img /&amp;gt;&lt;/code&gt; element.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I hope I explained well with that sentence 😅&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;But the point is I can style the &lt;code&gt;&amp;lt;figure&amp;gt;&lt;/code&gt; element but with a condition if the element has a certain element or is followed by another selector by using CSS &lt;code&gt;:has()&lt;/code&gt; pseudo-class.&lt;/p&gt;

&lt;p&gt;CSS &lt;code&gt;:has()&lt;/code&gt; can also be used along with another pseudo-class, for example using &lt;code&gt;:nth-child(n)&lt;/code&gt; to manage grid column. This can be useful if you don't want to use &lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries" rel="noopener noreferrer"&gt;Media Queries&lt;/a&gt; that much.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="c"&gt;/* This will apply if a container has 4 children or more */&lt;/span&gt;
&lt;span class="nc"&gt;.container&lt;/span&gt;&lt;span class="nd"&gt;:has&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nd"&gt;:nth-child&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="err"&gt;5&lt;/span&gt;&lt;span class="o"&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="c"&gt;/* This will apply if a container has 4 children or more */&lt;/span&gt;
&lt;span class="nc"&gt;.container&lt;/span&gt;&lt;span class="nd"&gt;:has&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nd"&gt;:nth-child&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="err"&gt;10&lt;/span&gt;&lt;span class="o"&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The above snippet can be used to modify our grid column to be 1 when the container has 5 or more items, but when the container has 10 or more items, a different style can be applied, for example, styling a grid column to be 2.&lt;/p&gt;

&lt;h3&gt;
  
  
  Browser Compatibility
&lt;/h3&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%2Fik.imagekit.io%2Fmlnzyx%2Fcss-has%2Fcss-has-compatibility" 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%2Fik.imagekit.io%2Fmlnzyx%2Fcss-has%2Fcss-has-compatibility" alt="cross browser" width="1311" height="639"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;CSS pseudo-class &lt;code&gt;:has()&lt;/code&gt; is now already supported on many browsers, including &lt;strong&gt;Chrome&lt;/strong&gt;, and &lt;strong&gt;Edge&lt;/strong&gt;, but not for Internet Explorer and Firefox.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.wired.com/story/microsoft-internet-explorer-is-finally-really-fully-dead/," rel="noopener noreferrer"&gt;Internet Explorer is already dead&lt;/a&gt; anyway so this is not a problem because so many people already use a modern web browser like Edge or Chrome.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;But be careful, CSS &lt;code&gt;:has()&lt;/code&gt; is not supported on Firefox, but it can be enabled, so you need to be aware of this one, as of today, there are a lot of people still using FireFox.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4&gt;
  
  
  Support Fallback
&lt;/h4&gt;

&lt;p&gt;As on firefox, CSS &lt;code&gt;:has()&lt;/code&gt; pseudo-class is not enabled by default, you might need to think about the fallback, fortunately, we have &lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/@supports" rel="noopener noreferrer"&gt;CSS at-rule&lt;/a&gt; to handle if the browser support some rules or style.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="k"&gt;@supports&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;selector&lt;/span&gt;&lt;span class="p"&gt;(:&lt;/span&gt;&lt;span class="n"&gt;has&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c"&gt;/* Supported! */&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will seek if the browser supports the CSS &lt;code&gt;:has()&lt;/code&gt; pseudo-class.&lt;/p&gt;

&lt;h2&gt;
  
  
  Closing
&lt;/h2&gt;

&lt;p&gt;And that's it, folks, We're reaching the end of this post, thank you so much to read the blog till the last part. I really appreciate and I hope this post is useful for you.&lt;/p&gt;

</description>
      <category>monitoring</category>
      <category>discuss</category>
      <category>productivity</category>
      <category>softwaredevelopment</category>
    </item>
  </channel>
</rss>
