@@ -92,7 +92,6 @@ extension Element {
92
92
public func border(
93
93
width: Int ? = nil ,
94
94
edges: Edge ... ,
95
- radius: ( side: RadiusSide ? , size: RadiusSize ) ? = nil ,
96
95
style: BorderStyle ? = nil ,
97
96
color: Color ? = nil ,
98
97
on modifiers: Modifier ...
@@ -104,7 +103,8 @@ extension Element {
104
103
if let width = width {
105
104
if style == . divide {
106
105
for edge in effectiveEdges {
107
- let edgePrefix = edge == . horizontal ? " x " : edge == . vertical ? " y " : " "
106
+ let edgePrefix =
107
+ edge == . horizontal ? " x " : edge == . vertical ? " y " : " "
108
108
if !edgePrefix. isEmpty {
109
109
baseClasses. append ( " divide- \( edgePrefix) - \( width) " )
110
110
}
@@ -114,7 +114,8 @@ extension Element {
114
114
contentsOf: effectiveEdges. map { edge in
115
115
let edgePrefix = edge. rawValue. isEmpty ? " " : " - \( edge. rawValue) "
116
116
return " border \( edgePrefix) \( width != 0 ? " - \( width) " : " " ) "
117
- } )
117
+ }
118
+ )
118
119
}
119
120
}
120
121
@@ -124,14 +125,8 @@ extension Element {
124
125
contentsOf: effectiveEdges. map { edge in
125
126
let edgePrefix = edge. rawValue. isEmpty ? " " : " - \( edge. rawValue) "
126
127
return " border \( edgePrefix) "
127
- } )
128
- }
129
-
130
- // Handle radius
131
- if let ( side, size) = radius {
132
- let sidePrefix = side? . rawValue ?? " "
133
- let sideClass = sidePrefix. isEmpty ? " " : " - \( sidePrefix) "
134
- baseClasses. append ( " rounded \( sideClass) - \( size. rawValue) " )
128
+ }
129
+ )
135
130
}
136
131
137
132
// Handle style
@@ -140,7 +135,8 @@ extension Element {
140
135
contentsOf: effectiveEdges. map { edge in
141
136
let edgePrefix = edge. rawValue. isEmpty ? " " : " - \( edge. rawValue) "
142
137
return " border \( edgePrefix) - \( styleValue. rawValue) "
143
- } )
138
+ }
139
+ )
144
140
}
145
141
146
142
// Handle color
@@ -162,6 +158,27 @@ extension Element {
162
158
)
163
159
}
164
160
161
+ public func rounded(
162
+ _ size: RadiusSize ,
163
+ _ edge: RadiusSide = . all,
164
+ on modifiers: Modifier ...
165
+ ) -> Element {
166
+ let sidePrefix = edge. rawValue. isEmpty ? " " : " - \( edge. rawValue) "
167
+ let baseClasses = [ " rounded \( sidePrefix) - \( size. rawValue) " ]
168
+ let newClasses = combineClasses ( baseClasses, withModifiers: modifiers)
169
+
170
+ return Element (
171
+ tag: self . tag,
172
+ id: self . id,
173
+ classes: ( self . classes ?? [ ] ) + newClasses,
174
+ role: self . role,
175
+ label: self . label,
176
+ isSelfClosing: self . isSelfClosing,
177
+ customAttributes: self . customAttributes,
178
+ content: self . contentBuilder
179
+ )
180
+ }
181
+
165
182
public func outline(
166
183
width: Int ? = nil ,
167
184
style: BorderStyle ? = nil ,
0 commit comments