* Add a class to the element
(className: string | string[])
| 279 | * Add a class to the element |
| 280 | */ |
| 281 | addClass(className: string | string[]): this { |
| 282 | if (Array.isArray(className)) { |
| 283 | this.native.classList.add(...className); |
| 284 | } else { |
| 285 | if (className.includes(" ")) { |
| 286 | return this.addClass( |
| 287 | className.split(" ").filter((cn) => cn.length > 0), |
| 288 | ); |
| 289 | } |
| 290 | this.native.classList.add(className); |
| 291 | } |
| 292 | return this; |
| 293 | } |
| 294 | |
| 295 | /** |
| 296 | * Remove a class from the element |
no test coverage detected