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

Theme icons #595

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from
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
19 changes: 19 additions & 0 deletions templates/_partials/helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,22 @@
>
</a>
{/function}

{function renderIcon iconGroup="material-icons" iconName="" ariaHidden="true" ariaLabel="" extraAttributes=[]}
{if isset($iconsMap) && !empty($iconsMap[$iconGroup]) && $iconName && !empty($iconsMap[$iconGroup][$iconName])}
<i
class="{$iconGroup}{if !empty($extraAttributes['class'])} {$extraAttributes['class']}{/if}"
aria-hidden="{$ariaHidden}"
{if !$ariaHidden && !empty($ariaLabel)}
aria-label="{$ariaLabel}"
{/if}
{foreach $extraAttributes as $key => $value}
{if $key != 'class'}
{$key}="{$value}"
{/if}
{/foreach}
>
{$iconsMap[$iconGroup][$iconName]}
</i>
{/if}
{/function}
112 changes: 112 additions & 0 deletions templates/_partials/variables.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
{assign
var=iconsMap
value=[
"material-icons" => [
"chevron_right" => "chevron_right",
"chevron_left" => "chevron_left",
"chevron_up" => "expand_less",
"chevron_down" => "expand_more",
"arrow_right" => "arrow_backward",
"arrow_left" => "arrow_forward",
"arrow_up" => "arrow_upward",
"arrow_down" => "arrow_downward",
"caret_right" => "arrow_right",
"caret_left" => "arrow_left",
"caret_up" => "arrow_drop_up",
"caret_down" => "arrow_drop_down",

"info" => "info",
"info_alt" => "info",
"success" => "check",
"success_alt" => "check",
"warning" => "warning",
"warning_alt" => "warning",
"danger" => "error",
"danger_alt" => "error",

"close" => "close",
"close_alt" => "close",

"phone" => "phone",
"fax" => "fax",
"mail" => "mail",
"location" => "place",

"add" => "add_circle_outline",
"add_alt" => "add_circle_outline",
"edit" => "edit",
"edit_alt" => "edit",
"delete" => "remove",
"delete_alt" => "remove_circle_outline",

"submit" => "check",
"cancel" => "close",

"dropdown" => "arrow_drop_down",
"toggler" => "menu",
"download" => "download",
"pdf" => "picture_as_pdf",
"search" => "search",
"clear" => "clear",
"home" => "home",
"sort" => "sort",

"previous" => "arrow_backward",
"next" => "arrow_forward",

"expand" => "expand_more",
"collapse" => "expand_less",

"account" => "person",
"account_settings" => "manage_accounts",
"account_info" => "account_circle",
"account_addresses" => "person_pin_circle",
"account_first_address" => "add_location",
"account_orders" => "date_range",
"account_slips" => "receipt",
"account_vouchers" => "local_offer",
"account_returns" => "assignment_return",
"account_mailalerts" => "drafts",
"account_gdpr" => "account_box",
"account_wishlists" => "favorite",

"addresses" => "person_pin_circle",
"add_address" => "add_location",
"delete_address" => "delete",
"edit_address" => "edit",

"cart" => "shopping_cart",
"add_to_cart" => "add_shopping_cart",
"remove_from_cart" => "remove_shopping_cart",

"wishlists" => "favorite",
"add_to_wishlist" => "favorite_border",
"remove_from_wishlist" => "favorite",

"log_in" => "person",
"log_out" => "exit_to_app",

"increment" => "add",
"decrement" => "remove",

"show_password" => "visibility",
"hide_password" => "visibility_off",

"comments" => "chat",
"add_comment" => "edit",
"edit_comments" => "edit",

"pagination_first" => "first_page",
"pagination_last" => "last_page",
"pagination_previous" => "chevron_left",
"pagination_next" => "chevron_right",

"zoom" => "search",
"zoom_in" => "search",
"zoom_out" => "search",

"edit_order_step" => "edit"
]
]
scope="global"
}
1 change: 1 addition & 0 deletions templates/layouts/layout-both-columns.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* file that was distributed with this source code.
*}

{include file='_partials/variables.tpl'}
{include file='_partials/helpers.tpl'}

<!doctype html>
Expand Down
Loading