-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
size.go
109 lines (91 loc) · 1.49 KB
/
size.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
package types
import "strconv"
// Extra small screen / phone
// xs: 0
// Small screen / phone
// sm: 576px
// Medium screen / tablet
// md: 768px
// Large screen / desktop
// lg: 992px
// Extra large screen / wide desktop
// xl: 1200px
type S map[string]string
func Size(sm, md, lg int) S {
var s = make(S)
if sm > 0 && sm < 13 {
s["sm"] = strconv.Itoa(sm)
}
if md > 0 && md < 13 {
s["md"] = strconv.Itoa(md)
}
if lg > 0 && lg < 13 {
s["lg"] = strconv.Itoa(lg)
}
return s
}
func (s S) LG(lg int) S {
if lg > 0 && lg < 13 {
s["lg"] = strconv.Itoa(lg)
}
return s
}
func (s S) XS(xs int) S {
if xs > 0 && xs < 13 {
s["xs"] = strconv.Itoa(xs)
}
return s
}
func (s S) XL(xl int) S {
if xl > 0 && xl < 13 {
s["xl"] = strconv.Itoa(xl)
}
return s
}
func (s S) SM(sm int) S {
if sm > 0 && sm < 13 {
s["sm"] = strconv.Itoa(sm)
}
return s
}
func (s S) MD(md int) S {
if md > 0 && md < 13 {
s["md"] = strconv.Itoa(md)
}
return s
}
func SizeXS(xs int) S {
var s = make(S)
if xs > 0 && xs < 13 {
s["xs"] = strconv.Itoa(xs)
}
return s
}
func SizeXL(xl int) S {
var s = make(S)
if xl > 0 && xl < 13 {
s["xl"] = strconv.Itoa(xl)
}
return s
}
func SizeSM(sm int) S {
var s = make(S)
if sm > 0 && sm < 13 {
s["sm"] = strconv.Itoa(sm)
}
return s
}
func SizeMD(md int) S {
var s = make(S)
if md > 0 && md < 13 {
s["md"] = strconv.Itoa(md)
}
return s
}
func SizeLG(lg int) S {
var s = make(S)
if lg > 0 && lg < 13 {
s["lg"] = strconv.Itoa(lg)
}
return s
}