Weekly Webtips
Published in

Weekly Webtips

TailwindCSS v3 released! A look at the new features 🎨

Intro

Tailwind CSS v3.0 just got released and they have added a lot of cool features, so let’s have a look at them.

JIT is now inbuilt

The JIT mode is now inbuilt in TailwindCSS so it is way faster now and also enables some cool new features like stackable variants, arbitrary value support.

Lot’s of new colors

There are many new colors now and they are 22 in total!

There are also 5 different gray’s now! 🤯

Colored box-shadow

Colored box-shadow was an important feature that wasn’t in tailwind until v3. But it is finally here and so easy to use :D

<button class="shadow-lg shadow-green-500 text-center bg-green-500 text-white px-8 py-3 rounded-full text-xl">Button</button>

A few classes can you give you this beautiful button-

Aspect ratio

Now you don’t have to use any plugins to use the aspect class, you can use the various types provided like- aspect-video, aspect-auto, aspect-square, or use custom values like aspect-[9/6] as JIT is now inbuilt.

This is a great feature that allows you to have a list of scrollable elements which snap to center, start, or end. In this demo, I am using center snap-

This will give a nice snap scrolling effect like this

You can now add smooth scrolling in tailwind CSS by adding the scroll-smooth class. If you want to add margin to some places for scroll, it can be done by prefixing scroll, like- scroll-m-4.

Multi-column layout

Tailwind now supports multi-column/newspaper-like layouts! You can give a specific number of columns you need or just set it to auto for the browser to decide how many columns to use based on size.

Accent color & file upload

Accent color

You can now customize your forms to match the theme of your brand and it will change the colors of things like checkboxes and radio buttons.

You can achieve this by just adding the accent-<color>-<shade> to the div/form tag.

File upload button

You can also customize the file upload buttons to look beautiful like this-

You can add styles as you do normally but prefix file:. To get the same button as I did you can use this-

Fancy underlines

You can now change the color, thickness, and style of your underlines as well!

To use these styles you need to use decoration-red-600 decoration-wavy so the styles will look like this-

<input type="file" class="file:bg-emerald-200 file:px-4 file:py-2 file:rounded-full file:border-none file:text-emerald-900 file:text-lg file:font-semibold"/>

Conclusion

The team at TailwindCSS has also released some more cool stuff, I just highlighted the things that I found the most exciting. To know more about Tailwind you can check out their website 😉. See ya next time ✌️

Useful links

TailwindCSS

Tailwind’s video on the release

Connect with me

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Avneesh Agarwal

Avneesh Agarwal

135 Followers

I am a young enthusiastic web developer. I love to code in ReactJS and make beautiful websites.