Added font weight values

pull/178/head
M66B 5 years ago
parent 5202ae93f5
commit 38fac8fb25

@ -559,7 +559,6 @@ public class HtmlHelper {
break; break;
case "font-weight": case "font-weight":
// https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight
if (element.parent() != null) { if (element.parent() != null) {
Integer fweight = getFontWeight(value); Integer fweight = getFontWeight(value);
if (fweight != null && fweight >= 600) { if (fweight != null && fweight >= 600) {
@ -1040,12 +1039,15 @@ public class HtmlHelper {
} }
private static Integer getFontWeight(String value) { private static Integer getFontWeight(String value) {
// https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight
if (TextUtils.isEmpty(value)) if (TextUtils.isEmpty(value))
return null; return null;
value = value.toLowerCase(Locale.ROOT).trim(); value = value.toLowerCase(Locale.ROOT).trim();
switch (value) { switch (value) {
case "thin":
return 100;
case "light": case "light":
case "lighter": case "lighter":
return 300; return 300;
@ -1057,7 +1059,11 @@ public class HtmlHelper {
return 600; return 600;
case "bold": case "bold":
return 700; return 700;
case "heavy":
return 900;
case "none": case "none":
case "auto":
case "initial":
case "inherit": case "inherit":
return null; return null;
} }
@ -1077,6 +1083,7 @@ public class HtmlHelper {
return null; return null;
if (value.contains("calc") || if (value.contains("calc") ||
"none".equals(value) ||
"auto".equals(value) || "auto".equals(value) ||
"initial".equals(value) || "initial".equals(value) ||
"inherit".equals(value)) "inherit".equals(value))

Loading…
Cancel
Save