Skip to content

Fix function-url-quotes false positives when URLs have modifiers #8545

@romainmenke

Description

@romainmenke

What minimal example or steps are needed to reproduce the bug?

a {
	background: url( 'foo.svg' crossorigin(anonymous) );
}

What minimal configuration is needed to reproduce the bug?

{
  "rules": {
    "function-url-quotes": "never"
  }
}

How did you run Stylelint?

Demo

Which Stylelint-related dependencies are you using?

{
  "stylelint": "latest",
  "stylelint-config-standard": "latest"
}

What did you expect to happen?

No problems to be reported

What actually happened?

The following was reported:

2:19-52 error Unexpected quotes around "url" function argument (function-url-quotes)

Do you have a proposal to fix the bug?

The url token (url( foo.svg ) without quotes) does not support url modifiers.
While the url function (url( 'foo.svg' ) with quotes) does support these.

Stylelint should not report issues or try to fix url functions that contain url modifiers.

Relevant specs:

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: wipis being worked on by someone

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions