Skip to content

Instantly share code, notes, and snippets.

@avaitla
Last active March 25, 2021 17:27
Show Gist options
  • Save avaitla/e7764d95431a5a904857a7f4e81c8fcd to your computer and use it in GitHub Desktop.
Save avaitla/e7764d95431a5a904857a7f4e81c8fcd to your computer and use it in GitHub Desktop.
Broken Hover Background CSS Generation with Tailwind 1.7.6 and Tailwind CSS 0.6.0 (0.5.0 works)

Setup:

$ npm init
$ npm install tailwindcss@1.7.6

Place index.html, tailwind.config.js, postcss.config.js, and styles.css in the same folder.

Run the following which works ✅

$ npm install @tailwindcss/ui@0.5.0
$ npx tailwindcss build styles.css -o output.css

Open index.html and see that hovering changes the color of the button

Now run the following which doesn't work ❌

$ npm install @tailwindcss/ui@0.6.0
$ npx tailwindcss build styles.css -o output.css

Open index.html and see that hovering no longer changes the color of the button

<html>
<head>
<link rel="stylesheet" href="output.css">
</head>
<body>
<button class="bg-transparent hover:bg-blue-500 text-blue-700 hover:text-white">
Hover me
</button>
</body>
</html>
module.exports = {
plugins: [
require('tailwindcss'),
require('autoprefixer')
]
}
@import "tailwindcss/base";
@import "tailwindcss/components";
@import "tailwindcss/utilities";
module.exports = {
purge: {
content: ['index.html'],
},
plugins: [
require('@tailwindcss/ui')
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment