This repository was archived by the owner on Nov 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathdesign-system.ftd
More file actions
522 lines (330 loc) · 13.6 KB
/
design-system.ftd
File metadata and controls
522 lines (330 loc) · 13.6 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
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
-- import: fastn.com/blog/authors
-- import: fastn-community.github.io/doc-site/common
-- import: fastn.com/content-library as cl
-- import: fastn-community.github.io/bling/sidenote
-- common.post-meta meta: Tutorial: Build a fastn-Powered Website Using the Design System Package
published-on: January 9, 2024
post-url: /blog/design-system/
author: $authors.nandini
Welcome to our tutorial on building websites using the [Design System
package](https://design-system.fifthtry.site/).
This package takes care of color schemes, typography, and
design elements like section layouts, buttons, links, headers, and
and other components, freeing you from the complexities of individual
element design.
You can also customize these design elements to match your brand's
identity.
-- ds.blog-page:
meta: $meta
-- ds.markdown:
In this tutorial, you will learn how to use the design system package
in the editor of your choice. You will
You'll learn how to use our pre-built components and typography to build a
professional and visually appealing site.
Let’s dive in and start building your next great website!
-- sidenote.sidenote:
If you’re using the FifthTry Editor, you can skip the `Initial
Setup` steps outlined here. Instead, follow the instructions
provided on our [Getting Started page](https://fastn-community.github.io/design-system/)
to quickly set up your project. You can then return to this tutorial and
jump straight to the `Quick Tutorial` section to continue
learning how to build your site.
-- ds.markdown:
I recommend starting with the video below to kickstart your journey.
-- ds.youtube:
v: https://www.youtube.com/embed/qX0K1pWsyuw?si=WgyAJN4P_ZUiFXnY
-- ds.h1: Initial Setup
Here are a few prerequisites to initiate your first
fastn-powered website:
- [Install fastn](https://fastn.com/install/) on your system.
- [Install a Text Editor](https://fastn.com/editor/) in your system.
-- ds.h2: Setting Up Your Project Folder
For the purpose of this tutorial, we'll recreate the
[talknotes.io](https://talknotes.io/) website.
Create a folder named **talknotes-demo** on your local machine. Open this
folder using your preferred text editor.
-- sidenote.sidenote:
When saving a folder, file or graphics, remember to use lower-cased file names,
and use hyphens instead of space.
- Example 1: When saving folders, `My Website` is incorrect, instead use `my-website`
- Example 2: When saving `.ftd` files, `Blog 1.ftd` is incorrect, instead use `blog-1.ftd`
- Example 3: When saving graphics, `Profile Picture.png` is incorrect, instead use `profile-picture.png`.
-- ds.h2: File Creation
-- ds.h3: FASTN.ftd
In your text editor, right click on the folder and click on `New File` and save
the file as `FASTN.ftd` and insert the code provided below.
-- ds.code: FASTN.ftd
lang: ftd
\-- import: fastn
\-- fastn.package: talknotes-demo
\-- fastn.dependency: fastn-community.github.io/design-system
\-- fastn.auto-import: fastn-community.github.io/design-system as ds
-- ds.h3: Designing the Page Structure
Now let's start with the homepage of your website. In fastn, `index.ftd` file is used as your homepage.
In your editor, create a new file and save it as `index.ftd`
Inside your index.ftd, use [`ds.page`](https://github.com/fastn-community/design-system/blob/main/layout/page.ftd)
to establish the page's structure. (Always end the `ds.page` with `-- end: ds.page`)
Inside the `ds.page`, you can organize all the content intended for the page. Let's
use `ds.heading-hero` to add a heading to this page. Now you can open the
terminal and run the command `fastn serve`.
Once executed, the terminal command will display the output of your webpage.
Observe the presence of the heading along with the pre-assigned **page width**
and the functionality of the **dark and light mode switcher.**
-- ds.code:
lang: ftd
\-- import: fastn-community.github.io/design-system as ds
\-- ds.page: ;; <hl>
\-- ds.heading-hero: talknotes-demo
\-- end: ds.page ;; <hl>
-- ds.image: Output
src: $fastn-assets.files.images.blog.heading-tn.png
-- ds.h1: Quick Tutorial
-- ds.h2: Familiarize Yourself with the Design System Components
Begin by thoroughly examining the individual files within the [**design system**](https://fastn-community.github.io/design-system/)
package. These files consists an array of components, foundational elements, demo sites, and typography.
Take your time to explore each component to understand the package's capabilities.
-- ds.h2: Breakdown of Foundational Elements
[**`ds.section-row`**](https://github.com/fastn-community/design-system/blob/main/layout/section-row.ftd)
is used to structure elements horizontally adjacent to
each other within a single section or component of a website.
Use [**`ds.row`**](https://github.com/fastn-community/design-system/blob/main/layout/row.ftd)
for organizing elements side by side, providing a
layout within that specific section or component.
Likewise, for vertical structuring, use [**`ds.section-column`**](https://github.com/fastn-community/design-system/blob/main/layout/section-column.ftd)
to arrange elements on top of each other within a single section or component
of a website. For elements inside the section to follow a similar vertical
arrangement, opt for [**`ds.column`**](https://github.com/fastn-community/design-system/blob/main/layout/column.ftd)
It's important to note that a component or section in your website can have only
one of either a `ds.section-row` and `ds.section-column`.
However, within these designated sections, you can have multiple instances of
`ds.row` or `ds.column` to structure elements side by side or one on top of
the other, respectively.
-- ds.h2: Utilizing Spaces in the Design System Package
Spaces within the design system package offer flexibility in managing layout
and structure. There are three primary types of spaces to consider:
-- ds.h3: 1. Inset
This defines the space between an element's border and its content, akin
to padding in web or graphic design. There are various insets available,
including:
- **`inset-square`**: Equal values in both horizontal and vertical directions.
- **`inset-wide`**: Greater horizontal padding than vertical padding.
- **`inset-tall`**: Higher vertical padding than horizontal padding.
**The syntax for using inset is:**
-- ds.code:
lang: ftd
inset: $ds.spaces.inset-(type).(value)
-- ds.code: Example
lang: ftd
inset: $ds.spaces.inset-square.large
inset: $ds.spaces.inset-wide.small-zero
inset: $ds.spaces.inset-tall.zero-medium
-- ds.markdown:
[Learn about different inset values](https://github.com/fastn-community/design-system/blob/main/spaces.ftd)
-- ds.h3: 2. Margin
This represents the space around an element's border. Both horizontal and
vertical gaps are applicable and can take values like
- extra-extra-small
- extra-small
- small
- medium
- large
- extra-large
- extra-extra-large
- space-between
- zero
**The syntax for margin is:**
-- ds.code:
lang: ftd
margin: $ds.spaces.(horizontal-gap or vertical-gap).(value)
-- ds.code: Example
lang: ftd
margin: $ds.spaces.horizontal-gap.extra-large
margin: $ds.spaces.vertical-gap.small
-- ds.h3: 3. Spacing
This defines the space between elements within a container. Similar to margin,
it takes the values for both horizontal and vertical gaps.
**The syntax for spacing is:**
-- ds.code:
lang: ftd
spacing: $ds.spaces.(horizontal-gap or vertical-gap).(value)
-- ds.code:
lang: ftd
spacing: $ds.spaces.vertical-gap.space-between
spacing: $ds.spaces.horizontal-gap.extra-extra-large
-- ds.markdown:
By understanding and utilizing these space types, you can precisely control the
layout and arrangement of elements on your website.
-- ds.h1: The header component
Take a look at the elements of the [talknotes.io](https://talknotes.io/) website header. The header
consists of a logo, header links, and buttons, that are structured adjacent to
each other. Hence, we will be using `ds.section-row` to create the header component.
-- ds.image: Header Section
src: $fastn-assets.files.images.blog.header-drawing.png
-- ds.code: Header Component
lang: ftd
\-- component header:
\-- ds.section-row: ;; <hl>
flush: full
inset: $ds.spaces.inset-wide.large
outer-background.solid: $ds.colors.background.step-2
spacing: $ds.spaces.horizontal-gap.space-between
margin: $ds.spaces.vertical-gap.extra-large
\-- ftd.image: ;; <hl>
src: https://talknotes.io/_ipx/w_150&q_80/images/brand/logo-color.svg
width.fixed.percent: 10
\-- ds.row: ;; <hl>
spacing: $ds.spaces.horizontal-gap.extra-large
width: fill-container
\-- ds.header-link: Try It ;; <hl>
link: /
\-- ds.header-link: How it works
link: /
\-- ds.header-link: Usecases
link: /
\-- ds.header-link: Pricing
link: /
\-- ds.header-link: FAQ
link: /
\-- end: ds.row
\-- ds.row: ;; <hl>
width: hug-content
\-- ds.info-button: Login ;; <hl>
link: /
\-- ds.phosphor-icon-button: Get Talknotes + ;; <hl>
icon: arrow-right
link: /
\-- end: ds.row
\-- end: ds.section-row
\-- end: header
-- ds.markdown:
Once the header component is completed, call it within the `ds.page` to
add it into your webpage.
-- ds.code:
lang: ftd
\-- import: fastn-community.github.io/design-system as ds
\-- ds.page:
\-- header: ;; <hl>
\-- end: ds.page
-- ds.image: Output
src: $fastn-assets.files.images.blog.header-tn.png
-- sidenote.sidenote:
Experiment with different attributes like [flush](https://github.com/fastn-community/design-system/blob/main/layout/page.ftd),
[inset, margin, and spacing](https://github.com/fastn-community/design-system/blob/main/spaces.ftd) to
comprehend their impact on `ds.section-row`, `ds.section-column` and
[`ds.container`](https://github.com/fastn-community/design-system/blob/main/layout/container.ftd)
This will deepen your understanding of these attributes and their values.
You can also experiment with [borders](https://github.com/fastn-community/design-system/blob/main/borders.ftd), width,
[radius](https://github.com/fastn-community/design-system/blob/main/radius.ftd), alignment, background color, and other
attributes.
-- ds.h1: The Hero Component
-- ds.image:
src: $fastn-assets.files.images.blog.hero-drawing.png
-- ds.markdown:
- Use `ds.section-row:` to define the foundation of your hero section.
- Inside the `ds.section-row:`, use `ds.column:` to vertically stack the elements like
badges, titles, descriptions, buttons, and icons.
- Close the `ds.column:` and add your hero image using `ftd.image:`
- For the 5-star rating, use phosphor icons. Since Phosphor Icons aren't native
to the package, you need to import them for your project. To do that, add the below code in your `FASTN.ftd`
-- ds.code:
lang: ftd
\-- fastn.dependency: fastn-community.github.io/svg-icons
-- ds.markdown:
And, add the below code in your `index.ftd`
-- ds.code:
lang: ftd
\-- import: fastn-community.github.io/svg-icons/phosphor
-- ds.markdown:
- For the badge design, use `ds.container:` to create the outer box. Customize
the container with background colors, insets, border-radius, etc. Within the
container, use `ds.row:` and `ds.column:` to structure elements accordingly.
-- ds.code: Hero Component
lang: ftd
\-- component hero:
\-- ds.section-row: ;; <hl>
spacing: $ds.spaces.horizontal-gap.extra-extra-large
inset: $ds.spaces.inset-tall.zero-medium
\-- ds.column:
spacing: $ds.spaces.vertical-gap.medium
align-content: left
\-- ds.container: ;; <hl>
inset: $ds.spaces.inset-square.small
width.fixed.percent: 50
background.solid: $ds.colors.background.step-2
radius: $ds.radius.medium
\-- ds.row:
\-- ftd.image:
src: assets/medal.png
width.fixed.px: 32
\-- ds.column:
spacing: $ds.spaces.vertical-gap.zero
align-content: left
\-- ds.fine-print:
align: left
PRODUCT HUNT
\-- ds.copy-regular:
color: $inherited.colors.text-strong
align: left
#1 Product of the year
\-- end: ds.column
\-- end: ds.row
\-- end: ds.container
\-- ds.heading-large: Turn messy thoughts into actionable notes. Fast. ;; <hl>
\-- ds.heading-small: The #1 AI. voice voicenote app ;; <hl>
\-- ds.copy-large: ;; <hl>
Turn hours of note taking into minutes. Just record a voicenote, and let the AI transcribe, clean up and structure it for you.
\-- ds.phosphor-icon-button: Get Talknotes + ;; <hl>
icon: arrow-right
link: /
width: full
\-- ds.row:
align-content: left
\-- ds.copy-small: ;; <hl>
Trusted by +3000 happy users
\-- ds.row: ;; <hl>
spacing: $ds.spaces.horizontal-gap.zero
width: hug-content
\-- phosphor.fill: star ;; <hl>
size: 18
\-- phosphor.fill: star
size: 18
\-- phosphor.fill: star
size: 18
\-- phosphor.fill: star
size: 18
\-- phosphor.fill: star
size: 18
\-- end: ds.row
\-- end: ds.row
\-- end: ds.column
\-- ftd.image: ;; <hl>
src: assets/hero.png
width.fixed.percent: 40
border-radius.px: 15
shadow: $s
\-- end: ds.section-row
\-- end: hero
\-- ftd.shadow s: ;; <hl>
color: #d0d0d0
blur.px: 8
spread.px: 4
-- ds.markdown:
Once the hero component is completed, call it within the `ds.page` to
add it into your webpage.
-- ds.code:
lang: ftd
\-- import: fastn-community.github.io/design-system as ds
\-- ds.page:
\-- header:
\-- hero: ;; <hl>
\-- end: ds.page
-- ds.image: Output
src: $fastn-assets.files.images.blog.hero-tn.png
-- ds.h1: Conclusion
Now, I went ahead and recreated all the sections from the talknotes.io website.
Reference the [talknotes.io project repository](https://github.com/nandhinidevie/talknotes-practise)
for further guidance.
Feel free to share your progress and projects on the `#share-your-work` thread on [our Discord channel](https://discord.gg/fastn-stack-793929082483769345)
I hope this tutorial helps you to create stunning websites using the [**`design system package`**](https://github.com/fastn-community/design-system).
Go to [Part-2 of the tutorial.](/design-system-part-2/)
-- end: ds.blog-page