Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add <LinkButton> component #1784

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open

Conversation

HiDeoo
Copy link
Member

@HiDeoo HiDeoo commented Apr 25, 2024

What kind of changes does this PR include?

  • Changes or translations of Starlight docs site content
  • Changes to Starlight code

Description

This PR adds a new <LinkButton> component adressing the request in the built-in components discussion.

Preview playground page: https://starlight-git-fork-hideoo-hd-feat-link-button-astrodotbuild.vercel.app/guides/components/#link-buttons

Visually, this is almost identical to the internal <CallToAction> component (now removed and replaced by the new component) that was used for actions in the hero component.

The name is still up for discussion, some design system use CTALink or CallToAction but this may not be obvious to everyone. Some others use ButtonLink but as pointed out by Chris, we already have a <LinkCard> component so this uses the same pattern.
Using something like <Button> may be confusing as this is a link that should be used for navigation and not a form primitive for example.

Remaining tasks

  • Remove demo style (docs/src/assets/landing.css)
  • Remove demo page (docs/src/content/docs/reference/link-button.mdx)

Copy link

vercel bot commented Apr 25, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
starlight ✅ Ready (Inspect) Visit Preview May 3, 2024 2:11pm

Copy link

changeset-bot bot commented Apr 25, 2024

🦋 Changeset detected

Latest commit: 54beb60

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@astrojs/starlight Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added 📚 docs Documentation website changes 🌟 core Changes to Starlight’s main package labels Apr 25, 2024
@astrobot-houston
Copy link
Collaborator

astrobot-houston commented Apr 25, 2024

Lunaria Status Overview

🌕 This pull request will trigger status changes.

Learn more

By default, every PR changing files present in the Lunaria configuration's files property will be considered and trigger status changes accordingly.

You can change this by adding one of the keywords present in the ignoreKeywords property in your Lunaria configuration file in the PR's title (ignoring all files) or by including a tracker directive in the merged commit's description.

Tracked Files

Locale File Note
en guides/components.mdx Source changed, localizations will be marked as outdated.
en index.mdx Source changed, localizations will be marked as outdated.
en reference/frontmatter.md Source changed, localizations will be marked as outdated.
Warnings reference
Icon Description
🔄️ The source for this localization has been updated since the creation of this pull request, make sure all changes in the source have been applied.

Comment on lines +65 to +68
.sl-markdown-content a:not(:where(:is(.not-content, .not-content *))) {
color: var(--sl-color-text-accent);
}
.sl-markdown-content a:hover:not(:where(.not-content *)) {
.sl-markdown-content a:hover:not(:where(:is(.not-content, .not-content *))) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes are used to avoid <LinkButton> getting Markdown link styles applied to it by specifying the not-content class on the link itself and not a wrapping element.

I'm wondering if this is a change that could be applied to some other places to avoid relying on a wrapping element to avoid Markdown styles 🤔

@HiDeoo
Copy link
Member Author

HiDeoo commented Apr 29, 2024

Following the last Talking & Doc'ing session discussions, I updated the pull request to include the following changes:

  • The <LinkButton> variant now defaults to primary instead of minimal.
  • The hero component action button variant now defaults to primary instead of minimal.

HiDeoo added 4 commits May 3, 2024 12:13
* main: (57 commits)
  Add type checking job to the CI workflow (withastro#1827)
  [ci] format
  i18n(pt-BR): Update `components.mdx` (withastro#1815)
  [ci] format
  i18n(ru): update translations (withastro#1825)
  i18n(pt-BR): Update `css-and-tailwind.mdx` (withastro#1817)
  i18n(es): updates `pages` (withastro#1823)
  i18n(es): update `i18n` (withastro#1822)
  i18n(es): updates `overrides` (withastro#1820)
  i18n(es): update `guides/components` and add `syncKey` to various pages (withastro#1818)
  [ci] format
  i18n(es): update `community-content` (withastro#1824)
  i18n(es): update `configuration` (withastro#1821)
  i18n(es): update `frontmatter` (withastro#1819)
  i18n(fr): update `guides/pages.mdx` (withastro#1800)
  i18n(fr): update `reference/overrides.md` (withastro#1803)
  i18n(fr): update `reference/frontmatter.md` (withastro#1802)
  i18n(fr): update `reference/configuration.mdx` (withastro#1801)
  i18n(fr): update `guides/i18n.mdx` (withastro#1799)
  i18n(fr): update `guides/components` and add `syncKey` to various pages (withastro#1797)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌟 core Changes to Starlight’s main package 📚 docs Documentation website changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants