feat(card): add :target style (#35)

* feat(docs): add target style when anchor compoents demo

* feat(card): rename targetColor to colorTarget

* fix(changelog): fix changelog doc typo

* feat(card): delete !important, complete target style by override

* feat(card): rewrite target style
This commit is contained in:
cyn 2021-06-09 11:30:00 +08:00 committed by GitHub
parent 358be3a491
commit 5581cfcc8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 18 additions and 4 deletions

View File

@ -7,6 +7,10 @@
- Fix `n-popover` sometimes won't sync position in manual mode.
- Fix `n-transfer`'s empty icon is no toggling transition.
### Feats
- `n-card` add `:target` style
## 2.11.4
### Feats

View File

@ -7,6 +7,10 @@
- 修复 `n-popover` 有时在手动模式不会同步位置
- 修复 `n-transfer` 的无数据 Icon 没有开关动画
### Feats
- `n-card` 增加 `:target` 的样式
## 2.11.4
### Feats
@ -389,7 +393,7 @@
- `n-layout-sider` 新增 `default-collapsed` 属性
- `n-modal` 支持自定义位置
### Fixed
### Fixes
- 修正 `n-menu` 垂直折叠时 `n-menu-item` tooltip 不显示的问题
- 修正 `n-menu` `collapsed-icon-size` 不生效的问题

View File

@ -83,6 +83,7 @@ export default defineComponent({
self: {
color,
colorModal,
colorTarget,
textColor,
titleTextColor,
titleFontWeight,
@ -113,6 +114,7 @@ export default defineComponent({
'--color': color,
'--color-modal': colorModal,
'--color-popover': colorPopover,
'--color-target': colorTarget,
'--text-color': textColor,
'--line-height': lineHeight,
'--action-color': actionColor,

View File

@ -137,9 +137,11 @@ export default c([
width: 100%;
`)
]),
cM('bordered', {
border: '1px solid var(--border-color)'
}),
cM('bordered', `
border: 1px solid var(--border-color);
`, [
c('&:target', 'border-color: var(--color-target);')
]),
cM('action-segmented', [
c('>', [
cE('action', [

View File

@ -5,6 +5,7 @@ import { Theme } from '../../_mixins'
export const self = (vars: ThemeCommonVars) => {
const {
primaryColor,
borderRadius,
lineHeight,
fontSize,
@ -27,6 +28,7 @@ export const self = (vars: ThemeCommonVars) => {
color: cardColor,
colorModal: modalColor,
colorPopover: popoverColor,
colorTarget: primaryColor,
textColor: textColor2,
titleTextColor: textColor1,
borderColor: dividerColor,