-
Notifications
You must be signed in to change notification settings - Fork 0
/
grid_items.go
70 lines (56 loc) · 1.65 KB
/
grid_items.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
package compton
import (
_ "embed"
"github.com/boggydigital/compton/consts/align"
"github.com/boggydigital/compton/consts/class"
"github.com/boggydigital/compton/consts/compton_atoms"
"github.com/boggydigital/compton/consts/size"
)
type GridItemsElement struct {
*BaseElement
}
func (gie *GridItemsElement) RowGap(sz size.Size) *GridItemsElement {
gie.AddClass(class.RowGap(sz))
return gie
}
func (gie *GridItemsElement) ColumnGap(sz size.Size) *GridItemsElement {
gie.AddClass(class.ColumnGap(sz))
return gie
}
func (gie *GridItemsElement) Gap(sz size.Size) *GridItemsElement {
gie.ColumnGap(sz)
gie.RowGap(sz)
return gie
}
func (gie *GridItemsElement) AlignContent(a align.Align) *GridItemsElement {
gie.AddClass(class.AlignContent(a))
return gie
}
func (gie *GridItemsElement) AlignItems(a align.Align) *GridItemsElement {
gie.AddClass(class.AlignItems(a))
return gie
}
func (gie *GridItemsElement) JustifyContent(a align.Align) *GridItemsElement {
gie.AddClass(class.JustifyContent(a))
return gie
}
func (gie *GridItemsElement) JustifyItems(a align.Align) *GridItemsElement {
gie.AddClass(class.JustifyItems(a))
return gie
}
func (gie *GridItemsElement) GridTemplateRows(s size.Size) *GridItemsElement {
gie.AddClass(class.GridTemplateRows(s))
return gie
}
func (gie *GridItemsElement) GridTemplateRowsPixels(px float64) *GridItemsElement {
gie.AddClass(class.GridTemplateRowsPixels(px))
return gie
}
func GridItems(r Registrar) *GridItemsElement {
grid := &GridItemsElement{
BaseElement: NewElement(tacMarkup(compton_atoms.GridItems)),
}
r.RegisterStyles(DefaultStyle,
compton_atoms.StyleName(compton_atoms.GridItems))
return grid
}