Skip to content

Commit

Permalink
Add titleTag prop (h2/h3) in PackageBox
Browse files Browse the repository at this point in the history
  • Loading branch information
smnandre committed Sep 25, 2023
1 parent 6c8fd59 commit 05d1d56
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 6 deletions.
4 changes: 2 additions & 2 deletions ux.symfony.com/assets/styles/app/_typography.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ h2.ubuntu {
h3, a.component-title {
font-family: var(--font-family-title);
font-weight: 700;
font-size: 28px !important;
line-height: 32px !important;
font-size: 28px;
line-height: 32px;
letter-spacing: -1px;
color: #0A0A0A;
text-decoration: none;
Expand Down
8 changes: 8 additions & 0 deletions ux.symfony.com/assets/styles/components/_PackageBox.scss
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,14 @@
flex-direction: row;
align-items: center;
gap: .75rem;

font-family: var(--font-family-title);
font-weight: 700;
font-size: 28px !important;
line-height: 32px !important;
letter-spacing: -1px;
color: #0A0A0A;
text-decoration: none;
}

.PackageBox_link {
Expand Down
2 changes: 2 additions & 0 deletions ux.symfony.com/src/Twig/PackageBox.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@
class PackageBox
{
public UxPackage $package;

public string $titleTag = 'h3';
}
4 changes: 2 additions & 2 deletions ux.symfony.com/templates/components/PackageBox.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
</div>

<div class="PackageBox_content">
<h3 class="PackageBox_title">
<{{ titleTag }} class="PackageBox_title">
<a href="{{ path(package.route) }}" class="PackageBox_link">{{ package.humanName }}</a>
<span class="PackageBox_arrow">
<twig:Icon name="arrow-right" />
</span>
</h3>
</{{ titleTag }}>
<div class="PackageBox_description">
{{ package.description|markdown_to_html }}
</div>
Expand Down
6 changes: 5 additions & 1 deletion ux.symfony.com/templates/main/homepage.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,11 @@
</a>
</div>
<div class="row mt-3 mt-md-5">
{{ block('list', 'main/packages.html.twig') }}
<div style="display: grid; gap: 3rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));">
{% for package in packages %}
<twig:PackageBox :package="package" titleTag="h3" />
{% endfor %}
</div>
</div>
</div>
{% endblock %}
2 changes: 1 addition & 1 deletion ux.symfony.com/templates/main/packages.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
{% block list %}
<div style="display: grid; gap: 3rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));">
{% for package in packages %}
<twig:PackageBox :package="package"/>
<twig:PackageBox :package="package" titleTag="h2" />
{% endfor %}
</div>
{% endblock %}
Expand Down

0 comments on commit 05d1d56

Please sign in to comment.