-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix warnings about top-level css nesting
- Loading branch information
Showing
3 changed files
with
85 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -700,30 +700,34 @@ func TestCSSExternalQueryAndHashMatchIssue1822(t *testing.T) { | |
func TestCSSNestingOldBrowser(t *testing.T) { | ||
css_suite.expectBundled(t, bundled{ | ||
files: map[string]string{ | ||
"/[email protected]": `a { @layer base { color: red; } }`, | ||
"/[email protected]": `a { @media screen { color: red; } }`, | ||
"/nested-ampersand.css": `a { &, & { color: red; } }`, | ||
"/nested-attribute.css": `a { [href] { color: red; } }`, | ||
"/nested-colon.css": `a { :hover { color: red; } }`, | ||
"/nested-dot.css": `a { .cls { color: red; } }`, | ||
"/nested-greaterthan.css": `a { > b { color: red; } }`, | ||
"/nested-hash.css": `a { #id { color: red; } }`, | ||
"/nested-plus.css": `a { + b { color: red; } }`, | ||
"/nested-tilde.css": `a { ~ b { color: red; } }`, | ||
|
||
"/toplevel-ampersand.css": `a { &, & { color: red; } }`, | ||
"/toplevel-attribute.css": `a { [href] { color: red; } }`, | ||
"/toplevel-colon.css": `a { :hover { color: red; } }`, | ||
"/toplevel-dot.css": `a { .cls { color: red; } }`, | ||
"/toplevel-greaterthan.css": `a { > b { color: red; } }`, | ||
"/toplevel-hash.css": `a { #id { color: red; } }`, | ||
"/toplevel-plus.css": `a { + b { color: red; } }`, | ||
"/toplevel-tilde.css": `a { ~ b { color: red; } }`, | ||
"/[email protected]": `a { @layer base { color: red; } }`, | ||
"/[email protected]": `a { @media screen { color: red; } }`, | ||
"/nested-ampersand-twice.css": `a { &, & { color: red; } }`, | ||
"/nested-ampersand-first.css": `a { &, b { color: red; } }`, | ||
"/nested-attribute.css": `a { [href] { color: red; } }`, | ||
"/nested-colon.css": `a { :hover { color: red; } }`, | ||
"/nested-dot.css": `a { .cls { color: red; } }`, | ||
"/nested-greaterthan.css": `a { > b { color: red; } }`, | ||
"/nested-hash.css": `a { #id { color: red; } }`, | ||
"/nested-plus.css": `a { + b { color: red; } }`, | ||
"/nested-tilde.css": `a { ~ b { color: red; } }`, | ||
|
||
"/toplevel-ampersand-twice.css": `&, & { color: red; }`, | ||
"/toplevel-ampersand-first.css": `&, a { color: red; }`, | ||
"/toplevel-ampersand-second.css": `a, & { color: red; }`, | ||
"/toplevel-attribute.css": `[href] { color: red; }`, | ||
"/toplevel-colon.css": `:hover { color: red; }`, | ||
"/toplevel-dot.css": `.cls { color: red; }`, | ||
"/toplevel-greaterthan.css": `> b { color: red; }`, | ||
"/toplevel-hash.css": `#id { color: red; }`, | ||
"/toplevel-plus.css": `+ b { color: red; }`, | ||
"/toplevel-tilde.css": `~ b { color: red; }`, | ||
}, | ||
entryPaths: []string{ | ||
"/[email protected]", | ||
"/[email protected]", | ||
"/nested-ampersand.css", | ||
"/nested-ampersand-twice.css", | ||
"/nested-ampersand-first.css", | ||
"/nested-attribute.css", | ||
"/nested-colon.css", | ||
"/nested-dot.css", | ||
|
@@ -732,7 +736,9 @@ func TestCSSNestingOldBrowser(t *testing.T) { | |
"/nested-plus.css", | ||
"/nested-tilde.css", | ||
|
||
"/toplevel-ampersand.css", | ||
"/toplevel-ampersand-twice.css", | ||
"/toplevel-ampersand-first.css", | ||
"/toplevel-ampersand-second.css", | ||
"/toplevel-attribute.css", | ||
"/toplevel-colon.css", | ||
"/toplevel-dot.css", | ||
|
@@ -749,20 +755,20 @@ func TestCSSNestingOldBrowser(t *testing.T) { | |
}, | ||
expectedScanLog: `[email protected]: WARNING: CSS nesting syntax is not supported in the configured target environment (chrome10) | ||
[email protected]: WARNING: CSS nesting syntax is not supported in the configured target environment (chrome10) | ||
nested-ampersand.css: WARNING: CSS nesting syntax is not supported in the configured target environment (chrome10) | ||
nested-ampersand-first.css: WARNING: CSS nesting syntax is not supported in the configured target environment (chrome10) | ||
nested-ampersand-twice.css: WARNING: CSS nesting syntax is not supported in the configured target environment (chrome10) | ||
nested-attribute.css: WARNING: CSS nesting syntax is not supported in the configured target environment (chrome10) | ||
nested-colon.css: WARNING: CSS nesting syntax is not supported in the configured target environment (chrome10) | ||
nested-dot.css: WARNING: CSS nesting syntax is not supported in the configured target environment (chrome10) | ||
nested-greaterthan.css: WARNING: CSS nesting syntax is not supported in the configured target environment (chrome10) | ||
nested-hash.css: WARNING: CSS nesting syntax is not supported in the configured target environment (chrome10) | ||
nested-plus.css: WARNING: CSS nesting syntax is not supported in the configured target environment (chrome10) | ||
nested-tilde.css: WARNING: CSS nesting syntax is not supported in the configured target environment (chrome10) | ||
toplevel-ampersand.css: WARNING: CSS nesting syntax is not supported in the configured target environment (chrome10) | ||
toplevel-attribute.css: WARNING: CSS nesting syntax is not supported in the configured target environment (chrome10) | ||
toplevel-colon.css: WARNING: CSS nesting syntax is not supported in the configured target environment (chrome10) | ||
toplevel-dot.css: WARNING: CSS nesting syntax is not supported in the configured target environment (chrome10) | ||
toplevel-ampersand-first.css: WARNING: CSS nesting syntax is not supported in the configured target environment (chrome10) | ||
toplevel-ampersand-second.css: WARNING: CSS nesting syntax is not supported in the configured target environment (chrome10) | ||
toplevel-ampersand-twice.css: WARNING: CSS nesting syntax is not supported in the configured target environment (chrome10) | ||
toplevel-ampersand-twice.css: WARNING: CSS nesting syntax is not supported in the configured target environment (chrome10) | ||
toplevel-greaterthan.css: WARNING: CSS nesting syntax is not supported in the configured target environment (chrome10) | ||
toplevel-hash.css: WARNING: CSS nesting syntax is not supported in the configured target environment (chrome10) | ||
toplevel-plus.css: WARNING: CSS nesting syntax is not supported in the configured target environment (chrome10) | ||
toplevel-tilde.css: WARNING: CSS nesting syntax is not supported in the configured target environment (chrome10) | ||
`, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters