Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistency with @extend and pseudo selectors between versions #1843

Closed
lachlanmcdonald opened this issue Dec 12, 2022 · 0 comments · Fixed by #1866
Closed

Inconsistency with @extend and pseudo selectors between versions #1843

lachlanmcdonald opened this issue Dec 12, 2022 · 0 comments · Fixed by #1866
Assignees

Comments

@lachlanmcdonald
Copy link

lachlanmcdonald commented Dec 12, 2022

I've noticed an inconsistency with the way @extend treats pseudo-selectors that was introduced sometime after 1.53.0.

In version 1.53.0, the following input:

%test {
	background: yellow;

	& > :first-child {
		color: red;
	}
}

article {
	> header {
		@extend %test;
		margin: 0;
	}

	> section {
		> header {
			@extend %test;
			margin: 0;
		}
	}
}

Results in the expected output below (note the :first-child selector appearing twice)

article > section > header,
article > header {
  background: yellow;
}

article > section > header > :first-child,
article > header > :first-child {
  color: red;
}

article > header { margin: 0; }
article > section > header { margin: 0; }

Where as in versions after 1.53, the output is as follows:

article > section > header,
article > header {
  background: yellow;
}
article > header > :first-child {
  color: red;
}

article > header { margin: 0; }
article > section > header { margin: 0; }

Note that the selector article > section > header > :first-child no longer appears in the output.

I've tested this on 1.56.2, 1.55.0, and 1.54.9, on MacOS and each version produces the unexpected output. The earliest minor release I can find which does not demonstrate this issue was 1.53.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants