Skip to content

Instantly share code, notes, and snippets.

@Akryum
Created January 6, 2021 15:22
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save Akryum/562deb1d9e01293a31daa25814ef12a4 to your computer and use it in GitHub Desktop.
Save Akryum/562deb1d9e01293a31daa25814ef12a4 to your computer and use it in GitHub Desktop.
Tailwind negate responsive breakpoints
<div class="flex !md:flex-col items-center !md:space-y-6 md:space-x-6">
<button>Menu button 1</button>
<button>Menu button 2</button>
<button>Menu button 3</button>
</div>
const defaultTheme = require('tailwindcss/defaultTheme')
module.exports = {
theme: {
extend: {
screens: Object.keys(defaultTheme.screens).reduce((obj, key) => {
const [rawMin] = defaultTheme.screens[key].split('px')
const max = parseInt(rawMin) - 1
obj[`!${key}`] = { max: `${max}px` }
return obj
}, {}),
},
},
}
@Tahul
Copy link

Tahul commented Jan 6, 2021

Thanks 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment