Skip to content

fix(styles): avoid cross-file apply of the custom link class - #786

Open
Henglie wants to merge 1 commit into
saicaca:mainfrom
Henglie:fix/markdown-link-class
Open

Henglie wants to merge 1 commit into
saicaca:mainfrom
Henglie:fix/markdown-link-class

Conversation

@Henglie

@Henglie Henglie commented Nov 14, 2026

Copy link
Copy Markdown

Summary

Fixes #766.

src/styles/markdown.css applied the custom link class from src/styles/main.css:

@apply relative bg-none link font-medium text-[var(--primary)]

Tailwind processes the stylesheet entries separately, so on a clean build the link component class is not available when markdown.css is compiled, and the build fails with:

The `link` class does not exist. If `link` is a custom class, make sure it is defined within a `@layer` directive.

Change

Replace the cross-file custom class with the Tailwind utilities it provided (transition, rounded-md, p-1, -m-1). The hover background, underline, and color rules in markdown.css are unchanged.

The expand-animation part of .link is a custom class as well and is not applied here. If you want to keep that scale animation, the shared class would need to move to a file processed together with markdown.css.

Verification

  • Before: pnpm build on a clean main checkout fails with the link class error above.
  • After: pnpm build completes (8 pages, Pagefind index built).
  • pnpm check still reports the two existing TypeScript errors in src/components/Navbar.astro:54 and src/pages/archive.astro:12; they are present on unmodified main and are unrelated to this CSS change.

Tailwind processes the markdown stylesheet separately, so applying the
custom `link` component class from main.css fails on clean builds with
"The `link` class does not exist".

Replace it with the equivalent Tailwind utilities (transition, rounded
corners, padding, and negative margin). The hover background and link
decoration rules in markdown.css are unchanged.
@vercel

vercel Bot commented Nov 14, 2026

Copy link
Copy Markdown

@Henglie is attempting to deploy a commit to the zephyirdgmailcom's projects Team on Vercel.

A member of the Team first needs to authorize it.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant