-
Notifications
You must be signed in to change notification settings - Fork 0
/
style.go
41 lines (27 loc) · 1.05 KB
/
style.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//go:build js && wasm
package js
type Style Value
// -----------------------------------------------------------------------------
func (s Style) JSValue() Value {
return Value(s)
}
// -----------------------------------------------------------------------------
func (s Style) GetPropertyValue(name string) string {
return Value(s).Call("getPropertyValue", name).String()
}
// -----------------------------------------------------------------------------
func (s Style) RemoveProperty(name string) string {
return Value(s).Call("removeProperty", name).String()
}
// -----------------------------------------------------------------------------
func (s Style) SetProperty(name, value string) {
Value(s).Call("setProperty", name, value)
}
// -----------------------------------------------------------------------------
func (s Style) Length() int {
return Value(s).Get("length").Int()
}
// -----------------------------------------------------------------------------
func (s Style) Item(idx int) string {
return Value(s).Call("item", idx).String()
}