-
-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Open
Labels
Milestone
Description
Reference: https://discourse.gohugo.io/t/54483/2
The specific failing example from the topic above is:
@import "path" layer(layer-name);But per MDN all of these are valid:
@import url;
@import url layer;
@import url layer(layer-name);
@import url layer(layer-name) supports(supports-condition);
@import url layer(layer-name) supports(supports-condition) list-of-media-queries;
@import url layer(layer-name) list-of-media-queries;
@import url supports(supports-condition);
@import url supports(supports-condition) list-of-media-queries;
@import url list-of-media-queries;Where url can take the form "path" or url("something");, using either single or double quotes.
It seems like we should extract the path starting with the first single- or double quote, and ending with the next singe- or double-quote, ignoring the form url("something");.
| shouldImportRe = regexp.MustCompile(`^@import ["'](.*?)["'];?\s*(/\*.*\*/)?$`) |
| path := strings.Trim(strings.TrimPrefix(line, importIdentifier), " \"';") |