Error: Missing whitespace after :global

See original GitHub issue

This is my style:

Error

.wrap-box {
    margin: 15px 0;
    :global {
        &.box {
            .otherClass {
                width: 44px;
                height: 44px;
                display: flex;
                justify-content: center;
                align-items: center;
                font-size: 20px;
            }
        }
    }
}

Error message

Module build failed: Missing whitespace after :global (3:3)

How can I fix this issue.

Sorry if the issue is already there but I can not find it.

Thanks!

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:18 (7 by maintainers)

github_iconTop GitHub Comments

12reactions
asumarancommented, Jul 9, 2019

any workaround?

I’ve created my React app with create-react-app v3.0.1 and I’m trying to use CSS modules.

I want to make the following CSS:

.foo {
  :global {
    &.ant-select {
      width: 105px;
    }
  }
}

which I think it should output

.styles_foo__3BRjd.ant-select {
  width: 105px;
}

edit:

I found this workaround: https://github.com/css-modules/css-modules/issues/295#issuecomment-404873976

8reactions
thedv91commented, Nov 13, 2017

I want complier from

.wrap {
    :global {
        &.original-class {
        // style
        }
    }
}

to

._2_aKvs-b8bW2Vg3fwHozO.original-class {
  // style
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Missing whitespace before :global - css - Stack Overflow
For anyone that is searching the web with no solution to this (scoping bootstrap w/ css modules), I made this work as described...
Read more >
Error: Missing whitespace after :global - Bountysource
Error : Missing whitespace after :global. ... This is my style: Error .wrap-box { margin: 15px 0; :global { &.box { .otherClass {...
Read more >
Missing whitespace around operator (E225) - Flake8 Rules
There should be one space before and after all operators.
Read more >
why does tslint return a "missing whitespace" error for this line ...
why does tslint return a "missing whitespace" error for this line of code? ... if(qs.length > 0) qs += (authorsParams.length > 0 ?...
Read more >
Add markup validation for missing whitespace between ...
It is a very difficult visual cue to spot and without IDE support it can be cumbersome to identify the problem. Only the...
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