Created
August 28, 2022 05:19
-
-
Save nomyfan/62c8ca632fbb4ecbbf549473af4cc604 to your computer and use it in GitHub Desktop.
Color tinting - wrapper solution
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
.box { | |
width: 300px; | |
height: 250px; | |
background-color: cornflowerblue; | |
transition: 0.5s background-color; | |
background-size: cover; | |
background-position: center; | |
} | |
.box:hover { | |
background-color: transparent; | |
} | |
.box > img { | |
object-fit: cover; | |
height: 100%; | |
width: 100%; | |
mix-blend-mode: luminosity; | |
} |
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
import "./App.css"; | |
import React from "react"; | |
import image from "./philip-myrtorp-WqD_gO_xFgg-unsplash.jpg"; | |
function App() { | |
return ( | |
<div className="box"> | |
<img src={image} /> | |
</div> | |
); | |
} | |
export default App; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment