Skip to content
This repository was archived by the owner on Apr 11, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 2 additions & 2 deletions src/accordion/accordion.macros.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
*
#}

{% from 'icons/icons.macros.html' import icon %}
{% from 'links/links.macros.html' import link %}
{% from '../icons/icons.macros.html' import icon %}
{% from '../links/links.macros.html' import link %}

{#
* Renders a special list for content within accordions
Expand Down
16 changes: 16 additions & 0 deletions src/icons/icons.macros.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,25 @@
{#
* @overview Macros for SVG icons.
* @module Icons
* @todo: Add examples of icon_class and icon sizes
#}

{#
* Renders an icon with use method. Used for uniquely sized icons.
* @param {string} name - Name of the icon (nightshade.rocks/icons)
* @param {string} [icon_class=true] - Class name for style or JS targeting
#}
{% macro svg(name, icon_class=true) %}
<svg class="icon{% if icon_class %} icon-{{ name }}{% endif %}" aria-labelledby="title" role="img">
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#{{ name }}"></use>
</svg>
{% endmacro %}

{#
* Renders an icon using set sizes
* @param {string} name - Name of the icon (nightshade.rocks/icons)
* @param {string} [size=default] - Size of the icon from preset values
#}
{% macro icon(name, size="default") %}
<span data-icon="{{ name }}" data-size="{{ size }}">
{{ svg(name, false) }}
Expand Down
2 changes: 1 addition & 1 deletion src/links/links.macros.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @todo Consider moving this to typography when we revise type
#}

{% from 'icons/icons.macros.html' import icon as icon_macro %}
{% from '../icons/icons.macros.html' import icon as icon_macro %}

{#
* Renders a link
Expand Down
2 changes: 1 addition & 1 deletion src/lists/lists.macros.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @TODO rename to list-heading
#}

{% from 'nightshade-core/src/links/links.macros.html' import link, link_icon %}
{% from '../links/links.macros.html' import link, link_icon %}

{#
* Renders a List of links
Expand Down