Skip to content

Commit

Permalink
BranchName: Add style for span and add v8 tokens (#4556)
Browse files Browse the repository at this point in the history
* add style for branchName as span adn add v8 tokens

* added changeset

* Update thin-ligers-turn.md

* test(vrt): update snapshots

* use not a instead of matching for span

---------

Co-authored-by: Siddharth Kshetrapal <siddharthkp@github.com>
Co-authored-by: lukasoppermann <lukasoppermann@users.noreply.github.com>
  • Loading branch information
3 people authored May 3, 2024
1 parent 5c2fb82 commit 9a56727
Show file tree
Hide file tree
Showing 21 changed files with 20 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .changeset/thin-ligers-turn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@primer/react': patch
---

BranchName: Fixing text color when rendered as span
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 7 additions & 1 deletion packages/react/src/BranchName/BranchName.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
import React from 'react'
import type {Meta} from '@storybook/react'
import BranchName from './BranchName'
import {Stack} from '../Stack'

export default {
title: 'Components/BranchName',
component: BranchName,
} as Meta<typeof BranchName>

export const Default = () => <BranchName href="#">branch_name</BranchName>
export const Default = () => (
<Stack align="start">
<BranchName href="#">branch_name</BranchName>
<BranchName as="span">branch_name as span</BranchName>
</Stack>
)
14 changes: 8 additions & 6 deletions packages/react/src/BranchName/BranchName.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ import type {ComponentProps} from '../utils/types'
const BranchName = styled.a<SxProp>`
display: inline-block;
padding: 2px 6px;
font-size: ${get('fontSizes.0')};
font-family: ${get('fonts.mono')};
color: ${get('colors.accent.fg')};
background-color: ${get('colors.accent.subtle')};
border-radius: ${get('radii.2')};
font-size: var(--text-body-size-small, ${get('fontSizes.0')});
font-family: var(--fontStack-monospace, ${get('fonts.mono')});
color: var(--fgColor-link, ${get('colors.accent.fg')});
background-color: var(--bgColor-accent-muted, ${get('colors.accent.subtle')});
border-radius: var(--borderRadius-medium, ${get('radii.2')});
text-decoration: none;
&:is(:not(a)) {
color: var(--fgColor-muted);
}
${sx};
`

Expand Down

0 comments on commit 9a56727

Please sign in to comment.