Skip to content

CSS Logical Media Query error #8324

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

Closed
NazCodeland opened this issue Feb 25, 2023 · 1 comment
Closed

CSS Logical Media Query error #8324

NazCodeland opened this issue Feb 25, 2023 · 1 comment

Comments

@NazCodeland
Copy link

NazCodeland commented Feb 25, 2023

Describe the bug

Within my style tag in a component.svelte page, logical media query is throwing an error.

Reproduction

<!-- taken from MDN -->
<article class="forecast">
	<h1>Weather forecast for Seattle</h1>
	<article class="day-forecast">
			<h2>03 March 2018</h2>
			<p>Rain.</p>
	</article>
	<article class="day-forecast">
			<h2>04 March 2018</h2>
			<p>Periods of rain.</p>
	</article>
	<article class="day-forecast">
			<h2>05 March 2018</h2>
			<p>Heavy rain.</p>
	</article>
</article>
<style>
@media (width >= 53rem) {
  .forecast {
	background-color: rebeccapurple;
    }
}
</style>
  • I am not using any preprocessors

Logs

ERROR being shown in VSC:

Colon is expected

If you expect this syntax to work, here are some suggestions: 
If you use less/SCSS with `svelte-preprocess`, did you add `lang="scss"`/`lang="less"` to your `style` tag? If you use SCSS, it may be necessary to add the path to your NODE runtime to the setting `svelte.language-server.runtime`, or use `sass` instead of `node-sass`. 
Did you setup a `svelte.config.js`? 
See https://github.com/sveltejs/language-tools/tree/master/docs#using-with-preprocessors for more info.svelte(css-syntax-error)

System Info

System:
    OS: Windows 10 10.0.22621
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 6.43 GB / 15.85 GB
  Binaries:
    Node: 19.1.0 - C:\Program Files\nodejs\node.EXE
    npm: 9.2.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Spartan (44.22621.1265.0), Chromium (110.0.1587.50)
    Internet Explorer: 11.0.22621.1

Severity

annoyance

@typhonrt
Copy link
Contributor

typhonrt commented Apr 12, 2023

Greets @NazCodeland.

This will work in the next Svelte release as modern media query syntax including range queries is addressed by this PR: #8430.

Also a FYI Svelte 3.58.0 properly supports container queries.

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

No branches or pull requests

2 participants