rspec/rules/S4648/css/rule.adoc

35 lines
848 B
Plaintext
Raw Permalink Normal View History

== Why is this an issue?
2021-04-28 16:49:39 +02:00
Having duplicated font names doesn't help to read the font declaration and may be an indicator the author of the line was not sure how to configure it. This rule raises an issue when ``++font++`` or ``++font-family++`` properties contain a duplicated font name. 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 {
font-family: 'Georgia', Georgia, serif; /* Noncompliant; 'Georgia' is duplicated */
}
----
=== 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 {
font-family: Georgia, serif;
}
----
ifdef::env-github,rspecator-view[]
'''
== Comments And Links
(visible only on this page)
=== on 4 Jun 2018, 09:28:45 Ann Campbell wrote:
\[~alexandre.gigleux], there's no "why" here.
endif::env-github,rspecator-view[]