-
-
Notifications
You must be signed in to change notification settings - Fork 357
/
ui.go
62 lines (46 loc) · 1.13 KB
/
ui.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
// Package ui provides a set of components to organize an application layout.
package ui
import (
"strconv"
)
var (
// The padding of block-like components in px.
BlockPadding = 30
// The padding of block-like components in px when app width is <= 480px.
BlockMobilePadding = 18
// The content width of block-like components in px.
BlockContentWidth = 580
// The horizontal padding of base-like components in px.
BaseHPadding = 36
// The horizontal padding of base-like components in px when app width is <= 480px.
BaseMobileHPadding = 12
// The horizontal padding of base-like ad components in px.
BaseAdHPadding = BaseHPadding / 2
// The vertical padding of base-like components in px.
BaseVPadding = 12
// The default icon size in px.
DefaultIconSize = 24
// The default icon space.
DefaultIconSpace = 6
// The default width for flow items in px.
DefaultFlowItemWidth = 372
)
const (
defaultHeaderHeight = 90
)
func pxToString(px int) string {
return strconv.Itoa(px) + "px"
}
type alignment int
const (
stretch alignment = iota
top
right
bottom
left
middle
)
type style struct {
key string
value string
}