Skip to content

fix: highlight active news filter button with primary colour#42

Draft
Copilot wants to merge 3 commits intorollingfrom
copilot/fix-highlight-navigation-button
Draft

fix: highlight active news filter button with primary colour#42
Copilot wants to merge 3 commits intorollingfrom
copilot/fix-highlight-navigation-button

Conversation

Copy link
Contributor

Copilot AI commented Feb 23, 2026

The active filter button on the news page had no visible highlight — the selected item (e.g. 全部) appeared dimmer than inactive buttons rather than standing out.

Root cause: Nuxt UI v4 + Tailwind CSS v4 requires colour scales to be registered via @theme using --color-primary-* custom properties. The previous config passed a raw hex to ui.colors.primary, which is not a valid colour scale name — color="primary" had nothing to resolve and fell back silently.

Changes

  • main.css — Add @theme block registering the full --color-primary-{50…950} scale using the existing Twinkle AI brand yellow (#ffd500):

    @theme {
      --color-primary-500: #ffd500; /* brand base */
      /* … full scale 50–950 */
    }
  • app.config.ts — Replace primary: '#ffd500' with primary: 'primary' to reference the registered theme scale; rename legacy gray key to neutral (Nuxt UI v4 field name):

    colors: {
      primary: 'primary',
      neutral: 'zinc',
    }
  • news.vue — Switch active filter button from variant="solid" to variant="outline" so the selection is communicated via primary-coloured border + text rather than a filled background, per the issue request for highlighted text:

    :variant="activeFilter === filter.value ? 'outline' : 'ghost'"
    :color="activeFilter === filter.value ? 'primary' : 'white'"
Original prompt

This section details on the original issue you should resolve

<issue_title>被選取導覽列按鈕沒有高亮</issue_title>
<issue_description>Image

新聞頁面,被選取的頁面之導覽列沒有高亮顯示,這樣在 UX 體驗上面可能不清楚,提議是否可以高亮的文字採用官網的主要色系(primary color)?</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: supersonictw <13705584+supersonictw@users.noreply.github.com>
@cloudflare-workers-and-pages
Copy link
Contributor

cloudflare-workers-and-pages bot commented Feb 23, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
twinkle-website d2a91f2 Commit Preview URL

Branch Preview URL
Feb 23 2026, 02:41 AM

- Add @theme block to main.css to register --color-primary-* CSS vars
  (Nuxt UI v4 requires this for color="primary" to resolve correctly)
- Update app.config.ts: use 'primary' color name instead of hex value,
  and rename gray→neutral for Nuxt UI v4 compatibility
- Change news.vue active filter from variant solid to outline so the
  selected button shows a yellow/gold border + text highlight
- Add package-lock.json to .gitignore

Co-authored-by: supersonictw <13705584+supersonictw@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix navigation bar button highlight on news page fix: highlight active news filter button with primary colour Feb 23, 2026
Copilot AI requested a review from supersonictw February 23, 2026 02:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

被選取導覽列按鈕沒有高亮

2 participants