question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

scopeBehaviour: 'global' not remove :global() decl on rule

See original GitHub issue

When using scopeBehaviour: 'global' for below css rule:

body:global(.noselect){ user-select:none }

The :global part is not removed, which result in invalid css selector.

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
DimmDellcommented, Jun 11, 2021

Having the same issue: i have a plugin that adds :global(*someclass*) to some selectors in my postcss and these “:global”-s need to be removed later, but they don’t, so styles break. Tried different combinations of parameters for modules, scopeBehaviour and autoModules, but nothing helped.

0reactions
mattxyzethcommented, Apr 7, 2022

I was dealing with a similar issue. I noticed that the :global() was removed when used within a local class but not when used within an element selector like a or body. I removed the :global() wrapping from the class within those tags, and it compiled correctly. So it seems that if the parent is not transformed, there’s no need to wrap a child in :global() if the desired result should be global.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Developers - scopeBehaviour: 'global' not remove :global() decl on ...
When using scopeBehaviour: 'global' for below css rule: body:global(.noselect){ user-select:none }. The :global part is not removed, which result in invalid ...
Read more >
no-implicit-globals - ESLint - Pluggable JavaScript Linter
This rule disallows the following: Declarations that create one or more variables in the global scope. Global variable leaks. Redeclarations of read-only global...
Read more >
postcss-modules - npm
styles.css */ :global .page { padding: 20px; } .title { composes: title ... the original class name will not to be removed from...
Read more >
Python Scope & the LEGB Rule: Resolving Names in Your Code
If no match is found, then Python looks at the global and built-in scopes. ... Since var isn't declared global inside increment() ,...
Read more >
Configuring Vite
But process or global should not be put into this option. ... You can use --force flag or manually delete the directory to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found