From 79b33cea1c6d1c33ece42fdfa7967db81acdea03 Mon Sep 17 00:00:00 2001 From: Juan Cruz Viotti Date: Mon, 18 Jan 2016 10:05:13 -0400 Subject: [PATCH] Allow customising hero-icon size using HTML attributes --- lib/components/hero-icon.html | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/components/hero-icon.html b/lib/components/hero-icon.html index e275f969..5088e845 100644 --- a/lib/components/hero-icon.html +++ b/lib/components/hero-icon.html @@ -10,8 +10,6 @@ :host ::content .icon { margin: 0 auto; - height: 40px; - width: 40px; }
@@ -32,6 +30,12 @@ properties: { path: { type: String + }, + width: { + type: String + }, + height: { + type: String } }, ready: function() { @@ -40,7 +44,10 @@ var contents = fs.readFileSync(imagePath, { encoding: 'utf8' }); + iconElement.innerHTML = contents; + iconElement.style.width = this.width || '40px'; + iconElement.style.height = this.height || '40px'; } });