Skip to content

Commit

Permalink
feat: #1844 change vf bookmark into a button element (#1852)
Browse files Browse the repository at this point in the history
* changes the default icon for inline version to a heart

* updates to a button element
  • Loading branch information
kasprzyk-sz authored Feb 2, 2023
1 parent 91be73f commit 264d8e3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion components/vf-bookmark/vf-bookmark.config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ variants:
label_active: Bookmarked
is_active: true
modifier: inline
icon: star
icon: heart
# Global component context
context:
component-type: element
Expand Down
6 changes: 3 additions & 3 deletions components/vf-bookmark/vf-bookmark.njk
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@
<g transform="matrix(10,0,0,10,0,0)"><path d="M11,13.5l-4-4-4,4V1.5a1,1,0,0,1,1-1h6a1,1,0,0,1,1,1Z"></path></g></svg>
{%- endset -%}

<a href="{{ bookmark_href }}" class="vf-bookmark
<button onclick="location.href='{{ bookmark_href }}';" class="vf-bookmark
{% if is_active -%}vf-bookmark--active{%- endif %} vf-bookmark--{{ modifier }}
|
{% if modifier == "button" -%}
vf-button vf-button--secondary
{%- elseif modifier == "inline" -%}
vf-link
vf-button vf-button--link
{%- endif %}
">
{% if icon == "heart" -%}
Expand All @@ -46,7 +46,7 @@ vf-link
{%- else -%}
{{ label_inactive }}
{%- endif %}
</a>
</button>

{# You can do Nunjucks logic in your templates that references the .yml settings
What's Nunjucks: https://mozilla.github.io/nunjucks/templating.html #}
Expand Down

0 comments on commit 264d8e3

Please sign in to comment.