Skip to content

Commit 3184529

Browse files
committed
#3403 Hero bg image white faded toggle
1 parent 93a2619 commit 3184529

File tree

4 files changed

+10
-2
lines changed

4 files changed

+10
-2
lines changed

studio/schemas/objects/imageWithAlt.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@ export default {
2828
description:
2929
'If this image is purely decorative you can disable the alt tag input here. Please note that this makes the image invisible for screen reader users.',
3030
},
31+
{
32+
title: 'Apply light gradient',
33+
name: 'useLight',
34+
type: 'boolean',
35+
description:
36+
'Applies a white gradient over semi transparent background image.',
37+
},
3138
{
3239
name: 'alt',
3340
type: 'string',

web/core/Backgrounds/ImageBackgroundContainer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export const ImageBackgroundContainer = ({
6464
${useLight ? '' : 'dark'}
6565
w-full
6666
h-full
67-
${useAnimation && isLargerDisplays ? `bg-fixed ${fadedFilter}` : 'bg-local'}
67+
${(useAnimation && isLargerDisplays) ? `bg-fixed ${fadedFilter}` : 'bg-local'}
6868
bg-center
6969
bg-no-repeat
7070
bg-cover

web/sections/Hero/TextOnBackgroundImageHero.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ export const TextOnBackgroundImageHero = ({
1919
return (
2020
<ImageBackgroundContainer
2121
image={image as ImageWithAlt}
22-
overrideGradient
2322
scrimClassName='py-40 lg:py-44 black-blue-center-gradient'
2423
aspectRatio={'9:16'}
24+
useLight={image?.useLight}
2525
>
2626
<div className='px-layout-lg max-lg:py-11'>
2727
{/*@ts-ignore */}

web/types/imageTypes.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export type ImageWithAlt = {
1515
hotspot?: SanityImageHotspot
1616
_type: 'imageWithAlt'
1717
extension?: string
18+
useLight?: boolean
1819
}
1920

2021
export type ImageWithCaptionData = {

0 commit comments

Comments
 (0)