Skip to content

Commit

Permalink
[dev](button):按钮组件增加文字按钮的样式
Browse files Browse the repository at this point in the history
  • Loading branch information
linwens_xdf committed Aug 28, 2019
1 parent c57b46e commit 136caf2
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 2 deletions.
14 changes: 14 additions & 0 deletions examples/docs/button.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,20 @@

```
:::
### 文字按钮
<!-- {.md} -->

<div class="demo-block">
<xu-button type="text">文字按钮</xu-button>
<xu-button type="text" disabled>文字按钮</xu-button>
</div>

::: demo
```html
<xu-button type="text">文字按钮</xu-button>
<xu-button type="text" disabled>文字按钮</xu-button>
```
:::

### 图标按钮
<!-- {.md} -->
Expand Down
2 changes: 1 addition & 1 deletion packages/button/src/button.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
},
size: {
type: String,
default: 'default'
default: 'medium'
},
icon: {
type: String,
Expand Down
2 changes: 1 addition & 1 deletion packages/theme-default/lib/index.css

Large diffs are not rendered by default.

30 changes: 30 additions & 0 deletions packages/theme-default/src/button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,36 @@
padding: 7px 15px;
}

@include m(text) {
border-color: transparent;
background: transparent;
padding-left: 0;
padding-right: 0;
color: $--color-primary;
&:hover,
&:focus {
color: adjust-color($--color-primary, $alpha: -0.2);
}
&:active {

}
&:disabled {
opacity: 0.5;
cursor: not-allowed;
color: $--color-black;
}
@include when(plain) {
&:hover,
&:focus {
color: $--color-primary;
}
&:disabled {
opacity: 0.5;
cursor: not-allowed;
color: $--color-black;
}
}
}
@include m(default) {
&:hover,
&:focus {
Expand Down

0 comments on commit 136caf2

Please sign in to comment.