rspec/rules/S4653/css/rule.adoc
Fred Tingaud 16f6c0aecf
Inline adoc when include has no additional value (#1940)
Inline adoc files when they are included exactly once.

Also fix language tags because this inlining gives us better information
on what language the code is written in.
2023-05-25 14:18:12 +02:00

45 lines
776 B
Plaintext

== Why is this an issue?
The W3C specifications define the ``++units++`` that can be used with lengths. A unit that is not part of the list of supported ones is likely to be a typo and will be seen as a UI bug by the user.
This rule raises an issue each time a unit is not officially supported.
=== Noncompliant code example
[source,css]
----
a {
width: 10pixels; /* Noncompliant; "pixels" is not a valid unit */
}
----
=== Compliant solution
[source,css]
----
a {
width: 10px;
}
----
== Resources
* https://www.w3.org/TR/css3-values/#lengths[CSS Specification] - Distance units
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
=== Message
Replace XXX by a valid unit.
endif::env-github,rspecator-view[]