Skip to content

Releases: tailwindlabs/tailwindcss

v1.0.0-beta.1

16 Mar 23:56
Compare
Choose a tag to compare
v1.0.0-beta.1 Pre-release
Pre-release

Tailwind CSS v1.0.0-beta.1

It's here! 🎉

This release of Tailwind focuses mostly on changing things from 0.x that I would have done differently had I known where the feature set would be at today in advance.

So while there's not a ton of exciting new features, you can at least be excited about the fact that we now have a really stable base to build on, and that very soon we'll be out of the unpredictable pre-1.0 phase so you can feel comfortable using Tailwind in production if the 0.x label gave you pause.

New features

  • New config file structure: #637, Sample
  • New expanded default color palette: #737
  • New default maxWidth scale: #701
  • Default variant output position can be customized: #657
  • Extended default line-height scale: #673
  • Extended default letter-spacing scale: #671
  • object-position utilities are now customizable under theme.objectPosition: #676
  • cursor utilities are now customizable under theme.cursors: #679
  • flex-grow/shrink utilities are now customizable under theme.flexGrow/flexShrink: #690
  • Added utilities for list-style-type and list-style-position: #761
  • Added break-all utility: #763

Updated documentation

The documentation is still very much a work-in-progress (half of it is probably broken), but you can see the v1.0 documentation in its current state here:

https://next.tailwindcss.com/docs/what-is-tailwind/

If you notice any stale content, a pull request would be awesome:

https://github.com/tailwindcss/docs

Make sure you target the next branch.

Upgrade guide

Note: Some things have changed in later beta releases. If you are upgrading to the latest beta and not specifically to beta.1, follow the upgrade guide that's in the documentation: https://next.tailwindcss.com/docs/upgrading-to-v1

Steps that impact all users:

  1. Update Tailwind
  2. Update your config file
  3. Rename tailwind.js to tailwind.config.js
  4. Replace @tailwind preflight with @tailwind base
  5. Replace config() with theme()
  6. Explicitly style any headings
  7. Explicitly style any lists that should have bullets/numbers
  8. Remove any usage of .list-reset
  9. Replace .pin-{side} with .{top|left|bottom|right|inset}-{value}
  10. Replace .roman with .not-italic
  11. Replace .flex-no-grow/shrink with .flex-grow/shrink-0
  12. Explicitly add color and underline styles to links
  13. Add inline to any replaced elements (img, video, etc.) that should not be display: block
  14. Adjust the line-height and padding on your form elements
  15. Adjust the text color on your form elements
  16. Double check your default font family
  17. Double check your default line-height

Additional steps for CDN users, or anyone that has a true dependency on our default configuration either by omitting sections from their config file, referencing our config file, or not using a config file at all:

  1. Update any usage of text/bg/border-{color} classes
  2. Replace tracking-tight/wide with tracking-tighter/wider
  3. Check your design against the updated default breakpoints
  4. Double check any usage of the default shadow-{size} utilities
  5. Update any usage of the default max-w-{size} utilities

Additional steps for plugin authors:

  1. Escape the class portion of any custom variants you have created

All users

Update Tailwind

While v1.0 is still in a pre-release state, you can pull it in to your project using npm:

npm install tailwindcss@next --save-dev

Or using Yarn:

yarn add -D tailwindcss@next

Update your config file

Impact: All users, Effort: Moderate

This is really the big change in v1.0 — you can read all about the new config file format and motivation behind it in the initial pull request.

The new general config structure looks like this:

module.exports = {
  prefix: '',
  important: false,
  separator: ':',
  theme: {
    colors: { ... },
    // ...
    zIndex: { ... },
  },
  variants: {
    appearance: ['responsive'],
    // ...
    zIndex: ['responsive'],
  },
  plugins: [
    // ...
  ],
}

See the new default config file for a complete example.

There are a lot of changes here but they are all fairly cosmetic and entirely localized to this one file, so while it may look intimidating it's actually only 10-15 minutes of work.

  1. Move all design-related top-level keys into a new section called theme.

    Every key except options, modules, and plugins should be nested under a new theme key.

    Your config file should look generally like this at this point:

      let defaultConfig = require('tailwindcss/defaultConfig')()
    
      let colors = {
        // ...
      }
    
      module.exports = {
    -   colors: colors,
    -   screens: {
    -     // ...
    -   },
    -   // ...
    -   zIndex: {
    -     // ...
    -   },
    +   theme: {
    +     colors: colors,
    +     screens: {
    +       // ...
    +     },
    +     // ...
    +     zIndex: {
    +       // ...
    +     },
    +   },
        modules: {
          appearance: ['responsive'],
          // ...
          zIndex: ['responsive'],
        },
        plugins: [
          require('tailwindcss/plugins/container')({
            // ...
          }),
        ],
        options: {
          prefix: '',
          important: false,
          separator: ':',
        }
      }
  2. Rename modules to variants.

    "Modules" was a word we just kinda grabbed because we needed something, and we wanted to use that section of the config to both specify variants and disable modules if necessary.

    Now that all of Tailwind's internal "modules" are actually just core plugins, I've decided to deprecate this terminology entirely, and make this section of the config purely about configuring variants for core plugins.

    After making this change, your config file should look like this:

      let defaultConfig = require('tailwindcss/defaultConfig')()
    
      let colors = {
        // ...
      }
    
      module.exports = {
        theme: {
          // ...
        },
    -   modules: {
    +   variants: {
          appearance: ['responsive'],
          backgroundAttachment: ['responsive'],
          backgroundColors: ['responsive', 'hover', 'focus'],
          // ...
          zIndex: ['responsive'],
        },
        plugins: [
          require('tailwindcss/plugins/container')({
            // ...
          }),
        ],
        options: {
          prefix: '',
          important: false,
          separator: ':',
        }
      }
  3. Move your options settings to the top-level.

    The advanced options have been moved to the top-level of the config file instead of being nested under the redundant options key.

    After making this change, your config file should look like this:

      let defaultConfig = require('tailwindcss/defaultConfig')()
    
      let colors = {
        // ...
      }
    
      module.exports = {
    +   prefix: '',
    +   important: false,
    +   separator: ':',
        theme: {
          // ...
        },
        variants: {
          appearance: ['responsive'],
          backgroundAttachment: ['responsive'],
          backgroundColors: ['responsive', 'hover', 'focus'],
          // ...
          zIndex: ['responsive'],
        },
        plugins: [
          require('tailwindcss/plugins/container')({
            // ...
          }),
        ],
    -   options: {
    -     prefix: '',
    -     important: false,
    -     separator: ':',
    -   }
      }
  4. Update the sections under theme to their new names.

    As part of an effort to make the naming in the config file more consistent, many of the sections under theme have been renamed.

    These are the sections that need to be updated:

    Old New
    fonts `...
Read more

v0.7.4

23 Jan 12:59
Compare
Choose a tag to compare
  • Update our PostCSS related dependencies (#618)
  • Fix bug where class names containing a . character had the responsive prefix added in the wrong place (#613)

v0.7.3

13 Dec 19:25
Compare
Choose a tag to compare
  • Update Normalize to v8.0.1 (#588)

v0.7.2

05 Nov 13:55
Compare
Choose a tag to compare
  • Add --no-autoprefixer option to CLI build command (#584)

v0.7.1

05 Nov 13:37
Compare
Choose a tag to compare
  • Update autoprefixer dependency (fixes #583)

v0.7.0

31 Oct 19:56
Compare
Choose a tag to compare

New Features

Registering new variants from plugins (#505)

(Introduced as an experiment in v0.6.2, now promoted to an official feature)

Plugins can now add their own variants (like hover, focus, group-hover, etc.) to Tailwind.

To get started, destructure the new addVariant function from the object passed to your plugin, and call it with the name of the variant you'd like to add and a callback that can be used to manipulate the PostCSS nodes where the variant is being applied:

module.exports = {
  plugins: [
    function({ addVariant }) {
      addVariant('important', ({ container }) => {
        container.walkRules(rule => {
          rule.selector = `.\\!${rule.selector.slice(1)}`
          rule.walkDecls(decl => {
            decl.important = true
          })
        })
      })
    }
  ]
}

Documentation is coming soon, but for now learn more in the pull request.

Variant order can be customized per module (#505)

(Introduced as an experiment in v0.6.2, now promoted to an official feature)

Variants are now generated in the order that they are specified in the modules section of your config file, rather than in a hard-coded static order like in previous versions of Tailwind.

That means that if you want focus variants to defeat hover variants for background colors, but you want the opposite behavior for border colors, you can actually do that now by specifying the order in your config:

modules.exports = {
  // ...
  modules: {
    // ...
    backgroundColors: ['responsive', 'hover', 'focus'],
    // ...
    borderColors: ['responsive', 'focus', 'hover'],
    // ...
  }
}

Note that this doesn't affect responsive variants — those are a special case since responsive versions are also generated for other variants, and we group responsive declarations to optimize the resulting CSS.

Added focus-within variant (#463)

Tailwind now includes a focus-within variant that you can use to change how an element is styled if an element inside of it has focus.

<div class="focus-within:shadow-lg">
  <label>
    <span>Email</span>
    <input type="email">
  </label>
</div>

Learn about the :focus-within pseudo-class on MDN

By default we don't generate focus-within variants for any utilities, but you can change this in the modules section your Tailwind configuration file:

  modules.exports = {
    // ...
    modules: {
      // ...
-     backgroundColors: ['responsive', 'hover', 'focus'],
+     backgroundColors: ['responsive', 'focus-within', 'hover', focus'],
      // ...
    }
  }

Fancy CLI updates (#554)

Tailwind 0.7.0 includes a completely rewritten CLI tool with nicer output and a better user experience.

All of the existing functionality is still there with the same API, it just looks better.

Option to generate config without comments (#558)

You can now use the --no-comments option when running tailwind init to generate a config file that excludes all of the inline documentation comments.

This is a great way to make your config file easier to skim if you're an experienced Tailwind user who doesn't need the comments.

Make configured prefix optional when using @apply (#553)

If you're prefixing your generated utilities, including that prefix when using @apply is now optional.

/* Before */
.my-component {
  @apply tw-bg-blue tw-text-white tw-font-bold;
}

/* Now */
.my-component {
  @apply bg-blue text-white font-bold;
}

You can continue to use the prefix if you like, or drop it if you prefer a terser syntax.

Improve Flexbox behavior in IE 10/11 (#550)

IE 10 and 11 interpret the shorthand flex property differently than other browsers.

Tailwind now specifies explicit grow, shrink, and basis values for the flex-1, flex-auto, and flex-initial utilities for a more consistent cross-browser experience.

Learn more at the flexbugs repo (bugs #4 and #6 specifically)

Changes

Variant order in modules config is now significant (#505)

Impact: Low, Effort: Low

Prior to 0.7.0, variants were always generated in the same order, regardless of the order specified in the modules section of your config file.

Now, variants are generated in the they are specified. That means that if your config file currently lists variants in a different order than the <=0.6.6 default variant order, those variants will appear in a different order in your CSS.

To preserve the <=0.6.6 behavior, simply edit the modules section of your config file to make sure your variants are listed in the following order:

modules.exports = {
  // ...
  modules: {
    // ...
    [anyModule]: ['group-hover', 'hover', 'focus-within', 'focus', 'active']
    // ...
  }
}

Normalize.css updated to v8.0.0 (#537)

Impact: Low, Effort: Low

We've updated our dependency on Normalize.css from 7.0.0 to 8.0.0.

This drops support for very old browsers like IE9, Android 4.3, Safari 8, and iOS Safari 7-8.

If you still need to support those browsers, remove @tailwind preflight from your CSS, add Normalize.css 7.0.0 to your project, and manually add our additional preflight base styles.

Removed CSS fix for Chrome 62 button border radius change (#579)

Impact: Low, Effort: Low

When Chrome 62 was released, it introduced a user agent stylesheet change that added a default border radius to all buttons.

This messed up styles for like half of the internet (including sites like GitHub itself), so Chrome reverted the change in Chrome 63.

We included a fix for this in Tailwind with the intention to remove it when Chrome 62 was no longer in common use. Now that usage has dropped to 0.09%, we've removed our fix.

If this is a problem for you (it isn't), you can add the removed styles back to your project right after @tailwind preflight.

v0.6.6

21 Sep 18:55
Compare
Choose a tag to compare

v0.6.5

18 Aug 11:07
Compare
Choose a tag to compare
  • Fixes an issue where units were stripped from zero value properties (#533)

v0.6.4

16 Jul 12:52
Compare
Choose a tag to compare
  • Fixes an issue where changes to your configuration file were ignored when using webpack --watch (#520)

v0.6.3

11 Jul 19:57
Compare
Choose a tag to compare
  • Fixes an issue where @tailwind utilities generated no output (#518)