Skip to content

Commit 3892e76

Browse files
committed
fix: extends svelte/element for Layout
1 parent 225e720 commit 3892e76

File tree

2 files changed

+9
-13
lines changed

2 files changed

+9
-13
lines changed

src/lib/typography/Layout.svelte

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,24 @@
11
<script lang="ts">
22
import type { Snippet } from 'svelte';
33
import { twMerge } from 'tailwind-merge';
4+
import type { HTMLAttributes } from 'svelte/elements';
45
5-
interface Props {
6+
interface Props extends HTMLAttributes<HTMLElement>{
67
children: Snippet;
7-
divClass?: string | undefined;
8-
cols?: string | undefined;
9-
// gap?: number;
8+
class?: string | undefined;
109
}
1110
1211
let {
1312
children,
14-
divClass,
15-
cols = '',
13+
class: className,
1614
...attributes
1715
}: Props = $props();
1816
19-
let classDiv = twMerge('grid grid-cols-1 sm:grid-cols-2', cols, divClass);
17+
let classDiv = twMerge('grid grid-cols-1 sm:grid-cols-2', className);
2018
</script>
2119

2220
<div {...attributes} class={classDiv}>
23-
24-
{@render children()}
25-
21+
{@render children()}
2622
</div>
2723

2824
<!--

src/routes/typography/paragraph/+page.svelte

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@
175175
tools, so your IT support and operations teams have richer contextual
176176
information to rapidly respond to requests, incidents, and changes.</P
177177
>
178-
<Layout divClass="gap-6">
178+
<Layout class="gap-6">
179179
<P class="mb-3" weight="light" color="text-gray-500 dark:text-gray-400"
180180
>Track work across the enterprise through an open, collaborative platform.
181181
Link issues across Jira and ingest data from other software development
@@ -207,7 +207,7 @@
207207
tools, so your IT support and operations teams have richer contextual
208208
information to rapidly respond to requests, incidents, and changes.</P
209209
>
210-
<Layout divClass="gap-6" cols="grid-cols-1 sm:grid-cols-3">
210+
<Layout class="gap-6 grid-cols-1 sm:grid-cols-3">
211211
<P class="mb-3" weight="light" color="text-gray-500 dark:text-gray-400"
212212
>Track work across the enterprise through an open, collaborative platform.
213213
Link issues across Jira and ingest data from other software development
@@ -246,7 +246,7 @@
246246
tools, so your IT support and operations teams have richer contextual
247247
information to rapidly respond to requests, incidents, and changes.</P
248248
>
249-
<Layout divClass="gap-6" cols="grid-cols-1 sm:grid-cols-3">
249+
<Layout class="gap-6 grid-cols-1 sm:grid-cols-3">
250250
<div class="col-span-2">
251251
<P class="mb-3" weight="light" color="text-gray-500 dark:text-gray-400"
252252
>Track work across the enterprise through an open, collaborative

0 commit comments

Comments
 (0)