Reduce `attributes` function line length in `Text`

This commit is contained in:
Max Desiatov 2020-08-05 10:05:26 +01:00
parent 7ab7178004
commit 04d91aa717
No known key found for this signature in database
GPG Key ID: FE08EBF9CF58CBA2
1 changed files with 1 additions and 7 deletions

View File

@ -169,13 +169,7 @@ extension Text {
return [ return [
"style": """ "style": """
\(font?.styles.filter { \(font?.styles.filter { weight != nil ? $0.key != "font-weight" : true }.inlineStyles ?? "")
if weight != nil {
return $0.key != "font-weight"
} else {
return true
}
}.inlineStyles ?? "")
\(font == nil ? "font-family: \(Font.Design.default.description);" : "") \(font == nil ? "font-family: \(Font.Design.default.description);" : "")
color: \((color ?? .primary).cssValue(environment)); color: \((color ?? .primary).cssValue(environment));
font-style: \(italic ? "italic" : "normal"); font-style: \(italic ? "italic" : "normal");