stylus icon indicating copy to clipboard operation
stylus copied to clipboard

[Bug] Applying on all pages when using `@preprocessor stylus`

Open zenstorage opened this issue 1 year ago • 10 comments

Bug Report

Bug Description

When using the Stylus preprocessor with nested Media Queries, the styles are applied to all pages.

Screenshots

image

example.net: image

example.com: image

CSS Code

/* ==UserStyle==
@name           example.com
@namespace      github.com/openstyles/stylus
@version        1.0.0
@description    A new userstyle
@author         Me
@preprocessor   stylus
==/UserStyle== */

@-moz-document domain("example.com") {
        /* Only in example.com */
	h1 {
		border: 3px solid yellow;
	}
	
	@media (min-width: 600px) {
		/* Only in example.com */
		p {
			border: 3px solid blueviolet;
		}
		@media (min-height: 600px) {
			/* Styles above are applied to all pages */
			* {
				border: 3px solid red;
			}
		}
	}
}

System Information

  • OS: Windows
  • Browser: Firefox 130
  • Stylus Version: 1.5.51

Additional Context

zenstorage avatar Sep 12 '24 02:09 zenstorage