Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

Elian Van Cutsem
Elian Van Cutsem

Posted on • Originally published atelian.codes on

     

What's new in TailwindCSS v3

TailwindCSSv3.0.0-alpha-1 was released yesterday! It's not a full release of v3 yet, but might already give us an insight on what is to come with TailwindCSS v3.

I went through the release notes and summed up some things that I found importand below.

New

In TailwindCSS v3, JIT will be the default compiler mode. If you want to learn more about the Just-In-Time compiler,check this blogpost.

All colors are enabled by default. Before you had to import them via thetailwind.config.js.

new utilities:

  • aspect-ratio
  • scroll-snap
  • scroll-behavior
  • text-indent
  • column
  • touch-action
  • will-change
  • border-x &border-y

new variants:

  • file: -> for the native file upload button styling
  • open: -> for styling native<details> &<dialog> elements

Using JIT in CDN mode

Before, when using the TailwindCSS CDN, you had to give up on a lot of configuration functionality. Well, that isn't the case anymore since TailwindCSS v3. But TailwindLabs noted:TailwindCSS CDN JIT is intended for development only, do not use in production!. So there is probably still something in the works there.

Using the TailwindCSS CDN JIT isn't that hard:

<!DOCTYPE html><htmllang="en"><head><!-- add base TailwindCSS --><scriptsrc="https://cdn-tailwindcss.vercel.app/"></script><!-- add Plugins --><scriptsrc="https://cdn-tailwindcss.vercel.app/?plugins=forms,typography,aspect-ratio,line-clamp"></script><!-- customize config --><script>tailwind.config={theme:{extend:{colors:{tomato:'tomato',},},},}</script><!-- add custom styling --><styletype="text/tailwindcss">body{@applybg-pink-500;}</style></head><body><!-- --></body></html>
Enter fullscreen modeExit fullscreen mode

Breaking

  • PostCSS 7 won't be supported any longer
  • purge option intailwind.config.js has changed tocontent
  • overflow-clip utility was changed totext-clip

Notes

If you decide on trying TailwindCSS v3 early, be sure to update the@tailwindcss dependencies to like@tailwindcss/typography and@tailwindcss/forms

You can install or upgrade bothtailwindcss and its dependencies by adding@next as a release:

npm i-D tailwindcss@nextnpm i-D @tailwindcss/typography@next
Enter fullscreen modeExit fullscreen mode

All official releasenotes can be foundon the TailwindCSS GitHub repo.
Check out the officialTailwindCSS Documentation

Top comments(0)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

Core Astro Team | devs.gent meetup organizer | BeJS, React Brussels & React Paris household figure | public speaker | Podcast Host
  • Location
    Ghent, Belgium
  • Education
    Bachelors in ICT, specialisation in Web & Mobile development
  • Work
    Core Astro Team at The Astro Technology Company
  • Joined

More fromElian Van Cutsem

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp