aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-css-plugin/src/main/resources/org
diff options
context:
space:
mode:
Diffstat (limited to 'sonar-css-plugin/src/main/resources/org')
-rw-r--r--sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/S4649.html22
-rw-r--r--sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/S4649.json16
-rw-r--r--sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/Sonar_way_profile.json1
3 files changed, 39 insertions, 0 deletions
diff --git a/sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/S4649.html b/sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/S4649.html
new file mode 100644
index 0000000..0816eb7
--- /dev/null
+++ b/sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/S4649.html
@@ -0,0 +1,22 @@
+<p>If none of the font names defined in a <code>font</code> or <code>font-family</code> declaration are available on the browser of the user, the
+browser will display the text using its default font. It's recommended to always define a generic font family for each declaration of
+<code>font</code> or <code>font-family</code> to get a less degraded situation than relying on the default browser font. All browsers should implement
+a list of generic font matching these families: <code>Serif</code>, <code>Sans-serif</code>, <code>cursive</code>, <code>fantasy</code>,
+<code>Monospace</code>.</p>
+<h2>Noncompliant Code Example</h2>
+<pre>
+a {
+ font-family: Helvetica, Arial, Verdana, Tahoma;
+}
+</pre>
+<h2>Compliant Solution</h2>
+<pre>
+a {
+ font-family: Helvetica, Arial, Verdana, Tahoma, sans-serif;
+}
+</pre>
+<h2>See</h2>
+<ul>
+ <li> https://www.w3.org/TR/CSS2/fonts.html#generic-font-families </li>
+</ul>
+
diff --git a/sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/S4649.json b/sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/S4649.json
new file mode 100644
index 0000000..eb427fa
--- /dev/null
+++ b/sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/S4649.json
@@ -0,0 +1,16 @@
+{
+ "title": "Font declarations should contain at least one generic font family",
+ "type": "BUG",
+ "status": "ready",
+ "remediation": {
+ "func": "Constant\/Issue",
+ "constantCost": "1min"
+ },
+ "tags": [
+
+ ],
+ "defaultSeverity": "Major",
+ "ruleSpecification": "RSPEC-4649",
+ "sqKey": "S4649",
+ "scope": "Main"
+}
diff --git a/sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/Sonar_way_profile.json b/sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/Sonar_way_profile.json
index 4455af6..5fb55c0 100644
--- a/sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/Sonar_way_profile.json
+++ b/sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/Sonar_way_profile.json
@@ -3,6 +3,7 @@
"ruleKeys": [
"S1128",
"S4647",
+ "S4649",
"S4652",
"S4653",
"S4655",