From 960ed9540d443e0d577d7aefe1918b74343f4e0e Mon Sep 17 00:00:00 2001 From: shpuld Date: Sat, 25 Feb 2017 14:34:05 +0200 Subject: [PATCH 1/2] Make use of template literals instead of string concat. --- src/components/user_card_content/user_card_content.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/user_card_content/user_card_content.vue b/src/components/user_card_content/user_card_content.vue index a30eadf5..4dc1c6f1 100644 --- a/src/components/user_card_content/user_card_content.vue +++ b/src/components/user_card_content/user_card_content.vue @@ -63,15 +63,15 @@ headingStyle () { let rgb = this.$store.state.config.colors['base00'].match(/\d+/g) return { - backgroundColor: 'rgb(' + Math.floor(rgb[0] * 0.53) + ', ' + - Math.floor(rgb[1] * 0.56) + ', ' + - Math.floor(rgb[2] * 0.59) + ')', + backgroundColor: `rgb(${Math.floor(rgb[0] * 0.53)}, + ${Math.floor(rgb[1] * 0.56)}, + ${Math.floor(rgb[2] * 0.59)})`, backgroundImage: `url(${this.user.cover_photo})` } }, bodyStyle () { return { - background: 'linear-gradient(to bottom, rgba(0, 0, 0, 0), ' + this.$store.state.config.colors['base00'] + ' 80%)' + background: `linear-gradient(to bottom, rgba(0, 0, 0, 0), ${this.$store.state.config.colors['base00']} 80%)` } }, isOtherUser () { From 8c43b3f505c6bee344a85dc33a927f123062a268 Mon Sep 17 00:00:00 2001 From: shpuld Date: Sun, 26 Feb 2017 22:42:22 +0200 Subject: [PATCH 2/2] Remove newlines from template literal. --- src/components/user_card_content/user_card_content.vue | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/components/user_card_content/user_card_content.vue b/src/components/user_card_content/user_card_content.vue index 4dc1c6f1..6b01133c 100644 --- a/src/components/user_card_content/user_card_content.vue +++ b/src/components/user_card_content/user_card_content.vue @@ -63,9 +63,7 @@ headingStyle () { let rgb = this.$store.state.config.colors['base00'].match(/\d+/g) return { - backgroundColor: `rgb(${Math.floor(rgb[0] * 0.53)}, - ${Math.floor(rgb[1] * 0.56)}, - ${Math.floor(rgb[2] * 0.59)})`, + backgroundColor: `rgb(${Math.floor(rgb[0] * 0.53)}, ${Math.floor(rgb[1] * 0.56)}, ${Math.floor(rgb[2] * 0.59)})`, backgroundImage: `url(${this.user.cover_photo})` } },