-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcss.default.go
More file actions
134 lines (131 loc) · 3.01 KB
/
Copy pathcss.default.go
File metadata and controls
134 lines (131 loc) · 3.01 KB
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
//go:build !wasm
package css
// themeGroupDecls declares the adaptive theme colors plus, for every theme
// pair among them, the plain light/dark halves declareSplit needs — see
// Token.EnhancedVar for why widget/style reads those instead of the
// light-dark()-valued properties declared here.
func themeGroupDecls() []decl {
decls := []decl{
declare(ColorBackground),
declare(ColorOnBackground),
declare(ColorSurface),
declare(ColorOnSurface),
declare(ColorOutline),
declare(ColorMuted),
declare(ColorSurfaceSunken),
declare(ColorSelection),
declare(ColorOnSelection),
declare(ColorAccentWash),
declare(ColorAccentHover),
}
for _, t := range []Token{ColorBackground, ColorOnBackground, ColorSurface, ColorOnSurface, ColorOutline, ColorMuted} {
decls = append(decls, declareSplit(t)...)
}
return decls
}
// defaultRoots declares every token group that is not brand identity: the
// adaptive theme surface colors plus the typography, spacing, radius,
// shadow, motion, z-index, breakpoint, and layout scales. These are the
// tokens an app inherits as-is; only brandRoot() is meant to be reskinned.
func defaultRoots() []item {
return []item{
root(themeGroupDecls()...),
root(
// Interaction intensities
declare(MixHover),
declare(MixFocus),
declare(MixPress),
),
root(
// Typography scale
declare(TextXs),
declare(TextSm),
declare(TextBase),
declare(TextLg),
declare(TextXl),
declare(Text2xl),
),
root(
// Spacing scale
declare(Space0),
declare(Space1),
declare(Space2),
declare(Space3),
declare(Space4),
declare(Space6),
declare(Space8),
declare(Space12),
),
root(
// Border-radius scale
declare(RadiusSm),
declare(RadiusMd),
declare(RadiusLg),
declare(RadiusFull),
),
root(
// Typography
declare(FontSans),
declare(LeadingNormal),
declare(FontWeightRegular),
declare(FontWeightMedium),
declare(FontWeightBold),
),
root(
// Elevation
declare(ShadowSm),
declare(ShadowMd),
declare(ShadowLg),
),
root(
// Motion
declare(DurationFast),
declare(DurationBase),
declare(DurationSlow),
declare(EaseInOut),
),
root(
// Z-index
declare(ZBase),
declare(ZDropdown),
declare(ZSticky),
declare(ZModal),
declare(ZToast),
declare(ZTooltip),
),
root(
// Breakpoints
declare(BpSm),
declare(BpMd),
declare(BpLg),
declare(BpXl),
),
root(
// Container widths
declare(MaxWReadable),
),
root(
// Grid columns
declare(ColumnNarrow),
declare(ColumnMedium),
declare(ColumnWide),
// Rail widths
declare(RailNarrow),
declare(RailWide),
// Shared control height and chip size
declare(ControlHeight),
declare(ChipWidth),
declare(ChipHeight),
declare(VeilBlur),
),
root(
// Device geometry — insets reported by the device, and the viewport
// height that shrinks with Safari iOS' collapsing URL bar.
declare(SafeTop),
declare(SafeRight),
declare(SafeBottom),
declare(SafeLeft),
declare(ViewportH),
),
}
}