Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change widths of components inside card to be their contents width #2827

Merged
merged 5 commits into from
Oct 12, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/components/card/_card.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
&__link {
display: flex;
flex-direction: column;
margin-bottom: 1rem;
width: fit-content;
}

&__remove--margin {
margin-bottom: 0;
}
adi-unni marked this conversation as resolved.
Show resolved Hide resolved

&__image--reorder {
Expand Down
18 changes: 9 additions & 9 deletions src/components/card/_macro.njk
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
{%- if params.url -%}
adi-unni marked this conversation as resolved.
Show resolved Hide resolved
<a href="{{ params.url }}" class="ons-card__link">
{%- endif -%}
<h{{ titleSize }} class="ons-card__title ons-card__title--reorder {{ params.titleClasses | default('ons-u-fs-m')}}" id="{{ params.id }}">
<h{{ titleSize }} class="ons-card__title ons-card__title--reorder {{ params.titleClasses | default('ons-u-fs-m')}} ons-card__remove--margin" id="{{ params.id }}">
{{ params.title }}
</h{{ titleSize }}>
{% if params.image.smallSrc %}
Expand All @@ -24,15 +24,15 @@

{%- else -%}

<h{{ titleSize }} class="ons-card__title {{ params.titleClasses | default('ons-u-fs-m') }}" id="{{ params.id }}">
{%- if params.url -%}
<a class="ons-card__link" href="{{ params.url }}">
{%- endif -%}
{%- if params.url -%}
<a class="ons-card__link" href="{{ params.url }}">
{%- endif -%}
<h{{ titleSize }} class="ons-card__title ons-card__title--reorder {{ params.titleClasses | default('ons-u-fs-m')}} ons-card__remove--margin" id="{{ params.id }}">
{{ params.title }}
{%- if params.url -%}
</a>
{%- endif -%}
</h{{ titleSize }}>
</h{{ titleSize }}>
{%- if params.url -%}
</a>
{%- endif -%}
adi-unni marked this conversation as resolved.
Show resolved Hide resolved

{%- endif -%}

Expand Down
Loading