Skip to content

fix(theme): limit the global link hover to devices that can hover - #381

Merged
alexgrozav merged 1 commit into
align-component-styles-uxf-487from
limit-link-hover-uxf-508
Oct 30, 2026
Merged

alexgrozav merged 1 commit into
align-component-styles-uxf-487from
limit-link-hover-uxf-508

Conversation

@alexgrozav

Copy link
Copy Markdown
Contributor

Description

Applies the hover styles of useLinkElement only on devices that can hover. A tap on a touch screen leaves :hover applied, so a link, or a recipe rendered as <a href> like a primary solid Button, kept the global a:hover color and underline after the tap. The a:hover declarations now sit inside @media (hover: hover), the same way the recipes limit their own hover styles.

  • The link.hover.color and link.hover.text-decoration variables, their defaults and the useLinkElement options don't change.
  • useLinkElement.test.ts checks that the hover declarations sit inside @media (hover: hover) and that the variables and their defaults stay the same.
  • The Links page says the hover styles only apply on devices that can hover, and its output samples show the media query. The Button page's Hover item no longer says an <a href> button keeps the global a:hover styles after a tap.

Related issue

Part of the integration stack that aligns component styles with Open Components.

Type of change

  • 🐞 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 💥 Breaking change (fix or feature that changes existing behavior)
  • 📖 Documentation
  • ♻️ Refactor / internal (no functional change)
  • 🔧 Build / tooling / CI

Checklist

  • My commits follow Conventional Commits with a package scope (e.g. feat(theme): …)
  • I ran pnpm build:nodocs && pnpm lint && pnpm typecheck && pnpm test and everything passes
  • I added a changeset (pnpm changeset) for changes to publishable packages, or this change only touches docs/storybook/app/playground/tests
  • I added or updated tests where relevant
  • I updated documentation where relevant
  • I did not edit generated files (dist/, .styleframe/)
  • My PR targets main and stays focused in scope

Notes / screenshots

  • The gate ran: build, lint, format check, typecheck and the docs build with its CSS guard pass. pnpm test passes except 8 @styleframe/playground tests in test/theme.test.ts (localStorage is undefined), which fail the same way on the base branch.
  • A fixture build emits a { …; @media (hover: hover) { &:hover { … } } }, and no a:hover outside it.
  • This PR targets the integration branch, not main, so it gets no CI of its own.

A tap on a touch screen leaves :hover applied, so a link, or a recipe rendered as <a href> like a Button, kept the global a:hover colour and underline after the tap. The hover styles of useLinkElement now sit inside @media (hover: hover). The link.hover.* variables and their defaults stay the same.
@vercel

vercel Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
styleframe-dev Ready Ready Preview Oct 30, 2026 7:26am UTC
styleframe-dev-storybook Ready Ready Preview Oct 30, 2026 7:26am UTC

Request Review

@alexgrozav
alexgrozav merged commit 92165b3 into align-component-styles-uxf-487 Oct 30, 2026
3 checks passed
@alexgrozav
alexgrozav deleted the limit-link-hover-uxf-508 branch October 30, 2026 07:33

This branch was successfully deployed

2 active deployments
Preview – styleframe-dev — cf0760ff Deployed Oct 30, 2026 by vercel[bot]
Preview – styleframe-dev-storybook — cf0760ff Deployed Oct 30, 2026 by vercel[bot]
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.

1 participant