Skip to content

:global not working as nested selector #129

Closed
@arxpoetica

Description

@arxpoetica

I use postcss-nested with postcss-global-nested, putting nested before the global nested plugin (in order).

This works in v4+ of postcss-nested and v5.0.1 but not in 5.0.0 or 5.0.2+.

Given:

.selector {
	:global {
		h2 {
			color: pink;
		}
	}
}

Expected:

.selector :global h2 {
	color: pink;
}

Actual:

.selector :global {
	h2 {
		color: pink;
	}
}

It's a little baffling, because both 5.0.1 and 5.0.2 are putting out

and

css: '.selector :global h2 {\n' +
    '\t\t\tcolor: pink;\n' +
    '\t\t}\n',

So... 🤷‍♂️

Happy to put together a repro if needed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions