-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
89 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
@import '../../styles/settings.scss'; | ||
|
||
/** | ||
* 去除原生 Button 组件自带的样式。 | ||
* 现在它与 View 组件的唯一区别: | ||
* 内容默认居中。 | ||
*/ | ||
button.m-pure-button { | ||
position: relative; | ||
display: block; | ||
text-align: center; | ||
margin: 0; | ||
padding: 0; | ||
outline: none; | ||
font: inherit; | ||
border-radius: 0; | ||
border: none; | ||
color: inherit; | ||
background: inherit; | ||
overflow: auto; | ||
box-sizing: content-box; | ||
text-decoration: none; | ||
-webkit-tap-highlight-color: transparent; | ||
|
||
&.button-hover { | ||
color: inherit; | ||
background: inherit; | ||
} | ||
|
||
&::before, | ||
&::after { | ||
content: none; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import Taro from '@tarojs/taro' | ||
import { Button, View } from '@tarojs/components' | ||
import { component } from '../components/component' | ||
import { XItem, XList, XTitle } from './components' | ||
|
||
export default class Style extends component() { | ||
render() { | ||
return ( | ||
<View> | ||
<XTitle>.m-pure-button</XTitle> | ||
<XList> | ||
<XItem | ||
title='去除原生 Button 组件自带的样式,仅保留文字居中,如:' | ||
/> | ||
<XItem> | ||
<Button | ||
className='m-pure-button' | ||
openType='openSetting'> | ||
{'打开设置'} | ||
</Button> | ||
</XItem> | ||
</XList> | ||
</View> | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters