1 звезда на GitHub = 1 новый компонент.

Поставить звезду
Макеты и Сетки layoutfull-widthdesign

Full Bleed Section

Полноэкранная секция от края до края для иммерсивных баннеров и медиа.

Живое превью

Full Bleed Section

Использование

Скопируйте и вставьте этот код на вашу страницу Astro:

astro
---
import { FullBleedSection } from 'astro-component-kit';
---

<FullBleedSection>Content</FullBleedSection>
--- import { FullBleedSection } from 'astro-component-kit'; --- <FullBleedSection>Content</FullBleedSection>

Ручная установка

Если вы не используете пакет npm, создайте файл и вставьте следующий код: src/components/lib/FullBleedSection.astro:

astro
---
/**
 * FullBleedSection — Section that breaks out of the container to hit viewport edges.
 */
interface Props {
  className?: string;
}

const { className = '' } = Astro.props;
---

<section class={`full-bleed ${className}`}>
  <div class="full-bleed-inner">
    <slot>
      <h3>Full Bleed Background Container</h3>
      <p>Content breaks out to full viewport edges while inner content stays readable.</p>
    </slot>
  </div>
</section>

<style>
  .full-bleed {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    background: rgba(30, 41, 59, 0.4);
    border-top: 1px solid rgb(var(--ink-rgb, 255 255 255) / 0.06);
    border-bottom: 1px solid rgb(var(--ink-rgb, 255 255 255) / 0.06);
    padding: 3.5rem 1.5rem;
    box-sizing: border-box;
  }
  .full-bleed-inner {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
  }
  .full-bleed-inner h3 {
    color: #fff;
    margin-bottom: 0.5rem;
  }
  .full-bleed-inner p {
    color: #94a3b8;
    margin: 0;
  }
</style>
--- /** * FullBleedSection — Section that breaks out of the container to hit viewport edges. */ interface Props { className?: string; } const { className = '' } = Astro.props; --- <section class={`full-bleed ${className}`}> <div class="full-bleed-inner"> <slot> <h3>Full Bleed Background Container</h3> <p>Content breaks out to full viewport edges while inner content stays readable.</p> </slot> </div> </section> <style> .full-bleed { width: 100vw; position: relative; left: 50%; right: 50%; margin-left: -50vw; margin-right: -50vw; background: rgba(30, 41, 59, 0.4); border-top: 1px solid rgb(var(--ink-rgb, 255 255 255) / 0.06); border-bottom: 1px solid rgb(var(--ink-rgb, 255 255 255) / 0.06); padding: 3.5rem 1.5rem; box-sizing: border-box; } .full-bleed-inner { max-width: 1200px; margin: 0 auto; text-align: center; } .full-bleed-inner h3 { color: #fff; margin-bottom: 0.5rem; } .full-bleed-inner p { color: #94a3b8; margin: 0; } </style>

Краткая информация

Категория
Макеты и Сетки
Имя файла
FullBleedSection.astro
Зависимости
Нет — чистый Astro + CSS
Теги
layoutfull-widthdesign