Skip to content

Commit

Permalink
fix: add icon and modify icon style
Browse files Browse the repository at this point in the history
  • Loading branch information
BeADre committed Dec 30, 2020
1 parent 3a68339 commit 3080c8c
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 16 deletions.
1 change: 1 addition & 0 deletions packages/varlet-icons/svg/uF002-information.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions packages/varlet-icons/svg/uF003-warning.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions packages/varlet-icons/svg/uF004-error.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 1 addition & 5 deletions packages/varlet-ui/src/icon/Icon.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@
<i
class="var-icon"
:class="[`${namespace}--set`, `${namespace}-${nextName}`, tickTransition ? 'var-icon--hidden' : null]"
:style="{
color: color,
'font-size': size,
transition: `transform ${transition}ms`,
}"
:style="{ transition: `transform ${transition}ms` }"
v-bind="$attrs"
/>
</template>
Expand Down
5 changes: 3 additions & 2 deletions packages/varlet-ui/src/icon/icon.less
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
@import "~@varlet/icons/dist/css/varlet-icons.less";
@import "../styles/var";

.var-icon {
font-size: 20px;
color: red;
font-size: @icon-size-md;
color: inherit;

&--hidden {
transform: scale(0);
Expand Down
8 changes: 0 additions & 8 deletions packages/varlet-ui/src/icon/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,6 @@ export const props = {
name: {
type: String,
},
color: {
type: String,
default: 'inherit',
},
size: {
type: String,
default: 'inherit',
},
namespace: {
type: String,
default: 'var-icon',
Expand Down
8 changes: 7 additions & 1 deletion packages/varlet-ui/src/styles/var.less
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,15 @@
@font-size-md: 14px;
@font-size-lg: 16px;

// 图标
@icon-size-xs: 16px;
@icon-size-sm: 18px;
@icon-size-md: 20px;
@icon-size-lg: 22px;

//颜色
@color-primary: #005CAF;
@color-info: #00BCD4;
@color-info: #4496ec;
@color-success: #4CAF50;
@color-warning: #FB8C00;
@color-danger: #F44336;
Expand Down

0 comments on commit 3080c8c

Please sign in to comment.