diff --git a/src/packages/button/button.scss b/src/packages/button/button.scss index c541ad902a..454700807b 100644 --- a/src/packages/button/button.scss +++ b/src/packages/button/button.scss @@ -1,7 +1,6 @@ .nut-button { position: relative; display: flex; - display: inline-block; /* #ifdef rn harmony*/ width: 80px; /* #endif */ @@ -21,9 +20,9 @@ text-align: center; cursor: pointer; transition: $button-transition; - -webkit-appearance: none; user-select: none; touch-action: manipulation; + -webkit-appearance: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: $button-default-color; background: $button-default-background-color; @@ -99,6 +98,23 @@ padding: 0; } + &-round { + border-radius: $button-border-radius; + + &-xlarge, + &-large { + border-radius: $button-large-border-radius; + } + + &-small { + border-radius: $button-small-border-radius; + } + + &-mini { + border-radius: $button-mini-border-radius; + } + } + &-default { padding: $button-default-padding; border-style: solid; @@ -136,6 +152,14 @@ padding: $button-xlarge-padding; font-size: $button-xlarge-font-size; font-weight: $button-large-font-weight; + border-radius: $radius-base; + + .nut-button-text { + margin-left: $button-xlarge-text-icon-margin; + &-right { + margin-right: $button-xlarge-text-icon-margin; + } + } .nut-icon { font-size: $button-xlarge-font-size; @@ -153,6 +177,14 @@ padding: $button-large-padding; font-size: $button-large-font-size; font-weight: $button-large-font-weight; + border-radius: $radius-base; + + .nut-button-text { + margin-left: $button-xlarge-text-icon-margin; + &-right { + margin-right: $button-xlarge-text-icon-margin; + } + } .nut-icon { font-size: $button-large-font-size; @@ -170,6 +202,7 @@ height: $button-small-height; padding: $button-small-padding; font-size: $button-small-font-size; + border-radius: $radius-s; .nut-icon { font-size: $button-small-font-size; @@ -186,6 +219,7 @@ height: $button-mini-height; padding: $button-mini-padding; font-size: $button-mini-font-size; + border-radius: $radius-s; .nut-icon { font-size: $button-mini-font-size; @@ -412,23 +446,6 @@ opacity: 0.9; } - &-round { - border-radius: $button-border-radius; - - &-xlarge, - &-large { - border-radius: $button-large-border-radius; - } - - &-small { - border-radius: $button-small-border-radius; - } - - &-mini { - border-radius: $button-mini-border-radius; - } - } - &-square { border-radius: $button-square-border-radius; } diff --git a/src/packages/button/doc.en-US.md b/src/packages/button/doc.en-US.md index c9d3da87f9..56e42adc88 100644 --- a/src/packages/button/doc.en-US.md +++ b/src/packages/button/doc.en-US.md @@ -125,27 +125,27 @@ The component provides the following CSS variables, which can be used to customi | Name | Description | Default | | --- | --- | --- | -| \--nutui-button-border-radius | Rounded corners of the button | `24px` | -| \--nutui-button-border-width | Button border width | `1px` | -| \--nutui-button-normal-padding | The padding of the button whose size is normal | `0px 16px` | -| \--nutui-button-default-height | The height of the button whose type is default | `32px` | -| \--nutui-button-default-color | The text color of the button whose type is default | `$color-title` | -| \--nutui-button-default-background-color | The background color of the button whose type is default | `$white` | -| \--nutui-button-default-border-color | The border color of the button whose type is default | `$color-text` | -| \--nutui-button-default-disabled | The color of the button whose type is default and whose status is disable | `$color-text-disabled` | -| \--nutui-button-default-disabled-color | The text color of the button whose type is default and whose status is disable | `$color-text-help` | -| \--nutui-button-default-padding | padding of buttons with type default | `0 16px` | -| \--nutui-button-default-font-size | The font size of the button whose type is default | `$font-size-base` | -| \--nutui-button-default-font-weight | The font weight of the button whose type is default | `$font-weight` | -| \--nutui-button-large-height | The height of the button whose size is large | `40px` | -| \--nutui-button-large-font-size | The font size of buttons whose size is large | `$button-default-font-size` | -| \--nutui-button-small-border-radius | The border radius of buttons whose size is large | `24px` | -| \--nutui-button-small-padding | Padding for small buttons | `0 12px` | -| \--nutui-button-small-height | The height of the button whose size is small | `28px` | -| \--nutui-button-small-font-size | The font size of the button whose size is small | `$font-size-s` | -| \--nutui-button-small-border-radius | The border radius of buttons whose size is small | `24px` | -| \--nutui-button-mini-padding | Padding for buttons with size mini | `0 12px` | -| \--nutui-button-mini-height | The height of the button whose size is mini | `24px` | -| \--nutui-button-mini-font-size | The font size of the button whose size is mini | `$font-size-s` | -| \--nutui-button-mini-border-radius | The border radius of buttons whose size is mini | `24px` | -| \--nutui-button-text-icon-margin | margin of text with icon button | `4px` | +| \--nutui-button-border-radius | Button rounded corner settings | `8px` | +| \--nutui-button-border-width | The border width of the button | `1px` | +| \--nutui-button-normal-padding | padding value when size normal | `0px 12px` | +| \--nutui-button-default-height | The height of the button with type default | `32px` | +| \--nutui-button-default-color | The text color of the button with type default | `$color-title` | +| \--nutui-button-default-background-color | The background color of the button with type default | `transparent` | +| \--nutui-button-default-border-color | The border color of the button with type default | `$color-text` | +| \--nutui-button-default-disabled | Disabled color for buttons of type default | `$color-text-disabled` | +| \--nutui-button-default-disabled-color | Disabled text color for buttons of type default | `$color-text-help` | +| \--nutui-button-default-padding | Padding for buttons of type default | `0 12px` | +| \--nutui-button-default-font-size | The font size of the button with type default | `$font-size-s` | +| \--nutui-button-default-font-weight | The font weight of the button with type default | `$font-weight` | +| \--nutui-button-large-height | The height of the button with size large | `40px` | +| \--nutui-button-large-font-size | The font size of the button with size large | `$font-size-base` | +| \--nutui-button-large-border-radius | Rounded corners for buttons with size large | `12px` | +| \--nutui-button-small-padding | Padding for buttons of size small | `0 8px` | +| \--nutui-button-small-height | The height of the button with size small | `28px` | +| \--nutui-button-small-font-size | The font size of the button with size small | `$font-size-s` | +| \--nutui-button-small-border-radius | Rounded corners for buttons with size small | `8px` | +| \--nutui-button-mini-padding | Padding for buttons with size mini | `0 8px` | +| \--nutui-button-mini-height | size is the height of the mini button | `24px` | +| \--nutui-button-mini-font-size | The font size of the button with size mini | `$font-size-xs` | +| \--nutui-button-mini-border-radius | The rounded corners of the button with size mini | `6px` | +| \--nutui-button-text-icon-margin | Margin of text with icon button | `4px` | diff --git a/src/packages/button/doc.md b/src/packages/button/doc.md index d9cf3b17c5..932b840d50 100644 --- a/src/packages/button/doc.md +++ b/src/packages/button/doc.md @@ -124,27 +124,27 @@ import { Button } from '@nutui/nutui-react' | 名称 | 说明 | 默认值 | | --- | --- | --- | -| \--nutui-button-border-radius | 按钮的圆角设置 | `24px` | +| \--nutui-button-border-radius | 按钮的圆角设置 | `8px` | | \--nutui-button-border-width | 按钮的边框宽度 | `1px` | -| \--nutui-button-normal-padding | size normal时的padding值 | `0px 16px` | +| \--nutui-button-normal-padding | size normal时的padding值 | `0px 12px` | | \--nutui-button-default-height | type 为 default 的按钮的高度 | `32px` | | \--nutui-button-default-color | type 为 default 的按钮的文本色 | `$color-title` | -| \--nutui-button-default-background-color | type 为 default 的按钮的背景色 | `$white` | +| \--nutui-button-default-background-color | type 为 default 的按钮的背景色 | `transparent` | | \--nutui-button-default-border-color | type 为 default 的按钮的边框色 | `$color-text` | | \--nutui-button-default-disabled | type 为 default 的按钮的禁用色 | `$color-text-disabled` | | \--nutui-button-default-disabled-color | type 为 default 的按钮的禁用文本色 | `$color-text-help` | -| \--nutui-button-default-padding | type 为 default 的按钮的内边距 | `0 16px` | -| \--nutui-button-default-font-size | type 为 default 的按钮的字号 | `$font-size-base` | +| \--nutui-button-default-padding | type 为 default 的按钮的内边距 | `0 12px` | +| \--nutui-button-default-font-size | type 为 default 的按钮的字号 | `$font-size-s` | | \--nutui-button-default-font-weight | type 为 default 的按钮的字重 | `$font-weight` | | \--nutui-button-large-height | size 为 large 的按钮的高度 | `40px` | | \--nutui-button-large-font-size | size 为 large 的按钮的字号 | `$font-size-base` | -| \--nutui-button-large-border-radius | size 为 large 的按钮的圆角 | `24px` | -| \--nutui-button-small-padding | size 为 small 的按钮的内边距 | `0 12px` | +| \--nutui-button-large-border-radius | size 为 large 的按钮的圆角 | `12px` | +| \--nutui-button-small-padding | size 为 small 的按钮的内边距 | `0 8px` | | \--nutui-button-small-height | size 为 small 的按钮的高度 | `28px` | | \--nutui-button-small-font-size | size 为 small 的按钮的字号 | `$font-size-s` | -| \--nutui-button-small-border-radius | size 为 small 的按钮的圆角 | `24px` | -| \--nutui-button-mini-padding | size 为 mini 的按钮的内边距 | `0 12px` | +| \--nutui-button-small-border-radius | size 为 small 的按钮的圆角 | `8px` | +| \--nutui-button-mini-padding | size 为 mini 的按钮的内边距 | `0 8px` | | \--nutui-button-mini-height | size 为 mini 的按钮的高度 | `24px` | -| \--nutui-button-mini-font-size | size 为 mini 的按钮的字号 | `$font-size-s` | -| \--nutui-button-mini-border-radius | size 为 mini 的按钮的圆角 | `24px` | +| \--nutui-button-mini-font-size | size 为 mini 的按钮的字号 | `$font-size-xs` | +| \--nutui-button-mini-border-radius | size 为 mini 的按钮的圆角 | `6px` | | \--nutui-button-text-icon-margin | 带 icon按钮的文本的边距 | `4px` | diff --git a/src/packages/button/doc.taro.md b/src/packages/button/doc.taro.md index 7cfd87100f..bf86abe76f 100644 --- a/src/packages/button/doc.taro.md +++ b/src/packages/button/doc.taro.md @@ -137,27 +137,27 @@ import { Button } from '@nutui/nutui-react-taro' | 名称 | 说明 | 默认值 | | --- | --- | --- | -| \--nutui-button-border-radius | 按钮的圆角设置 | `24px` | +| \--nutui-button-border-radius | 按钮的圆角设置 | `8px` | | \--nutui-button-border-width | 按钮的边框宽度 | `1px` | -| \--nutui-button-normal-padding | size normal时的padding值 | `0px 16px` | +| \--nutui-button-normal-padding | size normal时的padding值 | `0px 12px` | | \--nutui-button-default-height | type 为 default 的按钮的高度 | `32px` | | \--nutui-button-default-color | type 为 default 的按钮的文本色 | `$color-title` | -| \--nutui-button-default-background-color | type 为 default 的按钮的背景色 | `$white` | +| \--nutui-button-default-background-color | type 为 default 的按钮的背景色 | `transparent` | | \--nutui-button-default-border-color | type 为 default 的按钮的边框色 | `$color-text` | | \--nutui-button-default-disabled | type 为 default 的按钮的禁用色 | `$color-text-disabled` | | \--nutui-button-default-disabled-color | type 为 default 的按钮的禁用文本色 | `$color-text-help` | -| \--nutui-button-default-padding | type 为 default 的按钮的内边距 | `0 16px` | -| \--nutui-button-default-font-size | type 为 default 的按钮的字号 | `$font-size-base` | +| \--nutui-button-default-padding | type 为 default 的按钮的内边距 | `0 12px` | +| \--nutui-button-default-font-size | type 为 default 的按钮的字号 | `$font-size-s` | | \--nutui-button-default-font-weight | type 为 default 的按钮的字重 | `$font-weight` | | \--nutui-button-large-height | size 为 large 的按钮的高度 | `40px` | | \--nutui-button-large-font-size | size 为 large 的按钮的字号 | `$font-size-base` | -| \--nutui-button-large-border-radius | size 为 large 的按钮的圆角 | `24px` | -| \--nutui-button-small-padding | size 为 small 的按钮的内边距 | `0 12px` | +| \--nutui-button-large-border-radius | size 为 large 的按钮的圆角 | `12px` | +| \--nutui-button-small-padding | size 为 small 的按钮的内边距 | `0 8px` | | \--nutui-button-small-height | size 为 small 的按钮的高度 | `28px` | | \--nutui-button-small-font-size | size 为 small 的按钮的字号 | `$font-size-s` | -| \--nutui-button-small-border-radius | size 为 small 的按钮的圆角 | `24px` | -| \--nutui-button-mini-padding | size 为 mini 的按钮的内边距 | `0 12px` | +| \--nutui-button-small-border-radius | size 为 small 的按钮的圆角 | `8px` | +| \--nutui-button-mini-padding | size 为 mini 的按钮的内边距 | `0 8px` | | \--nutui-button-mini-height | size 为 mini 的按钮的高度 | `24px` | -| \--nutui-button-mini-font-size | size 为 mini 的按钮的字号 | `$font-size-s` | -| \--nutui-button-mini-border-radius | size 为 mini 的按钮的圆角 | `24px` | +| \--nutui-button-mini-font-size | size 为 mini 的按钮的字号 | `$font-size-xs` | +| \--nutui-button-mini-border-radius | size 为 mini 的按钮的圆角 | `6px` | | \--nutui-button-text-icon-margin | 带 icon按钮的文本的边距 | `4px` | diff --git a/src/packages/button/doc.zh-TW.md b/src/packages/button/doc.zh-TW.md index 6e3c6780da..9bfe6d2105 100644 --- a/src/packages/button/doc.zh-TW.md +++ b/src/packages/button/doc.zh-TW.md @@ -125,27 +125,27 @@ import { Button } from '@nutui/nutui-react' | 名稱 | 說明 | 默認值 | | --- | --- | --- | -| \--nutui-button-border-radius | 按鈕的圓角設置 | `24px` | +| \--nutui-button-border-radius | 按鈕的圓角設定 | `8px` | | \--nutui-button-border-width | 按鈕的邊框寬度 | `1px` | -| \--nutui-button-normal-padding | size normal時的padding值 | `0px 16px` | +| \--nutui-button-normal-padding | size normal時的padding值 | `0px 12px` | | \--nutui-button-default-height | type 為 default 的按鈕的高度 | `32px` | -| \--nutui-button-default-color | type 為 default 的按鈕的文本色 | `$color-title` | -| \--nutui-button-default-background-color | type 為 default 的按鈕的背景色 | `$white` | +| \--nutui-button-default-color | type 為 default 的按鈕的文字色 | `$color-title` | +| \--nutui-button-default-background-color | type 為 default 的按鈕的背景色 | `transparent` | | \--nutui-button-default-border-color | type 為 default 的按鈕的邊框色 | `$color-text` | | \--nutui-button-default-disabled | type 為 default 的按鈕的禁用色 | `$color-text-disabled` | -| \--nutui-button-default-disabled-color | type 為 default 的按鈕的禁用色文本色 | `$color-text-help` | -| \--nutui-button-default-padding | type 為 default 的按鈕的內邊距 | `0 16px` | -| \--nutui-button-default-font-size | type 為 default 的按鈕的字號 | `$font-size-base` | +| \--nutui-button-default-disabled-color | type 為 default 的按鈕的停用文字色 | `$color-text-help` | +| \--nutui-button-default-padding | type 為 default 的按鈕的內邊距 | `0 12px` | +| \--nutui-button-default-font-size | type 為 default 的按鈕的字號 | `$font-size-s` | | \--nutui-button-default-font-weight | type 為 default 的按鈕的字重 | `$font-weight` | | \--nutui-button-large-height | size 為 large 的按鈕的高度 | `40px` | | \--nutui-button-large-font-size | size 為 large 的按鈕的字號 | `$font-size-base` | -| \--nutui-button-large-border-radius | size 為 large 的按鈕的圓角 | `24px` | -| \--nutui-button-small-padding | size 為 small 的按鈕的內邊距 | `0 12px` | +| \--nutui-button-large-border-radius | size 為 large 的按鈕的圓角 | `12px` | +| \--nutui-button-small-padding | size 為 small 的按鈕的內邊距 | `0 8px` | | \--nutui-button-small-height | size 為 small 的按鈕的高度 | `28px` | | \--nutui-button-small-font-size | size 為 small 的按鈕的字號 | `$font-size-s` | -| \--nutui-button-small-border-radius | size 為 small 的按鈕的圓角 | `24px` | -| \--nutui-button-mini-padding | size 為 mini 的按鈕的內邊距 | `0 12px` | +| \--nutui-button-small-border-radius | size 為 small 的按鈕的圓角 | `8px` | +| \--nutui-button-mini-padding | size 為 mini 的按鈕的內邊距 | `0 8px` | | \--nutui-button-mini-height | size 為 mini 的按鈕的高度 | `24px` | -| \--nutui-button-mini-font-size | size 為 mini 的按鈕的字號 | `$font-size-s` | -| \--nutui-button-mini-border-radius | size 為 mini 的按鈕的圓角 | `24px` | -| \--nutui-button-text-icon-margin | 帶 icon按鈕的文本的邊距 | `4px` | +| \--nutui-button-mini-font-size | size 為 mini 的按鈕的字號 | `$font-size-xs` | +| \--nutui-button-mini-border-radius | size 為 mini 的按鈕的圓角 | `6px` | +| \--nutui-button-text-icon-margin | 有 icon按鈕的文字的邊距 | `4px` | diff --git a/src/styles/variables.scss b/src/styles/variables.scss index 1995e15c8b..e6c3f8ee9b 100644 --- a/src/styles/variables.scss +++ b/src/styles/variables.scss @@ -229,7 +229,7 @@ $button-default-disabled-color: var( $button-default-padding: var(--nutui-button-default-padding, 0px 12px) !default; $button-default-font-size: var( --nutui-button-default-font-size, - $font-size-base + $font-size-s ) !default; $button-default-font-weight: var( --nutui-button-default-font-weight, @@ -240,14 +240,14 @@ $button-xlarge-height: var(--nutui-button-xlarge-height, 48px) !default; $button-xlarge-padding: var(--nutui-button-xlarge-padding, 0px 24px) !default; $button-xlarge-font-size: var( --nutui-button-xlarge-font-size, - $font-size-xxl + $font-size-xl ) !default; $button-large-height: var(--nutui-button-large-height, 40px) !default; $button-large-padding: var(--nutui-button-large-padding, 0px 16px) !default; $button-large-font-size: var( --nutui-button-large-font-size, - $font-size-l + $font-size-base ) !default; $button-large-font-weight: var( --nutui-button-large-font-weight, @@ -273,7 +273,7 @@ $button-mini-padding: var(--nutui-button-mini-padding, 0px 8px) !default; $button-mini-height: var(--nutui-button-mini-height, 24px) !default; $button-mini-font-size: var( --nutui-button-mini-font-size, - $font-size-s + $font-size-xs ) !default; $button-mini-border-radius: var( --nutui-button-mini-border-radius, @@ -288,13 +288,12 @@ $button-primary-border-color: var( --nutui-button-primary-border-color, $color-primary ) !default; -$button-primary-background-color: $color-primary; +$button-primary-background-color: linear-gradient( + 90deg, + $color-primary-stop-1 0%, + $color-primary-stop-2 100% +) !default; -// linear-gradient( -// 135deg, -// $color-primary-stop-1 0%, -// $color-primary-stop-2 100% -// ) !default; $button-primary-disabled: var( --nutui-button-primary-disabled, $color-primary-disabled-special @@ -368,6 +367,10 @@ $button-danger-disabled: var( $color-danger-disabled ) !default; +$button-xlarge-text-icon-margin: var( + --nutui-button-xlarge-text-icon-margin, + 6px +) !default; $button-text-icon-margin: var(--nutui-button-text-icon-margin, 4px) !default; // cell(✅)