diff --git a/CHANGELOG.en-US.md b/CHANGELOG.en-US.md index 5d3573aed0f..6d39f28a29a 100644 --- a/CHANGELOG.en-US.md +++ b/CHANGELOG.en-US.md @@ -2,15 +2,16 @@ ## Pending -### Fixes - -- Fix `n-notification`'s exported `NotificationReactive` type is not writable, closes [#876](https://github.com/TuSimple/naive-ui/issues/876). - ### Feats - `n-input-number` add `clearable` prop. - `n-form` add `show-label` prop, closes [#858](https://github.com/TuSimple/naive-ui/issues/858). +### Fixes + +- Fix `n-notification`'s exported `NotificationReactive` type is not writable, closes [#876](https://github.com/TuSimple/naive-ui/issues/876). +- Fix `n-tabs` style glitches when different types tabs are nested, closes [#850](https://github.com/TuSimple/naive-ui/issues/850). + ## 2.16.4 (2021-08-16) ### Fixes diff --git a/CHANGELOG.zh-CN.md b/CHANGELOG.zh-CN.md index adb33dd5e96..eff1f56c90c 100644 --- a/CHANGELOG.zh-CN.md +++ b/CHANGELOG.zh-CN.md @@ -2,15 +2,16 @@ ## Pending -### Fixes - -- 修复 `n-notification` 导出的 `NotificationReactive` 类型不可变,关闭 [#876](https://github.com/TuSimple/naive-ui/issues/876) - ### Feats - `n-input-number` 新增 `clearable` 属性 - `n-form` 新增 `show-label` 属性,关闭 [#858](https://github.com/TuSimple/naive-ui/issues/858) +### Fixes + +- 修复 `n-notification` 导出的 `NotificationReactive` 类型不可变,关闭 [#876](https://github.com/TuSimple/naive-ui/issues/876) +- 修复 `n-tabs` 不同类型嵌套样式错乱,关闭 [#850](https://github.com/TuSimple/naive-ui/issues/850) + ## 2.16.4 (2021-08-16) ### Fixes diff --git a/src/tabs/demos/zhCN/index.demo-entry.md b/src/tabs/demos/zhCN/index.demo-entry.md index 2fcc4e8c58e..237171db523 100644 --- a/src/tabs/demos/zhCN/index.demo-entry.md +++ b/src/tabs/demos/zhCN/index.demo-entry.md @@ -13,6 +13,7 @@ prefix display-directive addable line-debug +style-inherit-debug ``` ## Props diff --git a/src/tabs/demos/zhCN/style-inherit-debug.demo.md b/src/tabs/demos/zhCN/style-inherit-debug.demo.md new file mode 100644 index 00000000000..44d07691050 --- /dev/null +++ b/src/tabs/demos/zhCN/style-inherit-debug.demo.md @@ -0,0 +1,34 @@ +# Style Inherit Debug + +```html +
+

one tab

+ + 1111 + 1111 + + +

one tabs Parent/Child

+ + + + 1111 + 1111 + + + 1111 + +
+``` + +```js +import { NTabs, NTabPane } from 'naive-ui' + +export default { + name: 'App', + components: { + NTabs, + NTabPane + } +} +``` diff --git a/src/tabs/src/Tabs.tsx b/src/tabs/src/Tabs.tsx index 0510d893afa..b4f14fe8d33 100644 --- a/src/tabs/src/Tabs.tsx +++ b/src/tabs/src/Tabs.tsx @@ -397,7 +397,16 @@ export default defineComponent({ ]} style={this.cssVars as CSSProperties} > -
+
{prefix ? (
{prefix}
) : null} diff --git a/src/tabs/src/styles/index.cssr.ts b/src/tabs/src/styles/index.cssr.ts index 54a9796925b..7a12fd7affc 100644 --- a/src/tabs/src/styles/index.cssr.ts +++ b/src/tabs/src/styles/index.cssr.ts @@ -179,72 +179,70 @@ export default cB('tabs', ` }) ]) ]), - cM('line-type', [ - cB('tabs-nav', [ + cB('tabs-nav', [ + cM('line-type', [ cE('prefix, suffix', ` transition: border-color .3s var(--bezier); border-bottom: 1px solid var(--tab-border-color); + `), + cB('tabs-nav-scroll-content', ` + transition: border-color .3s var(--bezier); + border-bottom: 1px solid var(--tab-border-color); + `), + cB('tabs-bar', ` + border-radius: 0; + bottom: -1px; `) ]), - cB('tabs-nav-scroll-content', ` - transition: border-color .3s var(--bezier); - border-bottom: 1px solid var(--tab-border-color); - `), - cB('tabs-bar', ` - border-radius: 0; - bottom: -1px; - `) - ]), - cM('card-type', [ - cB('tabs-nav', [ + cM('card-type', [ cE('prefix, suffix', ` transition: border-color .3s var(--bezier); border-bottom: 1px solid var(--tab-border-color); - `) - ]), - cB('tabs-pad', ` - flex-grow: 1; - transition: border-color .3s var(--bezier); - border-bottom: 1px solid var(--tab-border-color); - `), - cB('tabs-tab-pad', ` - transition: border-color .3s var(--bezier); - border-bottom: 1px solid var(--tab-border-color); - `), - cB('tabs-tab', ` - font-weight: var(--tab-font-weight); - border: 1px solid var(--tab-border-color); - border-top-left-radius: var(--tab-border-radius); - border-top-right-radius: var(--tab-border-radius); - background-color: var(--tab-color); - box-sizing: border-box; - position: relative; - vertical-align: bottom; - display: flex; - justify-content: space-between; - font-size: var(--tab-font-size); - color: var(--tab-text-color); - `, [ - cM('addable', ` - padding-left: 8px; - padding-right: 8px; - font-size: 16px; + `), + cB('tabs-pad', ` + flex-grow: 1; + transition: border-color .3s var(--bezier); + border-bottom: 1px solid var(--tab-border-color); + `), + cB('tabs-tab-pad', ` + transition: border-color .3s var(--bezier); + border-bottom: 1px solid var(--tab-border-color); + `), + cB('tabs-tab', ` + font-weight: var(--tab-font-weight); + border: 1px solid var(--tab-border-color); + border-top-left-radius: var(--tab-border-radius); + border-top-right-radius: var(--tab-border-radius); + background-color: var(--tab-color); + box-sizing: border-box; + position: relative; + vertical-align: bottom; + display: flex; + justify-content: space-between; + font-size: var(--tab-font-size); + color: var(--tab-text-color); `, [ - cNotM('disabled', [ - c('&:hover', ` - color: var(--tab-text-color-active); - `) - ]) + cM('addable', ` + padding-left: 8px; + padding-right: 8px; + font-size: 16px; + `, [ + cNotM('disabled', [ + c('&:hover', ` + color: var(--tab-text-color-active); + `) + ]) + ]), + cM('closable', 'padding-right: 6px;'), + cM('active', ` + border-bottom: 1px solid #0000; + background-color: #0000; + font-weight: var(--tab-font-weight-active); + color: var(--tab-text-color-active); + `), + cM('disabled', 'color: var(--tab-text-color-disabled);') ]), - cM('closable', 'padding-right: 6px;'), - cM('active', ` - border-bottom: 1px solid #0000; - background-color: #0000; - font-weight: var(--tab-font-weight-active); - color: var(--tab-text-color-active); - `), - cM('disabled', 'color: var(--tab-text-color-disabled);') - ]), - cB('tabs-scroll-padding', 'border-bottom: 1px solid var(--tab-border-color);') + cB('tabs-scroll-padding', 'border-bottom: 1px solid var(--tab-border-color);') + ]) ]) ])