Frontend
how I make my templates easy to reskin (probably overthought this)
muganda dizo Dev.to (EN Zone)
2 views
how I make my templates easy to reskin (probably overthought this)
so I do client work - dashboards, landing pages, that kind of thing. and at some point I noticed I basically build the same 5-6 things over and over. stat card, some kind of table, a hero section, a pricing grid. just... different colors every time.
eventually turned two of these into actual products - Ledger (dashboard template) and Fielder (landing page kit). wanted them to be easy to reskin without me having to rebuild half of it every time someone wants a different look. here's what that actually meant in practice.
colors live in one file, period
no hardcoded hex codes anywhere in a component. all of it goes through tailwind config:
js
colors: {
primary: { DEFAULT: '#2B6E63', light: '#3E8F80', dark: '#1E4E46' },
accent: '#C98A3B',
},
fontFamily: {
display: ['Fraunces', 'serif'],
body: ['Inter', 'sans-serif'],
},
components just say bg-primary or whatever. change the six lines above, whole product looks different. nothing else to touch.
sounds obvious written out like that but I've def seen (and written) code before where someone just... types a hex code directly into a className because it was faster in the moment. don't do that if you want this to work later.
don't name things after the client's industry
easy trap - you're building a rental dashboard so you name the component TenantTable. don't. it's just DataTable. StatCard. StatusBadge. the rental-specific stuff lives in a mock data file, the component has zero idea what it's displaying.
this one actually matters more than the color thing honestly, because renaming components later is way more annoying than renaming a hex code.
the grid thing
both templates avoid the classic 3-identical-cards-in-a-row layout. one card's just bigger:
jsx
{/* main thing */}
{/* smaller stuff */}
not a huge deal but it stops the thing from looking like it was assembled from some component library's defaults, which is a look I was trying pretty hard to avoid.
the auth thing I almost skipped
first version of Ledger's login page looked fine and did literally nothing. you click sign in, nothing happens, you're still on the login page. that's a pretty common shortcut for templates but someone pointed out to me that it's also the first thing a buyer will actually click, so if it's broken that's a bad first impression.
fixed it with a plain react context, no auth library, nothing fancy - it actually redirects you if you try to hit a page without being logged in. took maybe an hour. probably should've done it from the start instead of after someone called it out.
anyway that's roughly it. the two templates don't share code but they share this same setup - config for styling, generic component names, breaking the grid pattern once, and not leaving fake screens lying around. if you want to see it: Ledger / Fielder. happy to answer questions in the comments if anyone has them.
Read original: https://dev.to/dizo11/how-i-make-my-templates-easy-to-reskin-probably-overthought-this-31no
← Previous
Salt, spikes, and three thermostats — the neuromodules of a numpy organism
Next →
Attestkeep 1.0 is out, and the comment thread is in the changelog
Related
Your Flutter 404 Page Is Probably Crashing, and Your Server Is Probably Lying About It
Frontend
1
DEV Community
StyleX won CSS-in-JS because AI agents can read it
Frontend
2
DEV Community
Why I Built a Lightweight Utility Styling Library for React Native (And How It Solves StyleSheet Fatigue)
Frontend
2
DEV Community
DOM in Angular: Understanding the Document Object Model with Practical Examples
Frontend
3
Dev.to (EN Zone)
Comments0
No comments yet — be the first