Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/sandbox/scoped_css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class CSSParser {
this.prefix = prefix
this.baseURI = baseURI
this.linkPath = linkPath || ''

this.matchRules()
return isFireFox() ? decodeURIComponent(this.result) : this.result
}
Expand Down Expand Up @@ -302,7 +303,14 @@ class CSSParser {
private layerRule (): boolean | void {
if (!this.commonMatch(/^@layer\s*([^{;]+)/)) return false

if (!this.matchOpenBrace()) return !!this.commonMatch(/^[;]+/)
// @layer theme, base, components, utilities; — statement form (no braces)
if (this.cssText.charAt(0) === ';') {
this.commonMatch(/^;/) // delete ;
this.matchLeadingSpaces()
return true
}

if (!this.matchOpenBrace()) return false

this.matchComments()

Expand Down