Skip to content

Commit 6f5d0c7

Browse files
makhmudjon-inadullaevMakhmudjon Inadullaev
andauthored
color ratio fixed (npm#290)
Co-authored-by: Makhmudjon Inadullaev <makhmudjon@Makhmudjons-MacBook-Pro-2.local>
1 parent 29a5c51 commit 6f5d0c7

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

theme/src/components/clipboard-copy.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
1-
import {Button, StyledOcticon} from '@primer/components'
1+
import {Button, StyledOcticon, themeGet} from '@primer/components'
22
import {CheckIcon, CopyIcon} from '@primer/octicons-react'
3+
import styled from 'styled-components'
34
import copy from 'copy-to-clipboard'
45
import React from 'react'
56

7+
const CopyToClipboard = styled(Button)`
8+
&:focus {
9+
box-shadow: 0 0 0 3px ${themeGet('colors.blue.5')};
10+
}
11+
`
12+
613
function ClipboardCopy({value}) {
714
const [copied, setCopied] = React.useState(false)
815

@@ -15,15 +22,15 @@ function ClipboardCopy({value}) {
1522
}, [copied])
1623

1724
return (
18-
<Button
25+
<CopyToClipboard
1926
aria-label="Copy to clipboard"
2027
onClick={() => {
2128
copy(value)
2229
setCopied(true)
2330
}}
2431
>
2532
{copied ? <StyledOcticon icon={CheckIcon} color="green.5" /> : <StyledOcticon icon={CopyIcon} color="gray.7" />}
26-
</Button>
33+
</CopyToClipboard>
2734
)
2835
}
2936

0 commit comments

Comments
 (0)