[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"nav-notes-count":3,"content-note-adding-accessible-components-to-an-existing-nuxt-design":4},9,{"id":5,"title":6,"author":7,"authorAvatar":8,"authorRole":9,"body":10,"category":479,"date":480,"description":265,"excerpt":481,"extension":482,"image":483,"index":484,"meta":485,"navigation":499,"path":500,"pullQuote":501,"readingTime":502,"seo":503,"slug":504,"stem":505,"takeaways":506,"total":510,"__hash__":511},"notes\u002Fnotes\u002Fadding-accessible-components-to-an-existing-nuxt-design.md","Adding Accessible Components to an Existing Nuxt Design","Norbert Brett","\u002Fimages\u002Fnorbert-brett.jpg","Full-Stack & AI Systems Engineer",{"type":11,"value":12,"toc":474},"minimark",[13,18,39,145,152,156,167,259,394,398,413,416,470],[14,15,17],"h2",{"id":16},"why-custom-design-and-accessibility-belong-together","Why Custom Design and Accessibility Belong Together",[19,20,21,22,26,27,30,31,34,35,38],"p",{},"If you have ever pressed the ",[23,24,25],"code",{},"Tab"," key on a flashy agency website and watched your cursor disappear into an invisible menu while the background page keeps scrolling, you have seen what happens when visual style is built without accessibility. Months earlier, while auditing a client's Vue web application built in 2025, I was annoyed to find twelve clickable service cards built out of generic ",[23,28,29],{},"\u003Cdiv>"," boxes instead of real ",[23,32,33],{},"\u003Cbutton>"," elements—meaning anyone using a keyboard or screen reader could not open a single card, and light-gray text on a white background sat at a barely legible ",[23,36,37],{},"2.4:1"," contrast ratio.",[40,41,42,67],"blockquote",{},[19,43,44,52,53,56,57,59,60,59,63,66],{},[45,46,47,48,51],"strong",{},"In Plain English — What Does \"Web Accessibility\" (",[23,49,50],{},"a11y",") Actually Mean?","\nAccessibility means building your website so ",[45,54,55],{},"everyone"," can use it—including people with visual impairments using screen-reader software, customers with temporary wrist injuries navigating by keyboard (",[23,58,25],{},", ",[23,61,62],{},"Enter",[23,64,65],{},"Escape","), users reading your site in bright outdoor sunlight, and people sensitive to rapid screen motion.",[68,69,70,89,110],"ul",{},[71,72,73,76,77,59,79,59,82,85,86,88],"li",{},[45,74,75],{},"Semantic HTML",": Using the real building blocks the browser understands (",[23,78,33],{},[23,80,81],{},"\u003Cnav>",[23,83,84],{},"\u003Cmain>",") instead of generic boxes (",[23,87,29],{},") so assistive tools automatically know what is clickable.",[71,90,91,101,102,106,107],{},[45,92,93,94,59,97,100],{},"ARIA Attributes (",[23,95,96],{},"aria-pressed",[23,98,99],{},"aria-expanded",")",": Short status labels attached to HTML buttons that tell a blind or low-vision user's screen reader ",[103,104,105],"em",{},"\"Language toggle: English, currently pressed\""," or ",[103,108,109],{},"\"FAQ item: collapsed.\"",[71,111,112,115,116,119,120,123,124,127,128,131,132,127,135,138,139,144],{},[45,113,114],{},"WCAG Contrast Ratio",": A standard scale from ",[23,117,118],{},"1:1"," (invisible) to ",[23,121,122],{},"21:1"," (pure black on pure white) measuring how easy text is to read. Standard compliance (",[23,125,126],{},"AA",") requires ",[23,129,130],{},"4.5:1","; gold-standard compliance (",[23,133,134],{},"AAA",[23,136,137],{},"7:1","+. Our primary buttons hit ",[45,140,141],{},[23,142,143],{},"18.9:1",".",[19,146,147],{},[148,149],"img",{"alt":150,"src":151},"Accessible Nuxt 4 Design System Architecture","\u002Fimages\u002Fnotes\u002Fdiagrams\u002Fadding-accessible-components-to-an-existing-nuxt-design.svg",[14,153,155],{"id":154},"when-native-html-is-enoughand-when-to-use-a-component-primitive","When Native HTML Is Enough—and When to Use a Component Primitive",[19,157,158,159,162,163,166],{},"You see, many business owners worry that making a site accessible will force it to look like a generic government form. The opposite is true when you separate ",[45,160,161],{},"behavior"," from ",[45,164,165],{},"visual styling",":",[168,169,170,235],"ol",{},[71,171,172,175,176],{},[45,173,174],{},"Controls where native HTML + ARIA labels do 100% of the job",":\n",[68,177,178,206,225],{},[71,179,180,194,195,198,199,202,203,144],{},[45,181,182,183,186,187,190,191,100],{},"Bilingual & Currency Toggles (",[23,184,185],{},"EN \u002F HU"," and ",[23,188,189],{},"HUF \u002F EUR"," in ",[23,192,193],{},"PricingCalculatorSection.vue",": We use real ",[23,196,197],{},"\u003Cbutton type=\"button\">"," elements grouped inside ",[23,200,201],{},"role=\"group\""," with ",[23,204,205],{},":aria-pressed=\"lang === 'en'\"",[71,207,208,214,215,202,218,186,221,224],{},[45,209,210,211,100],{},"Category Filter Pills (on ",[23,212,213],{},"\u002Ffeed",": Wrapped in ",[23,216,217],{},"role=\"tablist\"",[23,219,220],{},"role=\"tab\"",[23,222,223],{},":aria-selected"," on each pill so keyboard users can switch categories effortlessly.",[71,226,227,230,231,234],{},[45,228,229],{},"Expandable Process & FAQ Rows",": Wired with ",[23,232,233],{},":aria-expanded=\"isOpen\""," so screen readers announce whether details are open or closed.",[71,236,237,175,248],{},[45,238,239,240,243,244,247],{},"Complex menus where a \"Headless Primitive\" (",[23,241,242],{},"Reka UI"," \u002F ",[23,245,246],{},"Radix Vue",") saves weeks of bugs",[68,249,250],{},[71,251,252,255,256,258],{},[45,253,254],{},"What is a Headless Component Primitive?"," It is an unstyled code building block that handles all the tricky keyboard arrow-key math, focus trapping, and ",[23,257,65],{},"-key closing for complex popups, while letting you apply 100% of your own custom fonts, colors, and borders.",[260,261,266],"pre",{"className":262,"code":263,"language":264,"meta":265,"style":265},"language-vue shiki shiki-themes github-light github-dark","\u003C!-- From PricingCalculatorSection.vue: Custom Swiss pill with full keyboard & screen-reader state -->\n\u003Cdiv\n  class=\"inline-flex items-center rounded-full border border-[var(--border-strong)] bg-[var(--bg-elevated)] p-1\"\n  role=\"group\"\n  aria-label=\"Language toggle\"\n>\n  \u003Cbutton\n    type=\"button\"\n    :aria-pressed=\"lang === 'en'\"\n    class=\"px-3.5 py-1.5 rounded-full font-mono text-xs font-bold uppercase tracking-wider transition-all focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ink\"\n    :class=\"lang === 'en' ? 'bg-[var(--text-primary)] text-[var(--bg-primary)]' : 'text-[var(--text-secondary)]'\"\n    @click=\"lang = 'en'\"\n  >\n    EN\n  \u003C\u002Fbutton>\n\u003C\u002Fdiv>\n","vue","",[23,267,268,277,288,302,313,324,330,336,342,347,353,359,365,371,377,383],{"__ignoreMap":265},[269,270,273],"span",{"class":271,"line":272},"line",1,[269,274,276],{"class":275},"sJ8bj","\u003C!-- From PricingCalculatorSection.vue: Custom Swiss pill with full keyboard & screen-reader state -->\n",[269,278,280,284],{"class":271,"line":279},2,[269,281,283],{"class":282},"sVt8B","\u003C",[269,285,287],{"class":286},"s9eBZ","div\n",[269,289,291,295,298],{"class":271,"line":290},3,[269,292,294],{"class":293},"sScJk","  class",[269,296,297],{"class":282},"=",[269,299,301],{"class":300},"sZZnC","\"inline-flex items-center rounded-full border border-[var(--border-strong)] bg-[var(--bg-elevated)] p-1\"\n",[269,303,305,308,310],{"class":271,"line":304},4,[269,306,307],{"class":293},"  role",[269,309,297],{"class":282},[269,311,312],{"class":300},"\"group\"\n",[269,314,316,319,321],{"class":271,"line":315},5,[269,317,318],{"class":293},"  aria-label",[269,320,297],{"class":282},[269,322,323],{"class":300},"\"Language toggle\"\n",[269,325,327],{"class":271,"line":326},6,[269,328,329],{"class":282},">\n",[269,331,333],{"class":271,"line":332},7,[269,334,335],{"class":282},"  \u003Cbutton\n",[269,337,339],{"class":271,"line":338},8,[269,340,341],{"class":282},"    type=\"button\"\n",[269,343,344],{"class":271,"line":3},[269,345,346],{"class":282},"    :aria-pressed=\"lang === 'en'\"\n",[269,348,350],{"class":271,"line":349},10,[269,351,352],{"class":282},"    class=\"px-3.5 py-1.5 rounded-full font-mono text-xs font-bold uppercase tracking-wider transition-all focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ink\"\n",[269,354,356],{"class":271,"line":355},11,[269,357,358],{"class":282},"    :class=\"lang === 'en' ? 'bg-[var(--text-primary)] text-[var(--bg-primary)]' : 'text-[var(--text-secondary)]'\"\n",[269,360,362],{"class":271,"line":361},12,[269,363,364],{"class":282},"    @click=\"lang = 'en'\"\n",[269,366,368],{"class":271,"line":367},13,[269,369,370],{"class":282},"  >\n",[269,372,374],{"class":271,"line":373},14,[269,375,376],{"class":282},"    EN\n",[269,378,380],{"class":271,"line":379},15,[269,381,382],{"class":282},"  \u003C\u002Fbutton>\n",[269,384,386,389,392],{"class":271,"line":385},16,[269,387,388],{"class":282},"\u003C\u002F",[269,390,391],{"class":286},"div",[269,393,329],{"class":282},[14,395,397],{"id":396},"designing-focus-rings-contrast-and-motion-that-respect-the-user","Designing Focus Rings, Contrast, and Motion That Respect the User",[19,399,400,401,404,405,408,409,412],{},"Some designers disable keyboard focus outlines (",[23,402,403],{},"outline: none",") because the default browser blue ring clashes with their color palette. That leaves keyboard users completely blind to where they are on the page. Instead of hiding the ring, we styled ",[23,406,407],{},"focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ink","—which draws a sharp, architectural 2px border matching our Swiss grid ",[45,410,411],{},"only when someone navigates with a keyboard",", never when clicking with a mouse.",[19,414,415],{},"Three final engineering habits keep visual polish and accessibility working together across this site:",[68,417,418,434,453],{},[71,419,420,423,424,59,427,59,430,433],{},[45,421,422],{},"18.9:1 WCAG AAA Contrast in Both Light and Dark Modes",": Every surface color token (",[23,425,426],{},"--bg-primary",[23,428,429],{},"--text-primary",[23,431,432],{},"--text-secondary",") was tested across both themes so text stays effortless to read indoors and outdoors.",[71,435,436,441,442,445,446,448,449,452],{},[45,437,438,440],{},[23,439,65],{}," Key & Scroll Restoration on Mobile Menus",": In ",[23,443,444],{},"AppNavbar.vue",", opening the mobile drawer locks background scrolling and listens for the ",[23,447,65],{}," key (",[23,450,451],{},"if (e.key === 'Escape' && isMobileMenuOpen.value) closeMobileMenu()","), so no user ever gets trapped inside an open menu.",[71,454,455,461,462,465,466,469],{},[45,456,457,458],{},"Respecting ",[23,459,460],{},"prefers-reduced-motion: reduce",": Both our scroll-driven typography and the 3D card hover tilt in ",[23,463,464],{},"ArtworkCanvas.vue"," check the user's operating system motion setting first. I felt relieved when testing the site with macOS ",[103,467,468],{},"Reduce Motion"," turned on: every animation stepped aside cleanly and presented the finished layout with zero visual jarring.",[471,472,473],"style",{},"html pre.shiki code .sJ8bj, html code.shiki .sJ8bj{--shiki-default:#6A737D;--shiki-dark:#6A737D}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .s9eBZ, html code.shiki .s9eBZ{--shiki-default:#22863A;--shiki-dark:#85E89D}html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":265,"searchDepth":279,"depth":279,"links":475},[476,477,478],{"id":16,"depth":279,"text":17},{"id":154,"depth":279,"text":155},{"id":396,"depth":279,"text":397},"Design Systems","October 14, 2026",null,"md","\u002Fimages\u002Fnotes\u002Fadding-accessible-components-to-an-existing-nuxt-design.webp","08",{"sections":486},[487,493],{"marker":488,"heading":489,"body":490},"\u002F A","Where Semantic HTML Suffices and Where Primitives Help",[491,492],"Design-heavy portfolios and marketing sites often break basic keyboard navigation because developers reach for styled divs instead of native buttons, tablists, and dialogs.","When building Br3tt Editorial in Nuxt 4, I audited every interactive surface—from the bilingual EN\u002FHU pricing toggles and category filter tabs to the mobile drawer—for keyboard focus, Escape key dismissal, and screen-reader state announcements.",{"marker":494,"heading":495,"body":496},"\u002F B","Keeping High-Contrast Swiss Typography and Motion Cohesive",[497,498],"Visual craft and WCAG AAA compliance reinforce each other when engineered through CSS custom properties. Using --text-primary against --bg-primary gives our primary pills an 18.9:1 contrast ratio in both Light and Dark themes.","Pairing focus-visible:outline-2 offsets with prefers-reduced-motion media checks ensures 60fps scroll physics never trap or disorient users.",true,"\u002Fnotes\u002Fadding-accessible-components-to-an-existing-nuxt-design","Accessibility is not a generic widget toolbar bolted onto the corner of the screen; it is whether your custom UI works when the mouse is unplugged.","7 min read",{"title":6,"description":265},"adding-accessible-components-to-an-existing-nuxt-design","notes\u002Fadding-accessible-components-to-an-existing-nuxt-design",[507,508,509],"Accessible websites reach more customers, rank better in search, and feel faster for power users who navigate by keyboard.","Use native HTML buttons and ARIA state labels (aria-pressed, aria-expanded) so screen readers always know which option is active.","High-contrast design tokens (18.9:1 WCAG AAA) and prefers-reduced-motion checks keep custom animations safe and readable for everyone.","10","RifAcTxf9WeQw-PpunuND4HJxYJEIV4JbCq4WFsc3nc"]