Skip to content

Commit

Permalink
feat(样式): 新增 pureButton mixin,可用于去除小程序按钮的默认样式
Browse files Browse the repository at this point in the history
  • Loading branch information
fjc0k committed Apr 11, 2019
1 parent 8a7b4ec commit e00684f
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions src/styles/settings.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,36 @@ $hairlineColor: #E5E5E5 !default;
}
}

// 纯粹的按钮,去除小程序按钮的默认样式,仅保留居中属性
@mixin pureButton {
position: relative;
display: block;
text-align: center;
margin: 0;
padding: 0;
outline: none;
font-size: inherit;
line-height: inherit;
border-radius: 0;
border: none;
color: inherit;
background: inherit;
overflow: auto;
box-sizing: border-box;
text-decoration: none;
-webkit-tap-highlight-color: transparent;

&.button-hover {
color: inherit;
background: inherit;
}

&::before,
&::after {
content: none;
}
}

// 将 375 尺寸下的像素转换为其他尺寸下的像素
@function transformPx($px) {
@return unquote(($px / (375 / $designWidth)) + 'px');
Expand Down

0 comments on commit e00684f

Please sign in to comment.