Customize
Optimize
Moey is one stylesheet and one script, with no dependencies. Here is what it weighs, how to serve it fast, and how to make it smaller.
What it weighs
| File | Size | gzip | brotli | |
|---|---|---|---|---|
dist/moey.css | readable | 859 KB | 140 KB | 89 KB |
dist/moey.min.css | for production | 648 KB | 91 KB | 59 KB |
dist/moey.js | readable | 320 KB | 90 KB | 74 KB |
Servers and CDNs compress files automatically — the gzip / brotli sizes are what visitors download. Fonts load only for the characters a page uses (each script — Latin, Cyrillic, Greek, Vietnamese — is its own small file).
Serve it fast
- Use the min files in production:
moey.min.cssandmoey.min.js. - Load the script with
deferso the page shows before it runs:<script src="moey.min.js" defer></script>. - Cache for a long time and change the file name or add
?v=…when you update — Moey's own sites do this. - Images:
loading="lazy", awidthandheight(or an aspect ratio) so nothing jumps while they load.
A smaller build
Most of the size is the breakpoint versions of the utilities (sm: … 2xl:) and the color shades. With the build you can keep only what you use. Both options write a separate file — dist/ is never changed.
# only the breakpoints you use
node build.mjs --breakpoints=md,lg --out=my-moey
# without components you don't need (names = the files in src/css)
node build.mjs --without=carousel,datatable,tree,dropzone --out=my-moey
# → my-moey.css + my-moey.min.css (keep a fonts/ folder beside them)
| Option | What it does |
|---|---|
--breakpoints=md,lg | keeps only those breakpoint versions of the grid and utilities |
--without=a,b | leaves those components out (it tells you the names if you mistype one) |
--out=name | where to write the custom build (required with the two above) |