Parsing error: Unexpected token #5626
Unanswered
gregarega1993
asked this question in
Help
Replies: 1 comment
-
Hey! I think you need to wrap your function in a // tailwind.config.js
plugins: [
require('@tailwindcss/forms'),
require('@tailwindcss/typography'),
plugin(function ({ addComponents }) {
addComponents({
'.test': {
width: '100%',
'@screen sm': { maxWidth: '640px' },
'@screen md': { maxWidth: '768px' },
'@screen lg': { maxWidth: '1024px' },
'@screen xl': { maxWidth: '1280px' },
},
})
}),
] Here's a Tailwind Play example with your code wrapped in the https://play.tailwindcss.com/8NltvUTfw0?file=config If that was not your issue, you should probably share some code in a repo so we can have a look. Hope it helps! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
When writing this I get an error: "Parsing error: Unexpected token" where function ({ addComponents }) { is written. What is the issue?
plugins: [ require('@tailwindcss/forms'), require('@tailwindcss/typography'), function ({ addComponents }) { addComponents({ '.container': { width: '100%', '@screen sm': { maxWidth: '640px', }, '@screen md': { maxWidth: '768px', }, '@screen lg': { maxWidth: '1024px', }, '@screen xl': { maxWidth: '1280px', }, } }) } ],
Beta Was this translation helpful? Give feedback.
All reactions