hypnagaga/src/components/PaddingReset/PaddingReset.svelte
2025-03-20 12:35:37 -07:00

34 lines
751 B
Svelte

<!-- @component `PaddingReset` [Read the docs.](https://reuters-graphics.github.io/graphics-components/?path=/docs/components-page-layout-paddingreset--docs) -->
<script lang="ts">
import type { Snippet } from 'svelte';
interface Props {
/**
* If parent container is fluid, which resets the padding around contained elements.
*/
containerIsFluid?: boolean;
/**
* Content to be padded.
*/
children: Snippet;
}
let { containerIsFluid = true, children }: Props = $props();
</script>
{#if containerIsFluid}
<div>
<!-- Padded content -->
{@render children()}
</div>
{:else}
<!-- Padded content -->
{@render children()}
{/if}
<style>
div {
width: 100%;
padding: 0 15px;
}
</style>