Vijaya Pandey
Vijaya Pandey

Reputation: 4282

How to fix sonar issue for "Property value should be valid":

When I perform the sonar scan on my project, it says Property value should be valid for the following lines of code:

HR {
  color: 3c78b5;
  height: 1;
}

For color: 3c78b5;

It recommends:  

Update the invalid value of property "color". Expected format: <color>  

And for height: 1;

it recommends:

Update the invalid value of property "height". Expected format: auto | <length> | <percentage> | fill | max-content | min-content | fit-content 

But, I don't think we can apply those recommendations to fix this. Any ideas?

Upvotes: 1

Views: 785

Answers (2)

Vijaya Pandey
Vijaya Pandey

Reputation: 4282

Fixed it this way as @takendarkk said in the comment section of the question:

HR {
  color: #3c78b5;
  height: 1px;
}

Upvotes: 1

Johnnei
Johnnei

Reputation: 588

Your color property is not in the valid format for hex values. See MDN CSS Color.

Your height property is not listing a unit. See MDN CSS Height and MDN CSS Length.

So yes you can conform to the listed solutions. Your browser(s) might give the correct output but it can't do anything else but assume what you meant in the CSS as they do not conform the rules.

Upvotes: 2

Related Questions