Skip to content

Commit

Permalink
[@mantine/core] BackgroundImage: Fix image not loading if given image…
Browse files Browse the repository at this point in the history
… url contains whitespace (mantinedev#4715)

* Add double quotes to wrap src for backgroundImage

* Add double quotes to wrap src for backgroundImage property
  • Loading branch information
blueagler authored and Arel Cordero committed Sep 13, 2023
1 parent 890c0d8 commit 64698f0
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/src/components/HomePage/Banner/Banner.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export default createStyles((theme) => ({
minHeight: rem(500),
width: rem(800),
flex: 1,
backgroundImage: `url(${banner})`,
backgroundImage: `url('${banner}')`,
backgroundSize: 'auto 100%',
backgroundRepeat: 'no-repeat',
backgroundPosition: 'right',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default createStyles((theme, { radius, src }: BackgroundImageStylesParams
border: 0,
textDecoration: 'none',
color: theme.colorScheme === 'dark' ? theme.colors.dark[0] : theme.black,
backgroundImage: `url(${src})`,
backgroundImage: `url('${src}')`,
borderRadius: theme.fn.radius(radius),
},
}));
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function Card({ image, title, category }: CardProps) {
shadow="md"
p="xl"
radius="md"
sx={{ backgroundImage: \`url(\${image})\` }}
sx={{ backgroundImage: \`url('\${image}')\` }}
className={classes.card}
>
<div>
Expand Down
2 changes: 1 addition & 1 deletion src/mantine-demos/src/demos/carousel/_card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export function Card({ image, title, category }: CardProps) {
shadow="md"
p="xl"
radius="md"
sx={{ backgroundImage: `url(${image})` }}
sx={{ backgroundImage: `url('${image}')` }}
className={classes.card}
>
<div>
Expand Down

0 comments on commit 64698f0

Please sign in to comment.