From 24602755cd879caddf88af01ff7e144db521c5e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8A=B1=E8=A3=A4=E8=A1=A9?= Date: Mon, 17 Sep 2018 13:07:11 +0800 Subject: [PATCH] refactor: svg icons (#1096) * refactor svg * add svgo * refine * add tree.svg * add svg.yml --- package.json | 4 +++- src/icons/svg/404.svg | 2 +- src/icons/svg/bug.svg | 2 +- src/icons/svg/chart.svg | 2 +- src/icons/svg/clipboard.svg | 2 +- src/icons/svg/component.svg | 2 +- src/icons/svg/dashboard.svg | 2 +- src/icons/svg/documentation.svg | 2 +- src/icons/svg/drag.svg | 2 +- src/icons/svg/edit.svg | 2 +- src/icons/svg/email.svg | 2 +- src/icons/svg/example.svg | 2 +- src/icons/svg/excel.svg | 2 +- src/icons/svg/eye.svg | 2 +- src/icons/svg/form.svg | 2 +- src/icons/svg/guide 2.svg | 1 + src/icons/svg/guide.svg | 2 +- src/icons/svg/icon.svg | 2 +- src/icons/svg/international.svg | 2 +- src/icons/svg/language.svg | 2 +- src/icons/svg/link.svg | 2 +- src/icons/svg/list.svg | 2 +- src/icons/svg/lock.svg | 2 +- src/icons/svg/message.svg | 2 +- src/icons/svg/money.svg | 2 +- src/icons/svg/nested.svg | 2 +- src/icons/svg/password.svg | 2 +- src/icons/svg/people.svg | 2 +- src/icons/svg/peoples.svg | 2 +- src/icons/svg/qq.svg | 2 +- src/icons/svg/shopping.svg | 1 + src/icons/svg/shoppingCard.svg | 1 - src/icons/svg/size.svg | 3 +-- src/icons/svg/star.svg | 2 +- src/icons/svg/tab.svg | 2 +- src/icons/svg/table.svg | 2 +- src/icons/svg/theme.svg | 2 +- src/icons/svg/tree.svg | 1 + src/icons/svg/user.svg | 2 +- src/icons/svg/wechat.svg | 2 +- src/icons/svg/zip.svg | 2 +- src/icons/svgo.yml | 22 +++++++++++++++++++ .../dashboard/admin/components/PanelGroup.vue | 8 +++---- src/views/login/index.vue | 5 +---- src/views/login/socialsignin.vue | 6 ++--- 45 files changed, 72 insertions(+), 50 deletions(-) create mode 100644 src/icons/svg/guide 2.svg create mode 100644 src/icons/svg/shopping.svg delete mode 100644 src/icons/svg/shoppingCard.svg create mode 100644 src/icons/svg/tree.svg create mode 100644 src/icons/svgo.yml diff --git a/package.json b/package.json index fa817767..e7912d65 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,8 @@ "build:sit": "cross-env NODE_ENV=production env_config=sit node build/build.js", "lint": "eslint --ext .js,.vue src", "test": "npm run lint", - "precommit": "lint-staged" + "precommit": "lint-staged", + "svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml" }, "lint-staged": { "src/**/*.{js,vue}": [ @@ -105,6 +106,7 @@ "serve-static": "1.13.2", "shelljs": "0.8.2", "svg-sprite-loader": "3.8.0", + "svgo": "1.0.5", "uglifyjs-webpack-plugin": "1.2.7", "url-loader": "1.0.1", "vue-loader": "15.3.0", diff --git a/src/icons/svg/404.svg b/src/icons/svg/404.svg index bc5bc9fa..6df50190 100644 --- a/src/icons/svg/404.svg +++ b/src/icons/svg/404.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/icons/svg/bug.svg b/src/icons/svg/bug.svg index a12a9394..05a150dc 100644 --- a/src/icons/svg/bug.svg +++ b/src/icons/svg/bug.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/icons/svg/chart.svg b/src/icons/svg/chart.svg index b1b31336..27728fb0 100644 --- a/src/icons/svg/chart.svg +++ b/src/icons/svg/chart.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/icons/svg/clipboard.svg b/src/icons/svg/clipboard.svg index cf1c9b0c..90923ff6 100644 --- a/src/icons/svg/clipboard.svg +++ b/src/icons/svg/clipboard.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/icons/svg/component.svg b/src/icons/svg/component.svg index a8008c84..207ada34 100644 --- a/src/icons/svg/component.svg +++ b/src/icons/svg/component.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/icons/svg/dashboard.svg b/src/icons/svg/dashboard.svg index bee42507..5317d370 100644 --- a/src/icons/svg/dashboard.svg +++ b/src/icons/svg/dashboard.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/icons/svg/documentation.svg b/src/icons/svg/documentation.svg index 405c2ad7..70431228 100644 --- a/src/icons/svg/documentation.svg +++ b/src/icons/svg/documentation.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/icons/svg/drag.svg b/src/icons/svg/drag.svg index 819c8d50..4185d3ce 100644 --- a/src/icons/svg/drag.svg +++ b/src/icons/svg/drag.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/icons/svg/edit.svg b/src/icons/svg/edit.svg index 5c77d97a..0306a867 100644 --- a/src/icons/svg/edit.svg +++ b/src/icons/svg/edit.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/icons/svg/email.svg b/src/icons/svg/email.svg index 8a87e147..055e5013 100644 --- a/src/icons/svg/email.svg +++ b/src/icons/svg/email.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/icons/svg/example.svg b/src/icons/svg/example.svg index 681422ea..46f42b53 100644 --- a/src/icons/svg/example.svg +++ b/src/icons/svg/example.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/icons/svg/excel.svg b/src/icons/svg/excel.svg index e5dd5cec..59d54b2c 100644 --- a/src/icons/svg/excel.svg +++ b/src/icons/svg/excel.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/icons/svg/eye.svg b/src/icons/svg/eye.svg index 194aa45c..16ed2d87 100644 --- a/src/icons/svg/eye.svg +++ b/src/icons/svg/eye.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/icons/svg/form.svg b/src/icons/svg/form.svg index 79716f06..dcbaa185 100644 --- a/src/icons/svg/form.svg +++ b/src/icons/svg/form.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/icons/svg/guide 2.svg b/src/icons/svg/guide 2.svg new file mode 100644 index 00000000..d053bd73 --- /dev/null +++ b/src/icons/svg/guide 2.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/guide.svg b/src/icons/svg/guide.svg index 9bae3394..b2710017 100644 --- a/src/icons/svg/guide.svg +++ b/src/icons/svg/guide.svg @@ -1 +1 @@ - + \ No newline at end of file diff --git a/src/icons/svg/icon.svg b/src/icons/svg/icon.svg index 906af96a..82be8eee 100644 --- a/src/icons/svg/icon.svg +++ b/src/icons/svg/icon.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/icons/svg/international.svg b/src/icons/svg/international.svg index 6912767d..e9b56eee 100644 --- a/src/icons/svg/international.svg +++ b/src/icons/svg/international.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/icons/svg/language.svg b/src/icons/svg/language.svg index 2baf7431..96d00288 100644 --- a/src/icons/svg/language.svg +++ b/src/icons/svg/language.svg @@ -1 +1 @@ - + \ No newline at end of file diff --git a/src/icons/svg/link.svg b/src/icons/svg/link.svg index 11037e6f..07090147 100644 --- a/src/icons/svg/link.svg +++ b/src/icons/svg/link.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/icons/svg/list.svg b/src/icons/svg/list.svg index c45f4591..20259edd 100644 --- a/src/icons/svg/list.svg +++ b/src/icons/svg/list.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/icons/svg/lock.svg b/src/icons/svg/lock.svg index 37c60701..74fee543 100644 --- a/src/icons/svg/lock.svg +++ b/src/icons/svg/lock.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/icons/svg/message.svg b/src/icons/svg/message.svg index d807b002..14ca8172 100644 --- a/src/icons/svg/message.svg +++ b/src/icons/svg/message.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/icons/svg/money.svg b/src/icons/svg/money.svg index d4fcb9ca..c1580de1 100644 --- a/src/icons/svg/money.svg +++ b/src/icons/svg/money.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/icons/svg/nested.svg b/src/icons/svg/nested.svg index f5641979..06713a86 100644 --- a/src/icons/svg/nested.svg +++ b/src/icons/svg/nested.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/icons/svg/password.svg b/src/icons/svg/password.svg index 920b500b..e291d85d 100644 --- a/src/icons/svg/password.svg +++ b/src/icons/svg/password.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/icons/svg/people.svg b/src/icons/svg/people.svg index 3985ab51..2bd54aeb 100644 --- a/src/icons/svg/people.svg +++ b/src/icons/svg/people.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/icons/svg/peoples.svg b/src/icons/svg/peoples.svg index 2dccfcc0..2c911615 100644 --- a/src/icons/svg/peoples.svg +++ b/src/icons/svg/peoples.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/icons/svg/qq.svg b/src/icons/svg/qq.svg index 97aee717..ee13d4ec 100644 --- a/src/icons/svg/qq.svg +++ b/src/icons/svg/qq.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/icons/svg/shopping.svg b/src/icons/svg/shopping.svg new file mode 100644 index 00000000..87513e7c --- /dev/null +++ b/src/icons/svg/shopping.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/shoppingCard.svg b/src/icons/svg/shoppingCard.svg deleted file mode 100644 index cdebbdb4..00000000 --- a/src/icons/svg/shoppingCard.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/icons/svg/size.svg b/src/icons/svg/size.svg index def290f7..ddb25b8d 100644 --- a/src/icons/svg/size.svg +++ b/src/icons/svg/size.svg @@ -1,2 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/icons/svg/star.svg b/src/icons/svg/star.svg index 685a301d..6cf86e66 100644 --- a/src/icons/svg/star.svg +++ b/src/icons/svg/star.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/icons/svg/tab.svg b/src/icons/svg/tab.svg index 17aa088b..b4b48e48 100644 --- a/src/icons/svg/tab.svg +++ b/src/icons/svg/tab.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/icons/svg/table.svg b/src/icons/svg/table.svg index 083bc8cc..dbfe5d64 100644 --- a/src/icons/svg/table.svg +++ b/src/icons/svg/table.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/icons/svg/theme.svg b/src/icons/svg/theme.svg index d5c2e5ad..5982a2f7 100644 --- a/src/icons/svg/theme.svg +++ b/src/icons/svg/theme.svg @@ -1 +1 @@ - + \ No newline at end of file diff --git a/src/icons/svg/tree.svg b/src/icons/svg/tree.svg new file mode 100644 index 00000000..dd4b7dd2 --- /dev/null +++ b/src/icons/svg/tree.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/user.svg b/src/icons/svg/user.svg index 5971deeb..0ba0716a 100644 --- a/src/icons/svg/user.svg +++ b/src/icons/svg/user.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/icons/svg/wechat.svg b/src/icons/svg/wechat.svg index d88a64bc..9e18b717 100644 --- a/src/icons/svg/wechat.svg +++ b/src/icons/svg/wechat.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/icons/svg/zip.svg b/src/icons/svg/zip.svg index e9a9d012..f806fc48 100644 --- a/src/icons/svg/zip.svg +++ b/src/icons/svg/zip.svg @@ -1 +1 @@ - + \ No newline at end of file diff --git a/src/icons/svgo.yml b/src/icons/svgo.yml new file mode 100644 index 00000000..d11906ae --- /dev/null +++ b/src/icons/svgo.yml @@ -0,0 +1,22 @@ +# replace default config + +# multipass: true +# full: true + +plugins: + + # - name + # + # or: + # - name: false + # - name: true + # + # or: + # - name: + # param1: 1 + # param2: 2 + +- removeAttrs: + attrs: + - 'fill' + - 'fill-rule' diff --git a/src/views/dashboard/admin/components/PanelGroup.vue b/src/views/dashboard/admin/components/PanelGroup.vue index 2d1d58c9..8125b846 100644 --- a/src/views/dashboard/admin/components/PanelGroup.vue +++ b/src/views/dashboard/admin/components/PanelGroup.vue @@ -35,8 +35,8 @@
-
- +
+
Shoppings
@@ -91,7 +91,7 @@ export default { .icon-money { background: #f4516c; } - .icon-shoppingCard { + .icon-shopping { background: #34bfa3 } } @@ -104,7 +104,7 @@ export default { .icon-money { color: #f4516c; } - .icon-shoppingCard { + .icon-shopping { color: #34bfa3 } .card-panel-icon-wrapper { diff --git a/src/views/login/index.vue b/src/views/login/index.vue index 163be6d9..d25b519d 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -9,7 +9,7 @@
-