@-moz-document url-prefix() {} not parsed correctly #6

Closed
opened 2025-05-02 10:21:54 +02:00 by christophsanz · 1 comment
christophsanz commented 2025-05-02 10:21:54 +02:00 (Migrated from github.com)

I stumbled across this using picoCSS which has the following rule in it:

@-moz-document url-prefix() {
  [type='date'],
  [type='datetime-local'],
  [type='month'],
  [type='time'],
  [type='week'] {
    padding-right: var(--pico-form-element-spacing-horizontal) !important;
    background-image: none !important;
  }
}

@-moz-doucment url-prefix() is apparently used as a workaround to apply styles only to firefox.

If i add something within the parenthesis it is parsed correctly again, so i guess it just needs a | "" in the grammar file to allow an empty function there? I am unfortunately to unfamiliar with .grammar files to be confident enough to create a PR.

Thanks to anyone who can look at this. :)

I stumbled across this using picoCSS which has the following rule in it: ``` @-moz-document url-prefix() { [type='date'], [type='datetime-local'], [type='month'], [type='time'], [type='week'] { padding-right: var(--pico-form-element-spacing-horizontal) !important; background-image: none !important; } } ``` `@-moz-doucment url-prefix()` is apparently used as a workaround to apply styles only to firefox. If i add something within the parenthesis it is parsed correctly again, so i guess it just needs a `| ""` in the grammar file to allow an empty function there? I am unfortunately to unfamiliar with .grammar files to be confident enough to create a PR. Thanks to anyone who can look at this. :)
marijnh commented 2025-05-02 15:05:08 +02:00 (Migrated from github.com)

Given how many of them there are, I'm not currently supporting unstable or prefixed features unless they are widely used.

This fails to parse in a bunch of ways beyond just the missing url-prefix argument, but with attached patch the highlighting seems to mostly work.

Given how many of them there are, I'm not currently supporting unstable or prefixed features unless they are widely used. This fails to parse in a bunch of ways beyond just the missing `url-prefix` argument, but with attached patch the highlighting seems to mostly work.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lezer/sass#6
No description provided.