Skip to content

Commit

Permalink
feat: Make icon components functional
Browse files Browse the repository at this point in the history
BREAKING CHANGE: This patch changes the components to be functional,
which makes them lightweight, but also may alter behaviour in some edge
cases. Marking as breaking change to be remain cautious
  • Loading branch information
danielroe authored and robcresswell committed Sep 8, 2019
1 parent c839ec5 commit 4a0dead
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions template.mst
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
{{=<% %>=}}
<template>
<span :aria-hidden="decorative"
:aria-label="title"
<template functional>
<span :aria-hidden="props.decorative"
:aria-label="props.title"
:class="[data.class, data.staticClass]"
class="material-design-icon <%title%>-icon"
role="img"
@click="$emit('click', $event)">
<svg :fill="fillColor"
@click="listeners.click ? listeners.click : () => true">
<svg :fill="props.fillColor"
class="material-design-icon__svg"
:width="size"
:height="size"
:width="props.size"
:height="props.size"
viewBox="0 0 24 24">
<path d="<%{svgPathData}%>">
<title>{{ title }}</title>
<title>{{ props.title }}</title>
</path>
</svg>
</span>
Expand Down

0 comments on commit 4a0dead

Please sign in to comment.