-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
09e6dea
commit c918275
Showing
2 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
src/components/PalleteDisplay/PalleteItem/ColorStripe/ColorStripe.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import StyledColorStripe from "./StyledColorStripe"; | ||
|
||
type ColorStripeProps = { | ||
colorValue:string; | ||
} | ||
|
||
const ColorStripe = ({colorValue} : ColorStripeProps) => { | ||
return ( | ||
<StyledColorStripe color={colorValue}> | ||
<p className='color-value'>{colorValue}</p> | ||
</StyledColorStripe> | ||
) | ||
} | ||
|
||
export default ColorStripe; |
28 changes: 28 additions & 0 deletions
28
src/components/PalleteDisplay/PalleteItem/ColorStripe/StyledColorStripe.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import styled from "styled-components"; | ||
|
||
type StyledColorStripeProps = { | ||
color: string; | ||
} | ||
|
||
const StyledColorStripe = styled.article` | ||
background-color: ${props => props.color}; | ||
display: flex; | ||
align-items: flex-end; | ||
font-size: 15px; | ||
&:hover { | ||
.color-value { | ||
display: block; | ||
} | ||
} | ||
.color-value { | ||
display: none; | ||
padding: 5px 3px; | ||
background-color: rgba(0,0,0,50%); | ||
color: #fff; | ||
cursor: pointer; | ||
} | ||
` | ||
|
||
export default StyledColorStripe; |