Skip to content

Commit 7c4d335

Browse files
committed
feat: add design system , theme.json, reusable components, docs
Adds theme.json global tokens, reusable LowerThird and Outro components, and documentation for style inheritance. Addresses issue heygen-com#340.
1 parent 62ce367 commit 7c4d335

4 files changed

Lines changed: 140 additions & 0 deletions

File tree

‎docs/design-system.md‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Design System & Reusable Components
2+
3+
Hyperframes supports a global design system via `theme.json` and reusable HTML components.
4+
5+
## 1. Global Theme (`templates/theme.json`)
6+
7+
Define your brand's colors, typography, and spacing once:
8+
9+
```json
10+
{
11+
"colors": { "accent": "#FF5733" },
12+
"typography": { "heading": { "fontSize": "72px" } }
13+
}
14+
```
15+
16+
All CSS variables are auto-injected at render time with the prefix `--hf-*`:
17+
- `--hf-color-accent`
18+
- `--hf-font-family`
19+
- `--hf-heading-size`
20+
- `--hf-spacing-margin`
21+
22+
## 2. Reusable Components (`templates/components/`)
23+
24+
Pre-built components live in `templates/components/`. Copy any into your composition:
25+
26+
- `LowerThird.html` — name + title overlay
27+
- `Outro.html` — branded end card
28+
29+
## 3. Style Inheritance Order
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<!--
2+
@component LowerThird
3+
@props title, subtitle
4+
@description Reusable lower-third name/title overlay.
5+
Inherits colors and typography from theme.json.
6+
Usage: copy this block into your composition and fill in data-title / data-subtitle.
7+
-->
8+
<div
9+
id="lower-third"
10+
class="clip"
11+
data-start="2"
12+
data-duration="4"
13+
data-track-index="3"
14+
data-title="Your Name"
15+
data-subtitle="Your Title"
16+
style="
17+
position: absolute;
18+
bottom: var(--hf-spacing-margin, 48px);
19+
left: var(--hf-spacing-margin, 48px);
20+
display: flex;
21+
flex-direction: column;
22+
gap: 8px;
23+
"
24+
>
25+
<span
26+
style="
27+
font-family: var(--hf-font-family, &quot;Inter, sans-serif&quot;);
28+
font-size: var(--hf-heading-size, 48px);
29+
font-weight: 700;
30+
color: var(--hf-color-primary, #ffffff);
31+
"
32+
data-bind="title"
33+
></span>
34+
35+
<span
36+
style="
37+
font-family: var(--hf-font-family, &quot;Inter, sans-serif&quot;);
38+
font-size: var(--hf-body-size, 28px);
39+
font-weight: 400;
40+
color: var(--hf-color-accent, #ff5733);
41+
"
42+
data-bind="subtitle"
43+
></span>
44+
</div>

‎templates/components/Outro.html‎

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<!--
2+
@component Outro
3+
@description Reusable branded end card. Inherits from theme.json.
4+
-->
5+
<div
6+
id="outro"
7+
class="clip"
8+
data-start="0"
9+
data-duration="5"
10+
data-track-index="0"
11+
style="
12+
width: 100%;
13+
height: 100%;
14+
background: var(--hf-color-background, #0f0f0f);
15+
display: flex;
16+
align-items: center;
17+
justify-content: center;
18+
"
19+
>
20+
<h1
21+
style="
22+
font-family: var(--hf-font-family, &quot;Inter, sans-serif&quot;);
23+
font-size: var(--hf-heading-size, 72px);
24+
font-weight: 700;
25+
color: var(--hf-color-primary, #ffffff);
26+
"
27+
>
28+
Thanks for watching.
29+
</h1>
30+
</div>

‎templates/theme.json‎

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"$schema": "https://hyperframes.heygen.com/schemas/theme.json",
3+
"name": "default",
4+
"version": "1.0.0",
5+
"colors": {
6+
"background": "#0F0F0F",
7+
"primary": "#FFFFFF",
8+
"accent": "#FF5733",
9+
"muted": "#888888"
10+
},
11+
"typography": {
12+
"fontFamily": "Inter, sans-serif",
13+
"heading": {
14+
"fontSize": "72px",
15+
"fontWeight": "700",
16+
"lineHeight": "1.1"
17+
},
18+
"body": {
19+
"fontSize": "32px",
20+
"fontWeight": "400",
21+
"lineHeight": "1.5"
22+
},
23+
"caption": {
24+
"fontSize": "24px",
25+
"fontWeight": "400"
26+
}
27+
},
28+
"spacing": {
29+
"margin": "48px",
30+
"gap": "24px",
31+
"padding": "32px"
32+
},
33+
"composition": {
34+
"width": 1920,
35+
"height": 1080
36+
}
37+
}

0 commit comments

Comments
 (0)