Skip to content

Commit 30a140f

Browse files
committed
minor #2711 [Toolkit] Remove redundant code in Shadcn kit components (Kocal)
This PR was merged into the 2.x branch. Discussion ---------- [Toolkit] Remove redundant code in Shadcn kit components | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Docs? | yes/no <!-- required for new features --> | Issues | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead --> | License | MIT Small PR on the plane ✈️ , by removing redundant and not so much useful code from Toolkit's Shadcn components. Commits ------- f204999 [Toolkit] Remove redundant code in Shadcn kit components
2 parents 06b78be + f204999 commit 30a140f

39 files changed

+39
-39
lines changed

src/Toolkit/kits/shadcn/templates/components/Alert.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<div
1313
class="{{ style.apply({variant}, attributes.render('class'))|tailwind_merge }}"
1414
role="alert"
15-
{{ attributes.defaults({role: 'alert'}).without('class') }}
15+
{{ attributes }}
1616
>
1717
{%- block content %}{% endblock -%}
1818
</div>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<p
22
class="{{ 'text-sm [&_p]:leading-relaxed ' ~ attributes.render('class')|tailwind_merge }}"
3-
{{ attributes.defaults({}).without('class') }}
3+
{{ attributes }}
44
>
55
{%- block content %}{% endblock -%}
66
</p>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<h5
22
class="{{ 'mb-1 font-medium leading-none tracking-tight ' ~ attributes.render('class')|tailwind_merge }}"
3-
{{ attributes.defaults({}).without('class') }}
3+
{{ attributes }}
44
>
55
{%- block content %}{% endblock -%}
66
</h5>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{%- props ratio, style = '' -%}
22
<div
33
style="aspect-ratio: {{ ratio }}; {{ style }}"
4-
{{ attributes.defaults({}).without('style') }}
4+
{{ attributes.without('style') }}
55
>
66
{%- block content %}{% endblock -%}
77
</div>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<span
22
class="{{ 'relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full ' ~ attributes.render('class')|tailwind_merge }}"
3-
{{ attributes.defaults({}).without('class') }}
3+
{{ attributes }}
44
>
55
{%- block content %}{% endblock -%}
66
</span>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<img
22
class="{{ 'aspect-square h-full w-full ' ~ attributes.render('class')|tailwind_merge }}"
3-
{{ attributes.defaults({alt: ''}).without('class') }}
3+
{{ attributes.defaults({alt: ''}) }}
44
/>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<span
22
class="{{ 'flex h-full w-full items-center justify-center rounded-full bg-muted ' ~ attributes.render('class')|tailwind_merge }}"
3-
{{ attributes.defaults({}).without('class') }}
3+
{{ attributes }}
44
>
55
{%- block content %}{% endblock -%}
66
</span>

src/Toolkit/kits/shadcn/templates/components/Badge.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
) -%}
1313
<div
1414
class="{{ style.apply({variant, outline}, attributes.render('class'))|tailwind_merge }}"
15-
{{ attributes.defaults({}).without('class') }}
15+
{{ attributes }}
1616
>
1717
{%- block content %}{% endblock -%}
1818
</div>

src/Toolkit/kits/shadcn/templates/components/Breadcrumb/Ellipsis.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<span
22
class="{{ 'flex h-9 w-9 items-center justify-center ' ~ attributes.render('class')|tailwind_merge }}"
3-
{{ attributes.defaults({}).without('class') }}
3+
{{ attributes }}
44
role="presentation"
55
aria-hidden="true"
66
>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<li
22
class="{{ 'inline-flex items-center gap-1.5 ' ~ attributes.render('class')|tailwind_merge }}"
3-
{{ attributes.defaults({}).without('class') }}
3+
{{ attributes }}
44
>
55
{%- block content %}{% endblock -%}
66
</li>

0 commit comments

Comments
 (0)