TFMKIT Logo
Foundations

Layout & Spacing

Everything sits on a 4px base unit. Sections are composed from three pieces: a container width, a vertical padding rhythm, and the grid inside.

Spacing scale

spacing.scale from tokens.ts — one bar per step. Use p-*, m-*, gap-* utilities with these numbers; arbitrary px values get flagged by the ESLint rule.

0
0
1
0.25rem
2
0.5rem
3
0.75rem
4
1rem
5
1.25rem
6
1.5rem
8
2rem
10
2.5rem
12
3rem
16
4rem
20
5rem
24
6rem
32
8rem
0.5
0.125rem
1.5
0.375rem

Containers

Page width is chosen per section — sm for reading, base for most content, lg for wide dashboards like this page.

section-container-sm · max-w-5xl
section-container · max-w-7xl
section-container-lg · max-w-[90rem]
ShortcutMax width
section-container-smmax-w-5xl
section-containermax-w-7xl
section-container-lgmax-w-[90rem]
ShortcutPadding
section-padding-smpy-12 md:py-16 lg:py-20
section-paddingpy-16 md:py-24 lg:py-32

Breakpoints

Mobile-first — base styles target mobile, md:/lg: scale up.

PrefixMin width
sm640px
md768px
lg1024px
xl1280px
2xl1536px
rounded-none
rounded-sm
rounded
rounded-md
rounded-lg
rounded-xl
rounded-2xl
rounded-3xl
rounded-full

Cards use rounded-2xl, buttons rounded-full, inputs rounded-xl.

ShortcutExpands to
flex-centerflex items-center justify-center
flex-betweenflex items-center justify-between
flex-startflex items-center justify-start
flex-endflex items-center justify-end
flex-col-centerflex flex-col items-center justify-center
grid-centergrid place-items-center
absolute-centerabsolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2
Logical-property rules
RuleProperty
mi-{n} / mie-{n} / mis-{n}margin-inline / -end / -start (px→rem)
mblock-{n} / mbs-{n} / mbe-{n}margin-block / -start / -end
pi-{n} / pis-{n} / pie-{n}padding-inline / -start / -end
pblock-{n} / pbs-{n} / pbe-{n}padding-block / -start / -end
square-{n}width + height together (px→rem)