rspec/rules/S4656/css/rule.adoc

62 lines
962 B
Plaintext
Raw Normal View History

== Why is this an issue?
2021-04-28 16:49:39 +02:00
CSS allows duplicate property names but only the last instance of a duplicated name determines the actual value that will be used for it. Therefore, changing values of other occurrences of a duplicated name will have no effect and may cause misunderstandings and bugs.
This rule ignores ``++$sass++``, ``++@less++``, and ``++var(--custom-property)++`` variable syntaxes.
=== Noncompliant code example
2021-04-28 16:49:39 +02:00
2022-02-04 17:28:24 +01:00
[source,css]
2021-04-28 16:49:39 +02:00
----
a {
color: pink;
background: orange;
color: orange
}
----
=== Compliant solution
2021-04-28 16:49:39 +02:00
2022-02-04 17:28:24 +01:00
[source,css]
2021-04-28 16:49:39 +02:00
----
a {
color: pink;
background: orange
}
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
=== Message
Remove XXX, it is duplicated.
=== Parameters
.ignoreFallbacks
****
----
true
----
Ignore consecutive duplicated properties with different values.
****
=== Highlighting
The duplicated property
endif::env-github,rspecator-view[]