0

Am trying to add the rule for the background-image URL should start with images

background-image: url(ssasimages/dummy.svg);

Please find below the screenshot FYR.

It's not giving error, please someone help me to find what did wrong.

enter image description here

tamilmani
  • 591
  • 6
  • 13

1 Answers1

1

The rule unfortunately doesn't apply in your case.

It will only validate the url scheme, and not the whole url. If your url started with data:, or http: then the rule would be applied.

From the docs for the function-url-scheme-whitelist rule:

A URL scheme consists of alphanumeric, +, -, and . characters. It can appear at the start of a URL and is followed by :.

To get your desired functionality in stylelint you'd need to write a plugin. You could use the source of the function-url-scheme-whitelist rule as a good starting point.

tekniskt
  • 483
  • 3
  • 10
  • Hey @tekniskt thanks for your info. should I raise PR for this after write plugin? – tamilmani Sep 04 '20 at 11:04
  • Already raised PR for this https://github.com/stylelint/stylelint/pull/4816 and as you said end of the PR they need to write a plugin for my use case. Can u pls help me how could i take this into plugin. – tamilmani Sep 04 '20 at 11:20