-
Notifications
You must be signed in to change notification settings - Fork 538
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
BranchName: Add style for span and add v8 tokens #4556
Changes from 3 commits
a7d44d1
717c84b
0c1d39e
e47fe1a
4b103cc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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 |
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> | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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(span) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we make this is not a instead of span? There is also There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you mean There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yep :) |
||
color: var(--fgColor-muted); | ||
} | ||
${sx}; | ||
` | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!