Skip to content

Commit

Permalink
Change widths of components inside card to be their contents width
Browse files Browse the repository at this point in the history
  • Loading branch information
adi-unni committed Oct 5, 2023
1 parent 54708f1 commit 62639ad
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
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;
}

&__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 -%}
<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 -%}

{%- endif -%}

Expand Down

0 comments on commit 62639ad

Please sign in to comment.