Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Parsing error with complex custom properties

Open
#147 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript
Domain
tooling

Research direction

Start by reproducing the reported CSS custom-property example and tracing the parser error through the mentioned Parser.parse and Parser.pseudo entry points. Confirm that the complex custom property no longer triggers the selector-parser error, then verify the existing parsing behavior remains intact.

Written by the indexing model from the issue text.

Description

I am using postcss-preset-env which use this plugin and I am getting a parsing error when I have a "complex" custom property.

When a css file hat the following code:

:root{
  --myColor: green,
  --myInnerStyle: {
    font-family: "Open Sans", 'Helvetica Neue', Helvetica, Arial, sans-serif;
  }
}

I am getting this error:

ERROR in ./src/components/MyThemeOverride.css (./node_modules/css-loader??ref--10-1!./node_modules/postcss-loader/lib??postcss!./node_modules/sass-loader/lib/loader.js??ref--10-3!./src/components/MyThemeOverride.css)
Module build failed: Error: Expected a pseudo-class or pseudo-element.
at Root._error (C:\Git\client-react\node_modules\postcss-attribute-case-insensitive\node_modules\postcss-selector-parser\dist\parser.js:173:24)
at Root.error (C:\Git\client-react\node_modules\postcss-attribute-case-insensitive\node_modules\postcss-selector-parser\dist\selectors\root.js:43:25)
at Parser.error (C:\Git\client-react\node_modules\postcss-attribute-case-insensitive\node_modules\postcss-selector-parser\dist\parser.js:561:25)
at Parser.expected (C:\Git\client-react\node_modules\postcss-attribute-case-insensitive\node_modules\postcss-selector-parser\dist\parser.js:879:25)
at Parser.pseudo (C:\Git\client-react\node_modules\postcss-attribute-case-insensitive\node_modules\postcss-selector-parser\dist\parser.js:673:25)
at Parser.parse (C:\Git\client-react\node_modules\postcss-attribute-case-insensitive\node_modules\postcss-selector-parser\dist\parser.js:843:22)
at Parser.loop (C:\Git\client-react\node_modules\postcss-attribute-case-insensitive\node_modules\postcss-selector-parser\dist\parser.js:812:18)
at new Parser (C:\Git\client-react\node_modules\postcss-attribute-case-insensitive\node_modules\postcss-selector-parser\dist\parser.js:165:14)
at Processor._root (C:\Git\client-react\node_modules\postcss-attribute-case-insensitive\node_modules\postcss-selector-parser\dist\processor.js:47:22)
at Processor._runSync (C:\Git\client-react\node_modules\postcss-attribute-case-insensitive\node_modules\postcss-selector-parser\dist\processor.js:83:25)
@ ./src/components/MyThemeOverride.css 2:14-220 21:1-42:3 21:218-42:2 22:19-225
@ ./src/components/Root.js
@ ./src/index.js
@ multi ./src/webpack-public-path react-hot-loader/patch webpack-hot-middleware/client?reload=true ./src/index.js

Dominant language
JavaScript
Stars
214
Forks
63
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from postcss/postcss-selector-parser

All issues in postcss/postcss-selector-parser

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.