Skip to content

Commit 09d17da

Browse files
committed
Decomposed index.html: Split into semantic partials in partials/, added partials/load.js to load components dynamically, TODO: work on overflow and focus on accessibility, then get back to restyling components and working on mobile first refactor.
1 parent 040adf0 commit 09d17da

37 files changed

+4821
-3520
lines changed

build.py

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
import os
2+
3+
def build_css():
4+
"""Concatenates all CSS files into a single bundle."""
5+
6+
# Order matters!
7+
files = [
8+
# Foundation
9+
'css/_breakpoints.css',
10+
'css/fonts.css',
11+
'css/core.css',
12+
'css/_utilities.css',
13+
'css/_grid.css',
14+
15+
# Components
16+
'css/components/ff-navbar.css',
17+
'css/components/ff-nav.css',
18+
'css/components/ff-breadcrumb.css',
19+
'css/components/ff-pagination.css',
20+
'css/components/ff-card.css',
21+
'css/components/ff-accordion.css',
22+
'css/components/ff-tabs.css',
23+
'css/components/ff-modal.css',
24+
'css/components/ff-alert.css',
25+
'css/components/ff-toast.css',
26+
'css/components/ff-popover.css',
27+
'css/components/ff-tooltip.css',
28+
'css/components/ff-spinner.css',
29+
'css/components/ff-table.css',
30+
'css/components/ff-list-group.css',
31+
'css/components/ff-avatar.css',
32+
'css/components/ff-chips.css',
33+
'css/components/ff-forms.css',
34+
'css/components/ff-input-group.css',
35+
'css/components/ff-dropdown.css',
36+
'css/components/ff-battle-menu.css',
37+
'css/components/ff-materia.css',
38+
'css/components/ff-junction.css',
39+
40+
# Themes (Optional - usually users import these separately, but we can bundle base ones)
41+
# 'css/ff7.css',
42+
]
43+
44+
output_dir = 'dist'
45+
if not os.path.exists(output_dir):
46+
os.makedirs(output_dir)
47+
48+
output_file = os.path.join(output_dir, 'final-fantasy.css')
49+
50+
print(f"Building {output_file}...")
51+
52+
with open(output_file, 'w', encoding='utf-8') as outfile:
53+
# Add header
54+
outfile.write("/* Final Fantasy CSS Library v2.0 - Bundled */\n\n")
55+
56+
for fname in files:
57+
if os.path.exists(fname):
58+
print(f" Adding {fname}")
59+
with open(fname, 'r', encoding='utf-8') as infile:
60+
outfile.write(f"/* --- {os.path.basename(fname)} --- */\n")
61+
outfile.write(infile.read())
62+
outfile.write("\n\n")
63+
else:
64+
print(f" WARNING: File not found: {fname}")
65+
66+
print("Build complete!")
67+
68+
if __name__ == "__main__":
69+
build_css()

css/_breakpoints.css

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/* Breakpoint System - Mobile First */
2+
/* Following Bootstrap 5 conventions with IE11 support */
3+
4+
:root {
5+
/* Breakpoint values */
6+
--breakpoint-sm: 576px;
7+
--breakpoint-md: 768px;
8+
--breakpoint-lg: 992px;
9+
--breakpoint-xl: 1200px;
10+
11+
/* Container max-widths */
12+
--container-sm: 540px;
13+
--container-md: 720px;
14+
--container-lg: 960px;
15+
--container-xl: 1140px;
16+
17+
/* Spacing scale (mobile-first) */
18+
--spacing-xs: 4px;
19+
--spacing-sm: 8px;
20+
--spacing-md: 16px;
21+
--spacing-lg: 24px;
22+
--spacing-xl: 32px;
23+
}
24+
25+
/* Media Query Mixins (as comments for reference) */
26+
/*
27+
Mobile First Approach:
28+
- Base styles = mobile (0px+)
29+
- @media (min-width: 576px) = sm and up
30+
- @media (min-width: 768px) = md and up
31+
- @media (min-width: 992px) = lg and up
32+
- @media (min-width: 1200px) = xl and up
33+
*/

0 commit comments

Comments
 (0)