This repository was archived by the owner on Jan 18, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbadge.ftd
More file actions
319 lines (202 loc) · 5.73 KB
/
badge.ftd
File metadata and controls
319 lines (202 loc) · 5.73 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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
-- site-doc.doc-home: Badge
site-title: Bling
github-url: https://github.com/fastn-community/bling
current-package: fastn-community.github.io/bling
Badges often take the form of small shapes, such as circles, squares, or
rectangles, and they can contain text, numbers, or icons. They are commonly
used to convey information such as new messages, notifications, unread counts,
user roles or statuses, ratings, achievements, or labels.
-- site-doc.header: Examples
-- site-doc.output:
colors: $ftd.default-colors
types: $ftd.default-types
-- all-badges:
-- end: site-doc.output
-- site-doc.header: How to use
-- cb.code: Add `bling` dependency into your FASTN.ftd
lang: ftd
\-- fastn.dependency: fastn-community.github.io/bling
-- cb.code: import `badge` inside your `.ftd` file
lang: ftd
\-- import: fastn-community.github.io/bling/badge
-- cb.code: All badges: copy any one of these badges you like to use
lang: ftd
\-- badge.badge: Light
light: true
\-- badge.badge: Dark
dark: true
\-- badge.badge: Primary
primary: true
\-- badge.badge: Secondary
secondary: true
\-- badge.badge: Info
info: true
\-- badge.badge: Warning
warning: true
\-- badge.badge: Success
success: true
\-- badge.badge: Danger
danger: true
-- site-doc.header: Properties:
Below are details of all properties of `badge` component.
-- site-doc.component-property: `title`
type: Caption (`required`)
It's used to add text inside badge.
-- site-doc.component-property: `light`
type: Boolean (`optional`, default: `false`)
If you want to show badge with light background.
-- site-doc.component-property: `dark`
type: Boolean (`optional`, default: `false`)
If you want to show badge with dark background.
-- site-doc.component-property: `primary`
type: Boolean (`optional`, default: `false`)
If you want to show badge with primary background.
-- site-doc.component-property: `secondary`
type: Boolean (`optional`, default: `false`)
If you want to show badge with secondary background.
-- site-doc.component-property: `info`
type: Boolean (`optional`, default: `false`)
If you want to show badge with info background.
-- site-doc.component-property: `success`
type: Boolean (`optional`, default: `false`)
If you want to show badge with success background.
-- site-doc.component-property: `danger`
type: Boolean (`optional`, default: `false`)
If you want to show badge with danger background.
-- site-doc.component-property: `warning`
type: Boolean (`optional`, default: `false`)
If you want to show badge with warning background.
-- end: site-doc.doc-home
-- component badge:
caption title:
boolean light: false
boolean dark: false
boolean primary: false
boolean secondary: false
boolean success: false
boolean danger: false
boolean warning: false
boolean info: false
-- ftd.text: $badge.title
role: $inherited.types.fine-print
color: $inherited.colors.background.base
color if { $badge.dark }: $inherited.colors.text-strong
color if { $badge.primary }: $inherited.colors.text-strong
color if { $badge.secondary }: $inherited.colors.text-strong
color if { $badge.danger }: $inherited.colors.text-strong
color if { $badge.info }: $inherited.colors.text-strong
color if { $badge.warning }: $inherited.colors.text-strong
color if { $badge.success }: $inherited.colors.text-strong
background.solid if { $badge.light }: $inherited.colors.text
background.solid if { $badge.dark }: $inherited.colors.background.step-2
background.solid if { $badge.primary }: $inherited.colors.cta-primary.base
background.solid if { $badge.secondary }: $inherited.colors.cta-secondary.base
background.solid if { $badge.success }: $inherited.colors.success.base
background.solid if { $badge.danger }: $inherited.colors.error.base
background.solid if { $badge.warning }: $inherited.colors.warning.base
background.solid if { $badge.info }: $inherited.colors.info.base
padding-vertical.px: 6
padding-horizontal.px: 12
border-radius.px: 6
white-space: nowrap
align-self: center
margin-horizontal.px: 8
-- end: badge
-- component all-badges:
-- ftd.column:
width: fill-container
margin-bottom.px: 24
-- ftd.column:
if: { ftd.device == "mobile" }
width: fill-container
-- ftd.column:
width: fill-container
overflow-x: auto
-- ftd.row:
width: fill-container
margin-left.px: -16
-- badge: Light
light: true
-- badge: Dark
dark: true
-- badge: Primary
primary: true
-- badge: Secondary
secondary: true
-- badge: Info
info: true
-- badge: Warning
warning: true
-- badge: Success
success: true
-- badge: Danger
danger: true
-- end: ftd.row
-- end: ftd.column
-- end: ftd.column
-- ftd.column:
if: { ftd.device != "mobile" }
width: fill-container
-- ftd.row:
width: fill-container
margin-left.px: -16
-- badge: Light
light: true
-- badge: Dark
dark: true
-- badge: Primary
primary: true
-- badge: Secondary
secondary: true
-- badge: Info
info: true
-- badge: Warning
warning: true
-- badge: Success
success: true
-- badge: Danger
danger: true
-- end: ftd.row
-- end: ftd.column
-- end: ftd.column
-- end: all-badges
-- component badge-output:
optional body body:
boolean light: true
boolean dark: false
boolean primary: false
boolean secondary: false
boolean success: false
boolean danger: false
boolean warning: false
boolean info: false
-- ftd.column:
width: fill-container
-- ftd.row:
-- badge: Light
if: { $badge-output.light }
light: true
-- badge: Dark
if: { $badge-output.dark }
dark: true
-- badge: Primary
if: { $badge-output.primary }
primary: true
-- badge: Secondary
if: { $badge-output.secondary }
secondary: true
-- badge: Success
if: { $badge-output.success }
success: true
-- badge: Danger
if: { $badge-output.danger }
danger: true
-- badge: Warning
if: { $badge-output.warning }
warning: true
-- badge: Info
if: { $badge-output.info }
info: true
-- end: ftd.row
-- end: ftd.column
-- end: badge-output