MCPcopy
hub / github.com/matthewhudson/current-device / addClass

Function addClass

src/index.ts:113–119  ·  view source on GitHub ↗
(className: string)

Source from the content-addressed store, hash-verified

111
112// Add one or more CSS classes to the <html> element.
113function addClass(className: string): void {
114 let currentClassNames: string | null = null
115 if (!hasClass(className)) {
116 currentClassNames = documentElement.className.replace(/^\s+|\s+$/g, '')
117 documentElement.className = `${currentClassNames} ${className}`
118 }
119}
120
121// Remove single CSS class from the <html> element.
122function removeClass(className: string): void {

Callers 2

index.tsFile · 0.85
handleOrientationFunction · 0.85

Calls 1

hasClassFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…