6 KiB
Refactor portfolio to use @nychthemeron/library
Context
The portfolio currently ships a hand-rolled "Nychthemeron" design system:
local components in src/components/ds/ (NychButton, NychCard,
NychInputText, NychTextarea, NychMessage, NychTag, LaurelSpinner,
LaurelDivider, ImageSlot) backed by ~1200 lines of token CSS in
src/assets/styles/.
@nychthemeron/library (now installed from the private registry at
git.mcpeakdev.com) is the extracted, PrimeVue-backed version of this same
design system: unstyled PrimeVue components (Button, Card, InputText,
Textarea, Message, Tag, LoadingIcon, plus others not yet used here)
wired up with the same nych-* passthrough classes, and ships the same
theme as CSS via @nychthemeron/library/style and @nychthemeron/library/theme.
Goal: replace the local duplicated implementation with the library, keeping
only what the library doesn't provide (LaurelDivider, ImageSlot, and the
580px static hero spinner).
Styling / setup
src/main.ts:- Add
import '@nychthemeron/library/style'andimport '@nychthemeron/library/theme'. - Register PrimeVue:
app.use(PrimeVue)(the library's components are PrimeVue components under the hood). - Keep the existing
import './assets/styles/styles.css', but trim its@importmanifest (see below) so it only covers portfolio-specific CSS; the library CSS imports are added separately inmain.ts.
- Add
- Delete
src/assets/styles/tokens/fonts.css,tokens/colors.css,tokens/base.css— fully superseded by@nychthemeron/library/style(same theme CSS variables for bothhades/apollothemes, font imports, base reset, focus-ring, and thenych-spinkeyframes). src/assets/styles/tokens/components.css: delete every section except LaurelDivider (currently the last section, ~line 738 onward). Rename the file totokens/laurel-divider.csscontaining just that section. Everything else (Button, Input/Textarea, Checkbox/Radio, ToggleSwitch, Select, Card, Message, Tag, Dialog) is covered by@nychthemeron/library/theme.- Keep as-is:
tokens/spacing.css,tokens/typography.css,portfolio.css, brand SVGs insrc/assets/brand/. - Update
src/assets/styles/styles.css's@importmanifest to drop the removed files and addtokens/laurel-divider.cssin place oftokens/components.css.
Component mapping
| Local component | Replacement | Notes |
|---|---|---|
NychTag |
Tag from @nychthemeron/library |
severity / rounded props pass straight through |
NychMessage |
Message |
severity / closable pass straight through |
NychInputText |
InputText |
v-model, placeholder, type, invalid pass through; drop the local size="normal" prop (PrimeVue size only accepts small/large/default — normal maps to "don't pass size") |
NychTextarea |
Textarea |
v-model, rows, placeholder, invalid — direct match |
NychButton |
Button |
severity, disabled, loading, default + icon slots — direct match. The library's Button has a built-in loading spinner (laurel wreath), replacing the local LaurelSpinner usage inside NychButton |
NychCard |
Card |
slot rename: local image slot → PrimeVue header slot; local default slot → PrimeVue content slot; title/subtitle props match |
LaurelSpinner (small, used inside NychButton) |
dropped — covered by Button's built-in loader |
|
LaurelSpinner (Hero, 580px static, :spinning="false") |
kept as a local component, rewritten as a thin wrapper around NychLoadingIcon imported from @nychthemeron/library/components, with scoped CSS to set width/height and override/disable the nych-spin animation when spinning is false |
per approved "wrap with CSS overrides" approach |
LaurelDivider, ImageSlot |
unchanged, no library equivalent |
Files affected
Deleted:
src/components/ds/NychTag.vuesrc/components/ds/NychMessage.vuesrc/components/ds/NychInputText.vuesrc/components/ds/NychTextarea.vuesrc/components/ds/NychButton.vuesrc/components/ds/NychCard.vuesrc/assets/styles/tokens/fonts.csssrc/assets/styles/tokens/colors.csssrc/assets/styles/tokens/base.css
Rewritten:
src/components/ds/LaurelSpinner.vue— becomes a thin wrapper around the library'sNychLoadingIcon, preserving its existingsize/color/spinningprop API soHeroSection.vuedoesn't need to change its usage.src/assets/styles/tokens/components.css→tokens/laurel-divider.css(LaurelDivider section only).src/assets/styles/styles.css(updated@importmanifest).src/main.ts(add PrimeVue + library CSS imports,app.use(PrimeVue)).
Updated imports/usages:
src/components/portfolio/SkillsSection.vue—NychTagfrom library.src/components/portfolio/WorkSection.vue—NychCard,NychTagfrom library; updateNychCardslot usage (image→header, default →content).src/components/portfolio/ContactSection.vue—NychInputText,NychTextarea,NychButton,NychMessagefrom library.src/components/portfolio/HeroSection.vue—NychButtonfrom library;LaurelSpinnercontinues to be imported from./ds/LaurelSpinner.vue(rewritten).
Verification
bun run buildandbun run type-checkmust pass.- Visually verify via dev server (
bun run dev):- Hero section renders the large static laurel wreath at the same size.
- Skills/Work section tags render with correct severity colors.
- Work section cards render header image, title, content, footer tags.
- Contact form inputs/textarea/button/message render and behave (loading spinner shows in button while "sending").
- Both
hadesandapollothemes (toggledata-themeon<html>) still render correctly.
Out of scope
- No changes to
LaurelDivider.vueorImageSlot.vueinternals. - No changes to other library components not currently used
(
Checkbox,Select,Dialog,ToggleSwitch,RadioButton, etc.). - No changes to the CI workflow or registry configuration.