• About Us
  • Privacy Policy
  • Disclaimer
  • Contact Us
AimactGrow
  • Home
  • Technology
  • AI
  • SEO
  • Coding
  • Gaming
  • Cybersecurity
  • Digital marketing
No Result
View All Result
  • Home
  • Technology
  • AI
  • SEO
  • Coding
  • Gaming
  • Cybersecurity
  • Digital marketing
No Result
View All Result
AimactGrow
No Result
View All Result

4 Causes That Make Tailwind Nice for Constructing Layouts

Admin by Admin
March 18, 2026
Home Coding
Share on FacebookShare on Twitter


Once I discuss layouts, I’m referring to the way you place objects on a web page. The CSS properties which can be extensively used right here embody:

  • show — typically grid or flex these days
  • margin
  • padding
  • width
  • peak
  • place
  • high, left, backside, proper

I typically embody border-width as a minor merchandise on this checklist as effectively.

At this level, there’s just one factor I’d wish to say.

Tailwind is de facto nice for making layouts.

There are various the reason why.

First: Structure kinds are extremely depending on the HTML construction

After we shift layouts into CSS, we lose the psychological construction and it takes effort to re-establish them. Think about the next three-column grid in HTML and CSS:

.grid {
  show: grid;
  grid-template-columns: 2fr 1fr;

  .grid-item:first-child {
    grid-column: span 2
  }

  .grid-item:last-child {
    grid-column: span 1
  }
}
Two blue rectangles side-by-side illustrating a two-column layout where the left column is twice the width of the right column.

Now cowl the HTML construction and simply learn the CSS. As you do this, discover it's essential to exert effort to think about the HTML construction that this is applicable to.

Now think about the identical, however constructed with Tailwind utilities:

You may virtually start to see the structure manifest in your eyes with out seeing the precise output. It’s fairly clear: A 3-column grid, first merchandise spans two columns whereas the second spans one column.

However grid-cols-3 and col-span-2 are kinda bizarre and foreign-looking as a result of we’re attempting to parse Tailwind’s methodology of writing CSS.

Now, watch what occurs once we shift the syntax out of the best way and use CSS variables to outline the structure as an alternative. The structure turns into crystal clear instantly:

Two blue rectangles side-by-side illustrating a two-column layout where the left column is twice the width of the right column.

Identical three-column structure.

Nevertheless it makes the structure a lot simpler to jot down, learn, and visualize. It additionally has different advantages, however I’ll allow you to discover its documentation as an alternative of explaining it right here.

For now, let’s transfer on.

Why not use 2fr 1fr?

It is sensible to jot down 2fr 1fr for a three-column grid, doesn’t it?

.grid {
  show: grid;
  grid-template-columns: 2fr 1fr;
}

Sadly, it received’t work. It's because fr is calculated based mostly on the accessible house after subtracting away the grid’s gutters (or hole).

Since 2fr 1fr solely accommodates two columns, the output from 2fr 1fr will likely be completely different from a typical three-column grid.

Three examples of multi-column layouts stacked. The first is an equal three-column layout, the second and third are two columns where the left column is double the width of the right column.

Alright. Let’s proceed with the explanations that make Tailwind nice for constructing layouts.

Second: No want to call layouts

I feel layouts are the toughest issues to call. I not often provide you with higher names than:

  • Quantity + Columns, e.g. .two-columns
  • Semantic names, e.g. .content-sidebar

However these names don’t do the structure justice. You possibly can’t actually inform what’s occurring, even when you see .two-columns, as a result of .two-columns can imply a wide range of issues:

  • Two equal columns
  • Two columns with 1fr auto
  • Two columns with auto 1fr
  • Two columns that spans whole of seven “columns” and the primary object takes up 4 columns whereas the second takes up 3…

You possibly can already see me tripping up when I attempt to clarify that final one there…

As a substitute of forcing ourselves to call the structure, we will let the numbers do the speaking — then the entire construction turns into very clear.

The variables paint an image.

Example of a seven-column layout above a two-column layout with equally-sized columns.

Third: Structure necessities can change relying on context

A “two-column” structure may need completely different properties when utilized in completely different contexts. Right here’s an instance.

Two two-by-two layouts next to each other. In both cases, the third item wraps to the second line, followed by the fourth item.

On this instance, you may see that:

  • A bigger hole is used between the I and J teams.
  • A smaller hole is used inside the I and J teams.

The distinction in hole sizes is refined, however used to point out that the objects are of separate teams.

Right here’s an instance the place this idea is utilized in an actual mission. You possibly can see the distinction between the hole used inside the publication container and the hole used between the publication and quote containers.

A two-column layout for a newsletter signup component with the form as the left column that is wider than the width of the right column, containing content.

If this form of structure is simply utilized in one place, we don’t need to create a modifier class simply to alter the hole worth. We are able to change it straight.

One other widespread instance

Let’s say you could have a heading for a advertising part. The heading would look nicer if you'll be able to fluctuate its max-width so the textual content isn’t orphaned.

text-balance may work right here, however that is typically nicer with guide positioning.

With out Tailwind, you may write an inline model for it.

Your subscription has been confirmed

With Tailwind, you may specify the max-width in a extra terse approach:

Your subscription has been confirmed

A centered heading in black that says Your subscription has been confirmed.

Fourth: Responsive variants could be created on the fly

“At which breakpoint would you modify your layouts?” is one other issue you’d wish to take into account when designing your layouts. I shall time period this the responsive issue for this part.

Most definitely, comparable layouts ought to have the identical responsive issue. In that case, it is sensible to group the layouts collectively right into a named structure.

.two-column {
  @apply grid-simple;
  /* --cols: 1 is the default */

  @media (width >= 800px) {
    --cols:2;
  }
}

Nevertheless, you might have layouts the place you need two-column grids on a cell and a a lot bigger column rely on tablets and desktops. This structure model is often utilized in a website footer part.

For the reason that footer grid is exclusive, we will add Tailwind’s responsive variants and alter the structure on the fly.

Example of a footer that adapts to the screen size. It goes from a two-column layout on small screens to a five-column layout on wider screens.

Once more, we get to create a brand new structure on the fly with out creating a further modifier class — this retains our CSS clear and centered.

finest use Tailwind

This text is a pattern lesson from my course, Unorthodox Tailwind, the place I present you the way to use Tailwind and CSS synergistically.

Personally, I feel one of the simplest ways to make use of Tailwind is to not litter your HTML with Tailwind utilities, however to create utilities that allow you to create layouts and kinds simply.

I cowl way more of that within the course when you’re to search out out extra!

Tags: BuildingGreatLayoutsreasonsTailwind
Admin

Admin

Next Post
Search Referral Site visitors Down 60% For Small Publishers, Information Reveals

Search Referral Site visitors Down 60% For Small Publishers, Information Reveals

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recommended.

Zenless Zone Zero’s huge end-of-year replace brings multiplayer fight, free Zhao, and the primary dual-form Agent

Zenless Zone Zero’s huge end-of-year replace brings multiplayer fight, free Zhao, and the primary dual-form Agent

December 22, 2025
16 of the most effective Fb advert examples that truly work (and why)

16 of the most effective Fb advert examples that truly work (and why)

May 17, 2025

Trending.

AI-Assisted Menace Actor Compromises 600+ FortiGate Gadgets in 55 Nations

AI-Assisted Menace Actor Compromises 600+ FortiGate Gadgets in 55 Nations

February 23, 2026
10 tricks to begin getting ready! • Yoast

10 tricks to begin getting ready! • Yoast

July 21, 2025
Exporting a Material Simulation from Blender to an Interactive Three.js Scene

Exporting a Material Simulation from Blender to an Interactive Three.js Scene

August 20, 2025
Moonshot AI Releases 𝑨𝒕𝒕𝒆𝒏𝒕𝒊𝒐𝒏 𝑹𝒆𝒔𝒊𝒅𝒖𝒂𝒍𝒔 to Exchange Mounted Residual Mixing with Depth-Sensible Consideration for Higher Scaling in Transformers

Moonshot AI Releases 𝑨𝒕𝒕𝒆𝒏𝒕𝒊𝒐𝒏 𝑹𝒆𝒔𝒊𝒅𝒖𝒂𝒍𝒔 to Exchange Mounted Residual Mixing with Depth-Sensible Consideration for Higher Scaling in Transformers

March 16, 2026
Design Has By no means Been Extra Vital: Inside Shopify’s Acquisition of Molly

Design Has By no means Been Extra Vital: Inside Shopify’s Acquisition of Molly

September 8, 2025

AimactGrow

Welcome to AimactGrow, your ultimate source for all things technology! Our mission is to provide insightful, up-to-date content on the latest advancements in technology, coding, gaming, digital marketing, SEO, cybersecurity, and artificial intelligence (AI).

Categories

  • AI
  • Coding
  • Cybersecurity
  • Digital marketing
  • Gaming
  • SEO
  • Technology

Recent News

Crimson Desert launch time in your time zone

Crimson Desert launch time in your time zone

March 18, 2026
Kalshi’s authorized troubles pile up, as Arizona information first ever legal prices over ‘unlawful playing enterprise’

Kalshi’s authorized troubles pile up, as Arizona information first ever legal prices over ‘unlawful playing enterprise’

March 18, 2026
  • About Us
  • Privacy Policy
  • Disclaimer
  • Contact Us

© 2025 https://blog.aimactgrow.com/ - All Rights Reserved

No Result
View All Result
  • Home
  • Technology
  • AI
  • SEO
  • Coding
  • Gaming
  • Cybersecurity
  • Digital marketing

© 2025 https://blog.aimactgrow.com/ - All Rights Reserved