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

[scss] support interpolation in layer name #180631

Closed
ngdangtu-vn opened this issue Apr 23, 2023 · 8 comments · Fixed by microsoft/vscode-css-languageservice#370 or microsoft/vscode-css-languageservice#371
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug css-less-scss Issues and items concerning CSS,Less,SCSS styling verified Verification succeeded
Milestone

Comments

@ngdangtu-vn
Copy link

This feature request is about new CSS at-rule call @layer. This at-rule can be considerate available for public since it is very close to 90% supported browsers. But the current vscode 1.77.3 doesn't support @layer keyword and constantly fire error every time I use it.

Language that needs to support this feature: CSS, SASS/SCSS, LESS

@gjsjohnmurray
Copy link
Contributor

#161842 implies this should already be handled. Please check its related issues, and also that extensions you may be using are up to date.

@ngdangtu-vn
Copy link
Author

ngdangtu-vn commented Apr 23, 2023

Screenshot_20230423_133826

I don't think I use any extensions that affect syntax highlight. Could it be because I'm using Linux?

Just double check on plain CSS, it works now. But for SCSS it doesn't. Can I ask for SCSS support in here since it also got native support from vscode?

It also fire error on SCSS variable when I typing. It can only disappear if I close the tab and reopen it.

@aeschli
Copy link
Contributor

aeschli commented Apr 25, 2023

@ngdangtu-vn Please paste the small code sample that doesn't work.

@ngdangtu-vn
Copy link
Author

Sure

/**
 * Cascade Threshold
 */
@mixin module-on($min-width, $layer, $selector)
{
	@layer #{$layer}
	{
		@media screen and (min-width: #{$min-width})
		{
			#{$selector}
			{
				@content;
			}
		}
	}
}
@import 'https://fonts.googleapis.com/css2?family=Cinzel+Decorative:wght@400;700&display=swap' layer(font);

All the error underlines in those code above will display once you modify the code file. If you save it and close then reopen, the error will disappear. (Of course it appears in the Problems panel too)

@aeschli aeschli changed the title Support CSS @layer syntax [scss] support interpolation in layer name Apr 26, 2023
@aeschli aeschli added css-less-scss Issues and items concerning CSS,Less,SCSS styling bug Issue identified by VS Code Team member as probable bug labels Apr 26, 2023
@aeschli aeschli added this to the Backlog milestone Apr 26, 2023
@Alexand3r
Copy link

Here's a more simple reproducible example where it throws this error with the @layer in .scss files (.css files have no issues)

@layer bootstrap;
@import url('bootstrap/scss/bootstrap.scss') layer(bootstrap);

{ expectedscss(css-lcurlyexpected)

image

@aeschli
Copy link
Contributor

aeschli commented Nov 7, 2023

Fixed by microsoft/vscode-css-languageservice#370

@TylerLeonhardt
Copy link
Member

No longer errors, verified ✅

@layer in

@layer bootstrap;
@import url('bootstrap/scss/bootstrap.scss') layer(bootstrap);

not being highlighted seems like a syntax highlighting issue...

I'll open a new issue for that.

@justschen
Copy link
Contributor

@aeschli was this accidentally reopened? deferring to microsoft/vscode-css#24 and closing this one on this milestone

@github-actions github-actions bot locked and limited conversation to collaborators Jan 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug css-less-scss Issues and items concerning CSS,Less,SCSS styling verified Verification succeeded
Projects
None yet
6 participants