Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(hero): backgroundImage should cover whole elements area on mobile [ES-387] #3089

Merged
merged 3 commits into from
Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion apps/docs/components/blocks/Banners.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,17 @@ Four vertical displays in row on desktop.

## Hero

Hero acts like a layout for your hero section. You can provide main image and any content, as well as background images for mobile and desktop devices.
The Hero component simplifies the process of creating stunning hero sections for your website. With Hero, you have the flexibility to seamlessly integrate a main image and customize your content to suit your needs. Additionally, Hero allows adding background images tailored for both mobile and desktop devices. To ensure an optimal blend of performance and visual appeal, we recommend adhering to the following image guidelines:

Desktop Background Images:
Minimum width: 3840px
Aspect ratio: 4:1.5
Example size: 3840px x 1440px

Mobile Background Images:
Minimum width: 768px
Aspect ratio: 3:4
Example size: 768px x 1024px

<Showcase showcase-name="Banners/Hero" style="min-height:620px">

Expand Down
4 changes: 2 additions & 2 deletions apps/preview/next/pages/showcases/Banners/Hero.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import { SfButton } from '@storefront-ui/react';

export default function Hero() {
return (
<div className="relative min-h-[600px]">
<div className="relative min-h-[576px]">
<picture>
<source srcSet="http://localhost:3100/@assets/hero-bg.png" media="(min-width: 768px)" />
<img
src="http://localhost:3100/@assets/hero-bg-mobile.png"
className="absolute w-full h-full z-[-1] md:object-cover"
className="absolute w-full h-full z-[-1] object-cover"
/>
</picture>
<div className="md:flex md:flex-row-reverse md:justify-center min-h-[600px] max-w-[1536px] mx-auto">
Expand Down
4 changes: 2 additions & 2 deletions apps/preview/nuxt/pages/showcases/Banners/Hero.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<template>
<div class="relative min-h-[600px]">
<div class="relative min-h-[576px]">
<picture>
<source srcset="http://localhost:3100/@assets/hero-bg.png" media="(min-width: 768px)" />
<img
src="http://localhost:3100/@assets/hero-bg-mobile.png"
class="absolute w-full h-full z-[-1] md:object-cover"
class="absolute w-full h-full z-[-1] object-cover"
alt="hero"
/>
</picture>
Expand Down
Loading