Skip to content

Commit

Permalink
Created ColorStripe Component
Browse files Browse the repository at this point in the history
  • Loading branch information
j-barreiros committed Jan 7, 2023
1 parent 09e6dea commit c918275
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
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;
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;

0 comments on commit c918275

Please sign in to comment.