We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 12bb905 commit 9a4caa4Copy full SHA for 9a4caa4
Sources/SwiftHtml/Html/Attributes/Global.swift
@@ -38,10 +38,12 @@ public extension Tag {
38
node.upsert(Attribute(key: "accesskey", value: String(value)))
39
return self
40
}
41
-
+
42
/// Specifies one classname for an element (refers to a class in a style sheet)
43
- func `class`(_ value: String) -> Self {
44
- node.upsert(Attribute(key: "class", value: value))
+ func `class`(_ value: String, _ condition: Bool = true) -> Self {
+ if condition {
45
+ node.upsert(Attribute(key: "class", value: value))
46
+ }
47
48
49
0 commit comments