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

Attribute selector with class-like content paired with @extend generates invalid CSS #605

Open
max-m opened this issue Aug 9, 2022 · 0 comments
Labels
bug Something isn't working spec compliance Issues with compliance to the Sass spec
Milestone

Comments

@max-m
Copy link
Contributor

max-m commented Aug 9, 2022

The following input generates some broken output.
Tested on version 1.10.5.

Input:

[data-foo='something.data.like'] {
	&[data-show='true'] {
		color: red;
	}
}

[data-foo='something.other.like'] {
	@extend %my-test-class;
}

%my-test-class {
	&[data-show='true'] {
		position: fixed;
	}
}

/////////////////////////////////////////////////////////////////////////////

[data-foo='this-works'] {
	@extend %my-other-class;
}

%my-other-class {
	&[data-show='true'] {
		position: fixed;
	}
}

Output:

[data-foo="something.data.like"][data-show="true"] {
  color: red;
}
data-foo="something.other.like"][[data-show="true"] {
  position: fixed;
}
[data-foo="this-works"][data-show="true"] {
  position: fixed;
}

As you can see, the opening bracket in line 4 got placed after the corresponding closing one.

@stof stof added bug Something isn't working spec compliance Issues with compliance to the Sass spec labels Aug 13, 2022
@stof stof added this to the 2.0 milestone Aug 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working spec compliance Issues with compliance to the Sass spec
Projects
None yet
Development

No branches or pull requests

2 participants