csso icon indicating copy to clipboard operation
csso copied to clipboard

Some selectors from tailwindcss kills csso parser with error "Unexpected input"

Open Semdevmaster opened this issue 4 years ago • 3 comments

Example selector: .sm\:focus-within\:text-opacity-5:focus-within{} Get in the console: SyntaxError: Unexpected input at Object.error (.........\node_modules\css-tree\lib\parser\create.js:240:19) Try this selector in https://hugogiraudel.github.io/selectors-explained/ no error Is this a parser problem or is it really selector problem?

Semdevmaster avatar Dec 19 '20 15:12 Semdevmaster

I tested this selector on pure css and it is fully valid. Apparently the problem is in the parser.

Semdevmaster avatar Dec 19 '20 18:12 Semdevmaster

Which version of CSSO do you use? Can't reproduce in the latest version: image

lahmatiy avatar Jan 06 '21 11:01 lahmatiy

Describe the problem: Example selector: .sm:focus-within:text-opacity-5:focus-within{} Get in the console: SyntaxError: Unexpected input at Object.error (.........\node_modules\css-tree\lib\parser\create.js:240:19)

Link to a minimal reproduction: 1)default config tailwindcss (use only utilities) 2)add postcss plugin "postcss-csso" in postcss.config.js 3)get above error in console

Semdevmaster avatar Jan 08 '21 16:01 Semdevmaster