import { Box } from 'theme-ui' import Image from 'next/image' /* * Use this component inside a container with CSS: * `position: relative; overflow: hidden;` * then pass width/height/alt/src as usual * (you can pass `gradient` valueless to avoid gradient) */ const BGImg = ({ gradient = 'linear-gradient(rgba(0,0,0,0.25), rgba(0,0,0,0.5))', ...props }) => ( span': { height: '100% !important', width: '100% !important' }, img: { objectFit: 'cover', objectPosition: 'center' }, '~ *': { position: 'relative' } }} > ) export default BGImg