mirror of
https://gitee.com/vant-contrib/vant.git
synced 2026-01-02 13:26:57 +08:00
Compare commits
19 Commits
next
...
v4.0.0-rc.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5509ca0d1d | ||
|
|
65d9fbc5da | ||
|
|
39a100f3a0 | ||
|
|
e1670e27f6 | ||
|
|
b29180933b | ||
|
|
97d02a1e92 | ||
|
|
16c1f35135 | ||
|
|
9cd60d151d | ||
|
|
ee6fa66e4a | ||
|
|
bcae14d7cb | ||
|
|
4756168ae7 | ||
|
|
fd9cf38022 | ||
|
|
34360abd3b | ||
|
|
b6f2eb3e2a | ||
|
|
845c0b720b | ||
|
|
c243ebd1ff | ||
|
|
09c2bd8efd | ||
|
|
8df6eaf5a0 | ||
|
|
99833f2185 |
@ -1,4 +1,4 @@
|
||||
body {
|
||||
:root {
|
||||
// colors
|
||||
--van-doc-black: #000;
|
||||
--van-doc-white: #fff;
|
||||
|
||||
@ -138,8 +138,8 @@ export default {
|
||||
currentTheme: {
|
||||
handler(newVal, oldVal) {
|
||||
window.localStorage.setItem('vantTheme', newVal);
|
||||
document.body.classList.remove(`van-doc-theme-${oldVal}`);
|
||||
document.body.classList.add(`van-doc-theme-${newVal}`);
|
||||
document.documentElement.classList.remove(`van-doc-theme-${oldVal}`);
|
||||
document.documentElement.classList.add(`van-doc-theme-${newVal}`);
|
||||
syncThemeToChild(newVal);
|
||||
},
|
||||
immediate: true,
|
||||
|
||||
@ -24,12 +24,15 @@ export default {
|
||||
watch(
|
||||
theme,
|
||||
(newVal, oldVal) => {
|
||||
document.body.classList.remove(`van-doc-theme-${oldVal}`);
|
||||
document.body.classList.add(`van-doc-theme-${newVal}`);
|
||||
document.documentElement.classList.remove(`van-doc-theme-${oldVal}`);
|
||||
document.documentElement.classList.add(`van-doc-theme-${newVal}`);
|
||||
|
||||
const { darkModeClass } = config.site;
|
||||
if (darkModeClass) {
|
||||
document.body.classList.toggle(darkModeClass, newVal === 'dark');
|
||||
document.documentElement.classList.toggle(
|
||||
darkModeClass,
|
||||
newVal === 'dark'
|
||||
);
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
@ -43,6 +46,7 @@ export default {
|
||||
|
||||
body {
|
||||
min-width: 100vw;
|
||||
background-color: inherit;
|
||||
}
|
||||
|
||||
.van-doc-theme-light {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vant/popperjs",
|
||||
"version": "1.2.1",
|
||||
"version": "1.3.0",
|
||||
"description": "Pre-compiled popperjs core",
|
||||
"main": "dist/index.cjs.js",
|
||||
"module": "dist/index.esm.mjs",
|
||||
@ -36,10 +36,8 @@
|
||||
"bugs": "https://github.com/vant-ui/vant/issues",
|
||||
"author": "chenjiahan",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@popperjs/core": "^2.11.6"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@popperjs/core": "^2.11.6",
|
||||
"esbuild": "^0.14.54",
|
||||
"release-it": "^15.4.1",
|
||||
"typescript": "^4.8.2"
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { createPopper } from '@popperjs/core/lib/popper-lite';
|
||||
import offsetModifier from '@popperjs/core/lib/modifiers/offset';
|
||||
import type { Instance, Placement } from '@popperjs/core';
|
||||
import type { Instance } from '@popperjs/core';
|
||||
|
||||
export { createPopper, offsetModifier };
|
||||
export type { Instance, Placement };
|
||||
export type { Instance };
|
||||
|
||||
@ -1,4 +0,0 @@
|
||||
node_modules
|
||||
dist
|
||||
lib
|
||||
*.tsx
|
||||
@ -19,6 +19,35 @@ Vant follows [Semantic Versioning 2.0.0](https://semver.org/lang/zh-CN/).
|
||||
|
||||
## Details
|
||||
|
||||
### [v4.0.0-rc.2](https://github.com/vant-ui/vant/compare/v4.0.0-rc.1...v4.0.0-rc.2)
|
||||
|
||||
`2022-09-11`
|
||||
|
||||
**Breaking Changes**
|
||||
|
||||
- attach css variables to :root element [#11026](https://github.com/vant-ui/vant/issues/11026)
|
||||
|
||||
**Bug Fixes**
|
||||
|
||||
- Dialog: incorrect transform behavior [#11028](https://github.com/vant-ui/vant/issues/11028)
|
||||
- Empty: fix opacity in dark mode [#11027](https://github.com/vant-ui/vant/issues/11027)
|
||||
|
||||
### [v4.0.0-rc.1](https://github.com/vant-ui/vant/compare/v4.0.0-rc.0...v4.0.0-rc.1)
|
||||
|
||||
`2022-09-10`
|
||||
|
||||
**Feature**
|
||||
|
||||
- export props of all components [#11024](https://github.com/vant-ui/vant/issues/11024)
|
||||
- Dialog: message-align can be justify [#11014](https://github.com/vant-ui/vant/issues/11014)
|
||||
- Image: add block prop [#11022](https://github.com/vant-ui/vant/issues/11022)
|
||||
- Toast: add message slot [#11018](https://github.com/vant-ui/vant/issues/11018)
|
||||
|
||||
**Bug Fixes**
|
||||
|
||||
- Picker: failed to update value in some cases [#11009](https://github.com/vant-ui/vant/issues/11009)
|
||||
- Locale: avoid getting unexpected value [#11010](https://github.com/vant-ui/vant/issues/11010)
|
||||
|
||||
### [v4.0.0-rc.0](https://github.com/vant-ui/vant/compare/v3.6.2...v4.0.0-rc.0)
|
||||
|
||||
`2022-09-04`
|
||||
|
||||
@ -19,6 +19,35 @@ Vant 遵循 [Semver](https://semver.org/lang/zh-CN/) 语义化版本规范。
|
||||
|
||||
## 更新内容
|
||||
|
||||
### [v4.0.0-rc.2](https://github.com/vant-ui/vant/compare/v4.0.0-rc.1...v4.0.0-rc.2)
|
||||
|
||||
`2022-09-11`
|
||||
|
||||
**Breaking Changes**
|
||||
|
||||
- 调整了所有 CSS 变量的挂载位置,由 `body` 节点调整回 `:root` 节点,调整后与 Vant v3 版本保持一致,以便于 v3 项目更平滑地升级到 v4 版本。 [#11026](https://github.com/vant-ui/vant/issues/11026)
|
||||
|
||||
**Bug Fixes**
|
||||
|
||||
- Dialog: 修复过渡动画异常的问题 [#11028](https://github.com/vant-ui/vant/issues/11028)
|
||||
- Empty: 修复深色模式下亮度过高的问题 [#11027](https://github.com/vant-ui/vant/issues/11027)
|
||||
|
||||
### [v4.0.0-rc.1](https://github.com/vant-ui/vant/compare/v4.0.0-rc.0...v4.0.0-rc.1)
|
||||
|
||||
`2022-09-10`
|
||||
|
||||
**Feature**
|
||||
|
||||
- 导出所有组件的 props,方便进行二次封装 [#11024](https://github.com/vant-ui/vant/issues/11024)
|
||||
- Dialog: message-align 属性支持设置为 justify [#11014](https://github.com/vant-ui/vant/issues/11014)
|
||||
- Image: 新增 block 属性 [#11022](https://github.com/vant-ui/vant/issues/11022)
|
||||
- Toast: 新增 message 插槽 [#11018](https://github.com/vant-ui/vant/issues/11018)
|
||||
|
||||
**Bug Fixes**
|
||||
|
||||
- Picker: 修复部分情况下未正确更新选中值的问题 [#11009](https://github.com/vant-ui/vant/issues/11009)
|
||||
- Locale: 修复读取 i18n 文案时可能获取到 JS 原生方法的问题 [#11010](https://github.com/vant-ui/vant/issues/11010)
|
||||
|
||||
### [v4.0.0-rc.0](https://github.com/vant-ui/vant/compare/v3.6.2...v4.0.0-rc.0)
|
||||
|
||||
`2022-09-04`
|
||||
|
||||
@ -38,9 +38,9 @@ pnpm dev
|
||||
|
||||
仓库的不同分支对应不同的 Vant 版本,请切换到对应分支进行开发:
|
||||
|
||||
- dev 分支对应 Vant 4 版本,适用于 Vue 3
|
||||
- 3.x 分支对应 Vant 3 版本 ,适用于 Vue 3
|
||||
- 2.x 分支对应 Vant 2 版本,适用于 Vue 2
|
||||
- dev 分支对应 Vant 3 版本 ,适用于 Vue 3
|
||||
- next 分支对应 Vant 4 版本,适用于 Vue 3
|
||||
|
||||
### 镜像仓库
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "vant",
|
||||
"version": "4.0.0-rc.0",
|
||||
"version": "4.0.0-rc.3",
|
||||
"description": "Mobile UI Components built on Vue",
|
||||
"main": "lib/vant.cjs.js",
|
||||
"module": "es/index.mjs",
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
body {
|
||||
:root {
|
||||
--van-action-bar-button-height: 40px;
|
||||
--van-action-bar-button-warning-color: var(--van-gradient-orange);
|
||||
--van-action-bar-button-danger-color: var(--van-gradient-red);
|
||||
|
||||
@ -5,6 +5,7 @@ export const ActionBarButton = withInstall(_ActionBarButton);
|
||||
export default ActionBarButton;
|
||||
export { actionBarButtonProps } from './ActionBarButton';
|
||||
export type { ActionBarButtonProps } from './ActionBarButton';
|
||||
export type { ActionBarButtonThemeVars } from './types';
|
||||
|
||||
declare module 'vue' {
|
||||
export interface GlobalComponents {
|
||||
|
||||
5
packages/vant/src/action-bar-button/types.ts
Normal file
5
packages/vant/src/action-bar-button/types.ts
Normal file
@ -0,0 +1,5 @@
|
||||
export type ActionBarButtonThemeVars = {
|
||||
actionBarButtonHeight?: string;
|
||||
actionBarButtonWarningColor?: string;
|
||||
actionBarButtonDangerColor?: string;
|
||||
};
|
||||
@ -1,4 +1,4 @@
|
||||
body {
|
||||
:root {
|
||||
--van-action-bar-icon-width: 48px;
|
||||
--van-action-bar-icon-height: 100%;
|
||||
--van-action-bar-icon-color: var(--van-text-color);
|
||||
|
||||
@ -5,6 +5,7 @@ export const ActionBarIcon = withInstall(_ActionBarIcon);
|
||||
export default ActionBarIcon;
|
||||
export { actionBarIconProps } from './ActionBarIcon';
|
||||
export type { ActionBarIconProps } from './ActionBarIcon';
|
||||
export type { ActionBarIconThemeVars } from './types';
|
||||
|
||||
declare module 'vue' {
|
||||
export interface GlobalComponents {
|
||||
|
||||
10
packages/vant/src/action-bar-icon/types.ts
Normal file
10
packages/vant/src/action-bar-icon/types.ts
Normal file
@ -0,0 +1,10 @@
|
||||
export type ActionBarIconThemeVars = {
|
||||
actionBarIconWidth?: string;
|
||||
actionBarIconHeight?: string;
|
||||
actionBarIconColor?: string;
|
||||
actionBarIconSize?: string;
|
||||
actionBarIconFontSize?: string;
|
||||
actionBarIconActiveColor?: string;
|
||||
actionBarIconTextColor?: string;
|
||||
actionBarIconBackground?: string;
|
||||
};
|
||||
@ -1,4 +1,4 @@
|
||||
body {
|
||||
:root {
|
||||
--van-action-bar-background: var(--van-background-2);
|
||||
--van-action-bar-height: 50px;
|
||||
}
|
||||
|
||||
@ -5,6 +5,7 @@ export const ActionBar = withInstall(_ActionBar);
|
||||
export default ActionBar;
|
||||
export { actionBarProps } from './ActionBar';
|
||||
export type { ActionBarProps } from './ActionBar';
|
||||
export type { ActionBarThemeVars } from './types';
|
||||
|
||||
declare module 'vue' {
|
||||
export interface GlobalComponents {
|
||||
|
||||
4
packages/vant/src/action-bar/types.ts
Normal file
4
packages/vant/src/action-bar/types.ts
Normal file
@ -0,0 +1,4 @@
|
||||
export type ActionBarThemeVars = {
|
||||
actionBarBackground?: string;
|
||||
actionBarHeight?: string;
|
||||
};
|
||||
@ -179,6 +179,7 @@ export default {
|
||||
| closeable | Whether to show close icon | _boolean_ | `true` |
|
||||
| close-icon | Close icon name | _string_ | `cross` |
|
||||
| duration | Transition duration, unit second | _number \| string_ | `0.3` |
|
||||
| z-index | Set the z-index to a fixed value | _number \| string_ | `2000+` |
|
||||
| round | Whether to show round corner | _boolean_ | `true` |
|
||||
| overlay | Whether to show overlay | _boolean_ | `true` |
|
||||
| overlay-class | Custom overlay class | _string \| Array \| object_ | - |
|
||||
|
||||
@ -189,6 +189,7 @@ export default {
|
||||
| closeable | 是否显示关闭图标 | _boolean_ | `true` |
|
||||
| close-icon | 关闭图标名称或图片链接,等同于 Icon 组件的 [name 属性](#/zh-CN/icon#props) | _string_ | `cross` |
|
||||
| duration | 动画时长,单位秒,设置为 0 可以禁用动画 | _number \| string_ | `0.3` |
|
||||
| z-index | 将面板的 z-index 层级设置为一个固定值 | _number \| string_ | `2000+` |
|
||||
| round | 是否显示圆角 | _boolean_ | `true` |
|
||||
| overlay | 是否显示遮罩层 | _boolean_ | `true` |
|
||||
| overlay-class | 自定义遮罩层类名 | _string \| Array \| object_ | - |
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
@import '../style/mixins/hairline';
|
||||
|
||||
body {
|
||||
:root {
|
||||
--van-action-sheet-max-height: 80%;
|
||||
--van-action-sheet-header-height: 48px;
|
||||
--van-action-sheet-header-font-size: var(--van-font-size-lg);
|
||||
|
||||
@ -5,6 +5,7 @@ export const ActionSheet = withInstall(_ActionSheet);
|
||||
export default ActionSheet;
|
||||
export { actionSheetProps } from './ActionSheet';
|
||||
export type { ActionSheetProps, ActionSheetAction } from './ActionSheet';
|
||||
export type { ActionSheetThemeVars } from './types';
|
||||
|
||||
declare module 'vue' {
|
||||
export interface GlobalComponents {
|
||||
|
||||
23
packages/vant/src/action-sheet/types.ts
Normal file
23
packages/vant/src/action-sheet/types.ts
Normal file
@ -0,0 +1,23 @@
|
||||
export type ActionSheetThemeVars = {
|
||||
actionSheetMaxHeight?: string;
|
||||
actionSheetHeaderHeight?: string;
|
||||
actionSheetHeaderFontSize?: string;
|
||||
actionSheetDescriptionColor?: string;
|
||||
actionSheetDescriptionFontSize?: string;
|
||||
actionSheetDescriptionLineHeight?: number | string;
|
||||
actionSheetItemBackground?: string;
|
||||
actionSheetItemFontSize?: string;
|
||||
actionSheetItemLineHeight?: number | string;
|
||||
actionSheetItemTextColor?: string;
|
||||
actionSheetItemDisabledTextColor?: string;
|
||||
actionSheetSubnameColor?: string;
|
||||
actionSheetSubnameFontSize?: string;
|
||||
actionSheetSubnameLineHeight?: number | string;
|
||||
actionSheetCloseIconSize?: string;
|
||||
actionSheetCloseIconColor?: string;
|
||||
actionSheetCloseIconPadding?: string;
|
||||
actionSheetCancelTextColor?: string;
|
||||
actionSheetCancelPaddingTop?: string;
|
||||
actionSheetCancelPaddingColor?: string;
|
||||
actionSheetLoadingIconSize?: string;
|
||||
};
|
||||
@ -1,4 +1,4 @@
|
||||
body {
|
||||
:root {
|
||||
--van-address-edit-padding: var(--van-padding-sm);
|
||||
--van-address-edit-buttons-padding: var(--van-padding-xl)
|
||||
var(--van-padding-base);
|
||||
|
||||
@ -8,6 +8,7 @@ export type { AddressEditProps };
|
||||
export type {
|
||||
AddressEditInfo,
|
||||
AddressEditInstance,
|
||||
AddressEditThemeVars,
|
||||
AddressEditSearchItem,
|
||||
} from './types';
|
||||
|
||||
|
||||
@ -27,3 +27,10 @@ export type AddressEditInstance = ComponentPublicInstance<
|
||||
AddressEditProps,
|
||||
AddressEditExpose
|
||||
>;
|
||||
|
||||
export type AddressEditThemeVars = {
|
||||
addressEditPadding?: string;
|
||||
addressEditButtonsPadding?: string;
|
||||
addressEditButtonMarginBottom?: string;
|
||||
addressEditButtonFontSize?: string;
|
||||
};
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
body {
|
||||
:root {
|
||||
--van-address-list-padding: var(--van-padding-sm) var(--van-padding-sm) 80px;
|
||||
--van-address-list-disabled-text-color: var(--van-text-color-2);
|
||||
--van-address-list-disabled-text-padding: calc(var(--van-padding-base) * 5) 0;
|
||||
|
||||
@ -6,6 +6,7 @@ export default AddressList;
|
||||
export { addressListProps } from './AddressList';
|
||||
export type { AddressListProps } from './AddressList';
|
||||
export type { AddressListAddress } from './AddressListItem';
|
||||
export type { AddressListThemeVars } from './types';
|
||||
|
||||
declare module 'vue' {
|
||||
export interface GlobalComponents {
|
||||
|
||||
15
packages/vant/src/address-list/types.ts
Normal file
15
packages/vant/src/address-list/types.ts
Normal file
@ -0,0 +1,15 @@
|
||||
export type AddressListThemeVars = {
|
||||
addressListPadding?: string;
|
||||
addressListDisabledTextColor?: string;
|
||||
addressListDisabledTextPadding?: string;
|
||||
addressListDisabledTextFontSize?: string;
|
||||
addressListDisabledTextLineHeight?: number | string;
|
||||
addressListAddButtonZIndex?: number | string;
|
||||
addressListItemPadding?: string;
|
||||
addressListItemTextColor?: string;
|
||||
addressListItemDisabledTextColor?: string;
|
||||
addressListItemFontSize?: string;
|
||||
addressListItemLineHeight?: number | string;
|
||||
addressListRadioColor?: string;
|
||||
addressListEditIconSize?: string;
|
||||
};
|
||||
@ -1,4 +1,4 @@
|
||||
body {
|
||||
:root {
|
||||
--van-badge-size: 16px;
|
||||
--van-badge-color: var(--van-white);
|
||||
--van-badge-padding: 0 3px;
|
||||
|
||||
@ -5,6 +5,7 @@ export const Badge = withInstall(_Badge);
|
||||
export default Badge;
|
||||
export { badgeProps } from './Badge';
|
||||
export type { BadgeProps, BadgePosition } from './Badge';
|
||||
export type { BadgeThemeVars } from './types';
|
||||
|
||||
declare module 'vue' {
|
||||
export interface GlobalComponents {
|
||||
|
||||
12
packages/vant/src/badge/types.ts
Normal file
12
packages/vant/src/badge/types.ts
Normal file
@ -0,0 +1,12 @@
|
||||
export type BadgeThemeVars = {
|
||||
badgeSize?: string;
|
||||
badgeColor?: string;
|
||||
badgePadding?: string;
|
||||
badgeFontSize?: string;
|
||||
badgeFontWeight?: string;
|
||||
badgeBorderWidth?: string;
|
||||
badgeBackground?: string;
|
||||
badgeDotColor?: string;
|
||||
badgeDotSize?: string;
|
||||
badgeFont?: string;
|
||||
};
|
||||
@ -1,4 +1,4 @@
|
||||
body {
|
||||
:root {
|
||||
--van-button-mini-height: 24px;
|
||||
--van-button-mini-padding: 0 var(--van-padding-base);
|
||||
--van-button-mini-font-size: var(--van-font-size-xs);
|
||||
|
||||
@ -8,6 +8,7 @@ export type { ButtonProps } from './Button';
|
||||
export type {
|
||||
ButtonType,
|
||||
ButtonSize,
|
||||
ButtonThemeVars,
|
||||
ButtonNativeType,
|
||||
ButtonIconPosition,
|
||||
} from './types';
|
||||
|
||||
@ -12,3 +12,40 @@ export type ButtonSize = 'large' | 'normal' | 'small' | 'mini';
|
||||
export type ButtonNativeType = NonNullable<ButtonHTMLAttributes['type']>;
|
||||
|
||||
export type ButtonIconPosition = 'left' | 'right';
|
||||
|
||||
export type ButtonThemeVars = {
|
||||
buttonMiniHeight?: string;
|
||||
buttonMiniPadding?: string;
|
||||
buttonMiniFontSize?: string;
|
||||
buttonSmallHeight?: string;
|
||||
buttonSmallPadding?: string;
|
||||
buttonSmallFontSize?: string;
|
||||
buttonNormalPadding?: string;
|
||||
buttonNormalFontSize?: string;
|
||||
buttonLargeHeight?: string;
|
||||
buttonDefaultHeight?: string;
|
||||
buttonDefaultLineHeight?: number | string;
|
||||
buttonDefaultFontSize?: string;
|
||||
buttonDefaultColor?: string;
|
||||
buttonDefaultBackground?: string;
|
||||
buttonDefaultBorderColor?: string;
|
||||
buttonPrimaryColor?: string;
|
||||
buttonPrimaryBackground?: string;
|
||||
buttonPrimaryBorderColor?: string;
|
||||
buttonSuccessColor?: string;
|
||||
buttonSuccessBackground?: string;
|
||||
buttonSuccessBorderColor?: string;
|
||||
buttonDangerColor?: string;
|
||||
buttonDangerBackground?: string;
|
||||
buttonDangerBorderColor?: string;
|
||||
buttonWarningColor?: string;
|
||||
buttonWarningBackground?: string;
|
||||
buttonWarningBorderColor?: string;
|
||||
buttonBorderWidth?: string;
|
||||
buttonRadius?: string;
|
||||
buttonRoundRadius?: string;
|
||||
buttonPlainBackground?: string;
|
||||
buttonDisabledOpacity?: number | string;
|
||||
buttonIconSize?: string;
|
||||
buttonLoadingIconSize?: string;
|
||||
};
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
body {
|
||||
:root {
|
||||
--van-calendar-background: var(--van-background-2);
|
||||
--van-calendar-popup-height: 80%;
|
||||
--van-calendar-header-shadow: 0 2px 10px rgba(125, 126, 128, 0.16);
|
||||
|
||||
@ -10,6 +10,7 @@ export type {
|
||||
CalendarDayItem,
|
||||
CalendarDayType,
|
||||
CalendarInstance,
|
||||
CalendarThemeVars,
|
||||
} from './types';
|
||||
|
||||
declare module 'vue' {
|
||||
|
||||
@ -48,3 +48,32 @@ export type CalendarMonthInstance = ComponentPublicInstance<
|
||||
disabledDays: Ref<ComputedRef<CalendarDayItem[]>>;
|
||||
}
|
||||
>;
|
||||
|
||||
export type CalendarThemeVars = {
|
||||
calendarBackground?: string;
|
||||
calendarPopupHeight?: string;
|
||||
calendarHeaderShadow?: string;
|
||||
calendarHeaderTitleHeight?: string;
|
||||
calendarHeaderTitleFontSize?: string;
|
||||
calendarHeaderSubtitleFontSize?: string;
|
||||
calendarWeekdaysHeight?: string;
|
||||
calendarWeekdaysFontSize?: string;
|
||||
calendarMonthTitleFontSize?: string;
|
||||
calendarMonthMarkColor?: string;
|
||||
calendarMonthMarkFontSize?: string;
|
||||
calendarDayHeight?: string;
|
||||
calendarDayFontSize?: string;
|
||||
calendarDayMarginBottom?: string;
|
||||
calendarRangeEdgeColor?: string;
|
||||
calendarRangeEdgeBackground?: string;
|
||||
calendarRangeMiddleColor?: string;
|
||||
calendarRangeMiddleBackgroundOpacity?: number | string;
|
||||
calendarSelectedDaySize?: string;
|
||||
calendarSelectedDayColor?: string;
|
||||
calendarInfoFontSize?: string;
|
||||
calendarInfoLineHeight?: number | string;
|
||||
calendarSelectedDayBackground?: string;
|
||||
calendarDayDisabledColor?: string;
|
||||
calendarConfirmButtonHeight?: string;
|
||||
calendarConfirmButtonMargin?: string;
|
||||
};
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
body {
|
||||
:root {
|
||||
--van-card-padding: var(--van-padding-xs) var(--van-padding-md);
|
||||
--van-card-font-size: var(--van-font-size-sm);
|
||||
--van-card-text-color: var(--van-text-color);
|
||||
|
||||
@ -5,6 +5,7 @@ export const Card = withInstall(_Card);
|
||||
export default Card;
|
||||
export { cardProps } from './Card';
|
||||
export type { CardProps } from './Card';
|
||||
export type { CardThemeVars } from './types';
|
||||
|
||||
declare module 'vue' {
|
||||
export interface GlobalComponents {
|
||||
|
||||
18
packages/vant/src/card/types.ts
Normal file
18
packages/vant/src/card/types.ts
Normal file
@ -0,0 +1,18 @@
|
||||
export type CardThemeVars = {
|
||||
cardPadding?: string;
|
||||
cardFontSize?: string;
|
||||
cardTextColor?: string;
|
||||
cardBackground?: string;
|
||||
cardThumbSize?: string;
|
||||
cardThumbRadius?: string;
|
||||
cardTitleLineHeight?: number | string;
|
||||
cardDescColor?: string;
|
||||
cardDescLineHeight?: number | string;
|
||||
cardPriceColor?: string;
|
||||
cardOriginPriceColor?: string;
|
||||
cardNumColor?: string;
|
||||
cardOriginPriceFontSize?: string;
|
||||
cardPriceFontSize?: string;
|
||||
cardPriceIntegerFontSize?: string;
|
||||
cardPriceFont?: string;
|
||||
};
|
||||
@ -1,4 +1,4 @@
|
||||
body {
|
||||
:root {
|
||||
--van-cascader-header-height: 48px;
|
||||
--van-cascader-header-padding: 0 var(--van-padding-md);
|
||||
--van-cascader-title-font-size: var(--van-font-size-lg);
|
||||
|
||||
@ -5,7 +5,11 @@ export const Cascader = withInstall(_Cascader);
|
||||
export default Cascader;
|
||||
export { cascaderProps } from './Cascader';
|
||||
export type { CascaderProps } from './Cascader';
|
||||
export type { CascaderOption, CascaderFieldNames } from './types';
|
||||
export type {
|
||||
CascaderOption,
|
||||
CascaderThemeVars,
|
||||
CascaderFieldNames,
|
||||
} from './types';
|
||||
|
||||
declare module 'vue' {
|
||||
export interface GlobalComponents {
|
||||
|
||||
@ -21,3 +21,19 @@ export type CascaderFieldNames = {
|
||||
value?: string;
|
||||
children?: string;
|
||||
};
|
||||
|
||||
export type CascaderThemeVars = {
|
||||
cascaderHeaderHeight?: string;
|
||||
cascaderHeaderPadding?: string;
|
||||
cascaderTitleFontSize?: string;
|
||||
cascaderTitleLineHeight?: number | string;
|
||||
cascaderCloseIconSize?: string;
|
||||
cascaderCloseIconColor?: string;
|
||||
cascaderSelectedIconSize?: string;
|
||||
cascaderTabsHeight?: string;
|
||||
cascaderActiveColor?: string;
|
||||
cascaderOptionsHeight?: string;
|
||||
cascaderOptionDisabledColor?: string;
|
||||
cascaderTabColor?: string;
|
||||
cascaderUnselectedTabColor?: string;
|
||||
};
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
body {
|
||||
:root {
|
||||
--van-cell-group-background: var(--van-background-2);
|
||||
--van-cell-group-title-color: var(--van-text-color-2);
|
||||
--van-cell-group-title-padding: var(--van-padding-md) var(--van-padding-md);
|
||||
|
||||
@ -5,6 +5,7 @@ export const CellGroup = withInstall(_CellGroup);
|
||||
export default CellGroup;
|
||||
export { cellGroupProps } from './CellGroup';
|
||||
export type { CellGroupProps } from './CellGroup';
|
||||
export type { CellGroupThemeVars } from './types';
|
||||
|
||||
declare module 'vue' {
|
||||
export interface GlobalComponents {
|
||||
|
||||
10
packages/vant/src/cell-group/types.ts
Normal file
10
packages/vant/src/cell-group/types.ts
Normal file
@ -0,0 +1,10 @@
|
||||
export type CellGroupThemeVars = {
|
||||
cellGroupBackground?: string;
|
||||
cellGroupTitleColor?: string;
|
||||
cellGroupTitlePadding?: string;
|
||||
cellGroupTitleFontSize?: string;
|
||||
cellGroupTitleLineHeight?: number | string;
|
||||
cellGroupInsetPadding?: string;
|
||||
cellGroupInsetRadius?: string;
|
||||
cellGroupInsetTitlePadding?: string;
|
||||
};
|
||||
@ -1,6 +1,6 @@
|
||||
@import '../style/mixins/hairline';
|
||||
|
||||
body {
|
||||
:root {
|
||||
--van-cell-font-size: var(--van-font-size-md);
|
||||
--van-cell-line-height: 24px;
|
||||
--van-cell-vertical-padding: 10px;
|
||||
|
||||
@ -5,6 +5,7 @@ export const Cell = withInstall(_Cell);
|
||||
export default Cell;
|
||||
export { cellProps } from './Cell';
|
||||
export type { CellSize, CellProps, CellArrowDirection } from './Cell';
|
||||
export type { CellThemeVars } from './types';
|
||||
|
||||
declare module 'vue' {
|
||||
export interface GlobalComponents {
|
||||
|
||||
21
packages/vant/src/cell/types.ts
Normal file
21
packages/vant/src/cell/types.ts
Normal file
@ -0,0 +1,21 @@
|
||||
export type CellThemeVars = {
|
||||
cellFontSize?: string;
|
||||
cellLineHeight?: number | string;
|
||||
cellVerticalPadding?: string;
|
||||
cellHorizontalPadding?: string;
|
||||
cellTextColor?: string;
|
||||
cellBackground?: string;
|
||||
cellBorderColor?: string;
|
||||
cellActiveColor?: string;
|
||||
cellRequiredColor?: string;
|
||||
cellLabelColor?: string;
|
||||
cellLabelFontSize?: string;
|
||||
cellLabelLineHeight?: number | string;
|
||||
cellLabelMarginTop?: string;
|
||||
cellValueColor?: string;
|
||||
cellIconSize?: string;
|
||||
cellRightIconColor?: string;
|
||||
cellLargeVerticalPadding?: string;
|
||||
cellLargeTitleFontSize?: string;
|
||||
cellLargeLabelFontSize?: string;
|
||||
};
|
||||
@ -1,4 +1,4 @@
|
||||
body {
|
||||
:root {
|
||||
--van-checkbox-size: 20px;
|
||||
--van-checkbox-border-color: var(--van-gray-5);
|
||||
--van-checkbox-duration: var(--van-duration-fast);
|
||||
|
||||
@ -8,6 +8,7 @@ export type { CheckboxProps } from './Checkbox';
|
||||
export type {
|
||||
CheckboxShape,
|
||||
CheckboxInstance,
|
||||
CheckboxThemeVars,
|
||||
CheckboxLabelPosition,
|
||||
} from './types';
|
||||
|
||||
|
||||
@ -17,3 +17,15 @@ export type CheckboxInstance = ComponentPublicInstance<
|
||||
CheckboxProps,
|
||||
CheckboxExpose
|
||||
>;
|
||||
|
||||
export type CheckboxThemeVars = {
|
||||
checkboxSize?: string;
|
||||
checkboxBorderColor?: string;
|
||||
checkboxDuration?: string;
|
||||
checkboxLabelMargin?: string;
|
||||
checkboxLabelColor?: string;
|
||||
checkboxCheckedIconColor?: string;
|
||||
checkboxDisabledIconColor?: string;
|
||||
checkboxDisabledLabelColor?: string;
|
||||
checkboxDisabledBackground?: string;
|
||||
};
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
body {
|
||||
:root {
|
||||
--van-circle-size: 100px;
|
||||
--van-circle-color: var(--van-primary-color);
|
||||
--van-circle-layer-color: var(--van-white);
|
||||
|
||||
@ -5,6 +5,7 @@ export const Circle = withInstall(_Circle);
|
||||
export default Circle;
|
||||
export { circleProps } from './Circle';
|
||||
export type { CircleProps, CircleStartPosition } from './Circle';
|
||||
export type { CircleThemeVars } from './types';
|
||||
|
||||
declare module 'vue' {
|
||||
export interface GlobalComponents {
|
||||
|
||||
9
packages/vant/src/circle/types.ts
Normal file
9
packages/vant/src/circle/types.ts
Normal file
@ -0,0 +1,9 @@
|
||||
export type CircleThemeVars = {
|
||||
circleSize?: string;
|
||||
circleColor?: string;
|
||||
circleLayerColor?: string;
|
||||
circleTextColor?: string;
|
||||
circleTextFontWeight?: string;
|
||||
circleTextFontSize?: string;
|
||||
circleTextLineHeight?: number | string;
|
||||
};
|
||||
@ -1,6 +1,6 @@
|
||||
@import '../style/mixins/hairline';
|
||||
|
||||
body {
|
||||
:root {
|
||||
--van-collapse-item-duration: var(--van-duration-base);
|
||||
--van-collapse-item-content-padding: var(--van-padding-sm)
|
||||
var(--van-padding-md);
|
||||
|
||||
@ -5,7 +5,7 @@ export const CollapseItem = withInstall(_CollapseItem);
|
||||
export default CollapseItem;
|
||||
export { collapseItemProps } from './CollapseItem';
|
||||
export type { CollapseItemProps } from './CollapseItem';
|
||||
export type { CollapseItemInstance } from './types';
|
||||
export type { CollapseItemInstance, CollapseItemThemeVars } from './types';
|
||||
|
||||
declare module 'vue' {
|
||||
export interface GlobalComponents {
|
||||
|
||||
@ -9,3 +9,13 @@ export type CollapseItemInstance = ComponentPublicInstance<
|
||||
CollapseItemProps,
|
||||
CollapseItemExpose
|
||||
>;
|
||||
|
||||
export type CollapseItemThemeVars = {
|
||||
collapseItemDuration?: string;
|
||||
collapseItemContentPadding?: string;
|
||||
collapseItemContentFontSize?: string;
|
||||
collapseItemContentLineHeight?: number | string;
|
||||
collapseItemContentTextColor?: string;
|
||||
collapseItemContentBackground?: string;
|
||||
collapseItemTitleDisabledColor?: string;
|
||||
};
|
||||
|
||||
@ -73,10 +73,10 @@ export default defineComponent({
|
||||
|
||||
if (inBrowser) {
|
||||
const addTheme = () => {
|
||||
document.body.classList.add(`van-theme-${props.theme}`);
|
||||
document.documentElement.classList.add(`van-theme-${props.theme}`);
|
||||
};
|
||||
const removeTheme = (theme = props.theme) => {
|
||||
document.body.classList.remove(`van-theme-${theme}`);
|
||||
document.documentElement.classList.remove(`van-theme-${theme}`);
|
||||
};
|
||||
|
||||
watch(
|
||||
|
||||
@ -69,10 +69,10 @@ Looking at the style of the Button component, you can see that the following var
|
||||
}
|
||||
```
|
||||
|
||||
The default values of these variables are defined on the `body` node:
|
||||
The default values of these variables are defined on the `:root` node:
|
||||
|
||||
```css
|
||||
body {
|
||||
:root {
|
||||
--van-white: #fff;
|
||||
--van-blue: #1989fa;
|
||||
--van-button-primary-color: var(--van-white);
|
||||
@ -88,7 +88,7 @@ You can directly override these CSS variables in the code, and the style of the
|
||||
|
||||
```css
|
||||
/* the Primary Button will turn red */
|
||||
body {
|
||||
:root {
|
||||
--van-button-primary-background: red;
|
||||
}
|
||||
```
|
||||
@ -150,6 +150,18 @@ export default {
|
||||
|
||||
> Tips: ConfigProvider only affects its child components.
|
||||
|
||||
#### Use In TypeScript
|
||||
|
||||
Using `ConfigProviderThemeVars` type to get code intellisense.
|
||||
|
||||
```ts
|
||||
import type { ConfigProviderThemeVars } from 'vant';
|
||||
|
||||
const themeVars: ConfigProviderThemeVars = {
|
||||
sliderBarHeight: '4px',
|
||||
};
|
||||
```
|
||||
|
||||
### Combining dark mode with CSS variables
|
||||
|
||||
If you need to define CSS variables for dark mode or light mode separately, you can use the `theme-vars-dark` and `theme-vars-light` props.
|
||||
@ -197,8 +209,8 @@ CSS variables in Vant are divided into **basic variables** and **component varia
|
||||
|
||||
#### Modify Basic Variables
|
||||
|
||||
- The basic variables can only be modified through the `body` selector.
|
||||
- The component variables can be modified through the `body` selector and `ConfigProvider` component.
|
||||
- The basic variables can only be modified through the `:root` selector.
|
||||
- The component variables can be modified through the `:root` selector and `ConfigProvider` component.
|
||||
|
||||
#### Variables List
|
||||
|
||||
@ -299,5 +311,9 @@ There are all **Basic Variables** below, for component CSS Variables, please ref
|
||||
The component exports the following type definitions:
|
||||
|
||||
```ts
|
||||
import type { ConfigProviderProps, ConfigProviderTheme } from 'vant';
|
||||
import type {
|
||||
ConfigProviderProps,
|
||||
ConfigProviderTheme,
|
||||
ConfigProviderThemeVars,
|
||||
} from 'vant';
|
||||
```
|
||||
|
||||
@ -69,10 +69,10 @@ Vant 组件通过丰富的 [CSS 变量](https://developer.mozilla.org/zh-CN/docs
|
||||
}
|
||||
```
|
||||
|
||||
这些变量的默认值被定义在 `body` 节点上,body 下所有子节点都可以访问到这些变量:
|
||||
这些变量的默认值被定义在 `:root` 节点上,HTML 里的所有子节点都可以访问到这些变量:
|
||||
|
||||
```css
|
||||
body {
|
||||
:root {
|
||||
--van-white: #fff;
|
||||
--van-blue: #1989fa;
|
||||
--van-button-primary-color: var(--van-white);
|
||||
@ -88,7 +88,7 @@ body {
|
||||
|
||||
```css
|
||||
/* 添加这段样式后,Primary Button 会变成红色 */
|
||||
body {
|
||||
:root {
|
||||
--van-button-primary-background: red;
|
||||
}
|
||||
```
|
||||
@ -148,7 +148,19 @@ export default {
|
||||
};
|
||||
```
|
||||
|
||||
> 注意:ConfigProvider 仅影响它的子组件的样式,不影响全局 body 节点。
|
||||
> 注意:ConfigProvider 仅影响它的子组件的样式,不影响全局 root 节点。
|
||||
|
||||
#### 在 TypeScript 中使用
|
||||
|
||||
在 TypeScript 中定义 themeVars 时,建议使用 Vant 提供的 `ConfigProviderThemeVars` 类型,可以提供完善的类型提示:
|
||||
|
||||
```ts
|
||||
import type { ConfigProviderThemeVars } from 'vant';
|
||||
|
||||
const themeVars: ConfigProviderThemeVars = {
|
||||
sliderBarHeight: '4px',
|
||||
};
|
||||
```
|
||||
|
||||
### 结合深色模式与 CSS 变量
|
||||
|
||||
@ -199,8 +211,8 @@ Vant 中的 CSS 变量分为 **基础变量** 和 **组件变量**。组件变
|
||||
|
||||
由于 CSS 变量继承机制的原因,两者的修改方式有一定差异:
|
||||
|
||||
- 基础变量只能通过 `body 选择器` 修改,不能通过 `ConfigProvider 组件` 修改。
|
||||
- 组件变量可以通过 `body 选择器` 和 `ConfigProvider 组件` 修改。
|
||||
- 基础变量只能通过 `:root 选择器` 修改,不能通过 `ConfigProvider 组件` 修改。
|
||||
- 组件变量可以通过 `:root 选择器` 和 `ConfigProvider 组件` 修改。
|
||||
|
||||
#### 变量列表
|
||||
|
||||
@ -303,5 +315,9 @@ Vant 中的 CSS 变量分为 **基础变量** 和 **组件变量**。组件变
|
||||
组件导出以下类型定义:
|
||||
|
||||
```ts
|
||||
import type { ConfigProviderProps, ConfigProviderTheme } from 'vant';
|
||||
import type {
|
||||
ConfigProviderProps,
|
||||
ConfigProviderTheme,
|
||||
ConfigProviderThemeVars,
|
||||
} from 'vant';
|
||||
```
|
||||
|
||||
@ -8,6 +8,7 @@ export type {
|
||||
ConfigProviderProps,
|
||||
ConfigProviderTheme,
|
||||
} from './ConfigProvider';
|
||||
export type { ConfigProviderThemeVars } from './types';
|
||||
|
||||
declare module 'vue' {
|
||||
export interface GlobalComponents {
|
||||
|
||||
72
packages/vant/src/config-provider/types.ts
Normal file
72
packages/vant/src/config-provider/types.ts
Normal file
@ -0,0 +1,72 @@
|
||||
export type ConfigProviderThemeVars =
|
||||
import('../action-bar').ActionBarThemeVars &
|
||||
import('../action-bar-button').ActionBarButtonThemeVars &
|
||||
import('../action-bar-icon').ActionBarIconThemeVars &
|
||||
import('../action-sheet').ActionSheetThemeVars &
|
||||
import('../address-edit').AddressEditThemeVars &
|
||||
import('../address-list').AddressListThemeVars &
|
||||
import('../badge').BadgeThemeVars &
|
||||
import('../button').ButtonThemeVars &
|
||||
import('../calendar').CalendarThemeVars &
|
||||
import('../card').CardThemeVars &
|
||||
import('../cascader').CascaderThemeVars &
|
||||
import('../cell').CellThemeVars &
|
||||
import('../cell-group').CellGroupThemeVars &
|
||||
import('../checkbox').CheckboxThemeVars &
|
||||
import('../circle').CircleThemeVars &
|
||||
import('../collapse-item').CollapseItemThemeVars &
|
||||
import('../contact-card').ContactCardThemeVars &
|
||||
import('../contact-edit').ContactEditThemeVars &
|
||||
import('../contact-list').ContactListThemeVars &
|
||||
import('../count-down').CountDownThemeVars &
|
||||
import('../coupon').CouponThemeVars &
|
||||
import('../coupon-cell').CouponCellThemeVars &
|
||||
import('../coupon-list').CouponListThemeVars &
|
||||
import('../dialog').DialogThemeVars &
|
||||
import('../divider').DividerThemeVars &
|
||||
import('../dropdown-item').DropdownItemThemeVars &
|
||||
import('../dropdown-menu').DropdownMenuThemeVars &
|
||||
import('../empty').EmptyThemeVars &
|
||||
import('../field').FieldThemeVars &
|
||||
import('../grid-item').GridItemThemeVars &
|
||||
import('../image').ImageThemeVars &
|
||||
import('../image-preview').ImagePreviewThemeVars &
|
||||
import('../index-anchor').IndexAnchorThemeVars &
|
||||
import('../index-bar').IndexBarThemeVars &
|
||||
import('../list').ListThemeVars &
|
||||
import('../loading').LoadingThemeVars &
|
||||
import('../nav-bar').NavBarThemeVars &
|
||||
import('../notice-bar').NoticeBarThemeVars &
|
||||
import('../notify').NotifyThemeVars &
|
||||
import('../number-keyboard').NumberKeyboardThemeVars &
|
||||
import('../overlay').OverlayThemeVars &
|
||||
import('../pagination').PaginationThemeVars &
|
||||
import('../password-input').PasswordInputThemeVars &
|
||||
import('../picker').PickerThemeVars &
|
||||
import('../picker-group').PickerGroupThemeVars &
|
||||
import('../popover').PopoverThemeVars &
|
||||
import('../popup').PopupThemeVars &
|
||||
import('../progress').ProgressThemeVars &
|
||||
import('../pull-refresh').PullRefreshThemeVars &
|
||||
import('../radio').RadioThemeVars &
|
||||
import('../rate').RateThemeVars &
|
||||
import('../search').SearchThemeVars &
|
||||
import('../share-sheet').ShareSheetThemeVars &
|
||||
import('../sidebar').SidebarThemeVars &
|
||||
import('../sidebar-item').SidebarItemThemeVars &
|
||||
import('../skeleton').SkeletonThemeVars &
|
||||
import('../slider').SliderThemeVars &
|
||||
import('../step').StepThemeVars &
|
||||
import('../stepper').StepperThemeVars &
|
||||
import('../steps').StepsThemeVars &
|
||||
import('../sticky').StickyThemeVars &
|
||||
import('../submit-bar').SubmitBarThemeVars &
|
||||
import('../swipe').SwipeThemeVars &
|
||||
import('../switch').SwitchThemeVars &
|
||||
import('../tabbar').TabbarThemeVars &
|
||||
import('../tabbar-item').TabbarItemThemeVars &
|
||||
import('../tabs').TabsThemeVars &
|
||||
import('../tag').TagThemeVars &
|
||||
import('../toast').ToastThemeVars &
|
||||
import('../tree-select').TreeSelectThemeVars &
|
||||
import('../uploader').UploaderThemeVars;
|
||||
@ -1,4 +1,4 @@
|
||||
body {
|
||||
:root {
|
||||
--van-contact-card-padding: var(--van-padding-md);
|
||||
--van-contact-card-add-icon-size: 40px;
|
||||
--van-contact-card-add-icon-color: var(--van-primary-color);
|
||||
|
||||
@ -5,6 +5,7 @@ export const ContactCard = withInstall(_ContactCard);
|
||||
export default ContactCard;
|
||||
export { contactCardProps } from './ContactCard';
|
||||
export type { ContactCardType, ContactCardProps } from './ContactCard';
|
||||
export type { ContactCardThemeVars } from './types';
|
||||
|
||||
declare module 'vue' {
|
||||
export interface GlobalComponents {
|
||||
|
||||
6
packages/vant/src/contact-card/types.ts
Normal file
6
packages/vant/src/contact-card/types.ts
Normal file
@ -0,0 +1,6 @@
|
||||
export type ContactCardThemeVars = {
|
||||
contactCardPadding?: string;
|
||||
contactCardAddIconSize?: string;
|
||||
contactCardAddIconColor?: string;
|
||||
contactCardTitleLineHeight?: number | string;
|
||||
};
|
||||
@ -1,4 +1,4 @@
|
||||
body {
|
||||
:root {
|
||||
--van-contact-edit-padding: var(--van-padding-md);
|
||||
--van-contact-edit-fields-radius: var(--van-radius-md);
|
||||
--van-contact-edit-buttons-padding: var(--van-padding-xl) 0;
|
||||
|
||||
@ -5,6 +5,7 @@ export const ContactEdit = withInstall(_ContactEdit);
|
||||
export default ContactEdit;
|
||||
export { contactEditProps } from './ContactEdit';
|
||||
export type { ContactEditInfo, ContactEditProps } from './ContactEdit';
|
||||
export type { ContactEditThemeVars } from './types';
|
||||
|
||||
declare module 'vue' {
|
||||
export interface GlobalComponents {
|
||||
|
||||
8
packages/vant/src/contact-edit/types.ts
Normal file
8
packages/vant/src/contact-edit/types.ts
Normal file
@ -0,0 +1,8 @@
|
||||
export type ContactEditThemeVars = {
|
||||
contactEditPadding?: string;
|
||||
contactEditFieldsRadius?: string;
|
||||
contactEditButtonsPadding?: string;
|
||||
contactEditButtonMarginBottom?: string;
|
||||
contactEditButtonFontSize?: string;
|
||||
contactEditFieldLabelWidth?: string;
|
||||
};
|
||||
@ -1,4 +1,4 @@
|
||||
body {
|
||||
:root {
|
||||
--van-contact-list-edit-icon-size: 16px;
|
||||
--van-contact-list-add-button-z-index: 999;
|
||||
--van-contact-list-radio-color: var(--van-primary-color);
|
||||
|
||||
@ -5,6 +5,7 @@ export const ContactList = withInstall(_ContactList);
|
||||
export default ContactList;
|
||||
export { contactListProps } from './ContactList';
|
||||
export type { ContactListItem, ContactListProps } from './ContactList';
|
||||
export type { ContactListThemeVars } from './types';
|
||||
|
||||
declare module 'vue' {
|
||||
export interface GlobalComponents {
|
||||
|
||||
6
packages/vant/src/contact-list/types.ts
Normal file
6
packages/vant/src/contact-list/types.ts
Normal file
@ -0,0 +1,6 @@
|
||||
export type ContactListThemeVars = {
|
||||
contactListEditIconSize?: string;
|
||||
contactListAddButtonZIndex?: number | string;
|
||||
contactListRadioColor?: string;
|
||||
contactListItemPadding?: string;
|
||||
};
|
||||
@ -1,4 +1,4 @@
|
||||
body {
|
||||
:root {
|
||||
--van-count-down-text-color: var(--van-text-color);
|
||||
--van-count-down-font-size: var(--van-font-size-md);
|
||||
--van-count-down-line-height: var(--van-line-height-md);
|
||||
|
||||
@ -5,7 +5,11 @@ export const CountDown = withInstall(_CountDown);
|
||||
export default CountDown;
|
||||
export { countDownProps } from './CountDown';
|
||||
export type { CountDownProps } from './CountDown';
|
||||
export type { CountDownInstance, CountDownCurrentTime } from './types';
|
||||
export type {
|
||||
CountDownInstance,
|
||||
CountDownThemeVars,
|
||||
CountDownCurrentTime,
|
||||
} from './types';
|
||||
|
||||
declare module 'vue' {
|
||||
export interface GlobalComponents {
|
||||
|
||||
@ -14,3 +14,9 @@ export type CountDownInstance = ComponentPublicInstance<
|
||||
>;
|
||||
|
||||
export type CountDownCurrentTime = CurrentTime;
|
||||
|
||||
export type CountDownThemeVars = {
|
||||
countDownTextColor?: string;
|
||||
countDownFontSize?: string;
|
||||
countDownLineHeight?: number | string;
|
||||
};
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
body {
|
||||
:root {
|
||||
--van-coupon-cell-selected-text-color: var(--van-text-color);
|
||||
}
|
||||
|
||||
|
||||
@ -5,6 +5,7 @@ export const CouponCell = withInstall(_CouponCell);
|
||||
export default CouponCell;
|
||||
export { couponCellProps } from './CouponCell';
|
||||
export type { CouponCellProps } from './CouponCell';
|
||||
export type { CouponCellThemeVars } from './types';
|
||||
|
||||
declare module 'vue' {
|
||||
export interface GlobalComponents {
|
||||
|
||||
3
packages/vant/src/coupon-cell/types.ts
Normal file
3
packages/vant/src/coupon-cell/types.ts
Normal file
@ -0,0 +1,3 @@
|
||||
export type CouponCellThemeVars = {
|
||||
couponCellSelectedTextColor?: string;
|
||||
};
|
||||
@ -1,4 +1,4 @@
|
||||
body {
|
||||
:root {
|
||||
--van-coupon-list-background: var(--van-background);
|
||||
--van-coupon-list-field-padding: 5px 0 5px var(--van-padding-md);
|
||||
--van-coupon-list-exchange-button-height: 32px;
|
||||
@ -16,7 +16,7 @@ body {
|
||||
&__field {
|
||||
padding: var(--van-coupon-list-field-padding);
|
||||
|
||||
.van-field__body {
|
||||
.van-field__:root {
|
||||
height: 34px;
|
||||
padding-left: var(--van-padding-sm);
|
||||
line-height: 34px;
|
||||
|
||||
@ -5,6 +5,7 @@ export const CouponList = withInstall(_CouponList);
|
||||
export default CouponList;
|
||||
export { couponListProps } from './CouponList';
|
||||
export type { CouponListProps } from './CouponList';
|
||||
export type { CouponListThemeVars } from './types';
|
||||
|
||||
declare module 'vue' {
|
||||
export interface GlobalComponents {
|
||||
|
||||
9
packages/vant/src/coupon-list/types.ts
Normal file
9
packages/vant/src/coupon-list/types.ts
Normal file
@ -0,0 +1,9 @@
|
||||
export type CouponListThemeVars = {
|
||||
couponListBackground?: string;
|
||||
couponListFieldPadding?: string;
|
||||
couponListExchangeButtonHeight?: string;
|
||||
couponListCloseButtonHeight?: string;
|
||||
couponListEmptyTipColor?: string;
|
||||
couponListEmptyTipFontSize?: string;
|
||||
couponListEmptyTipLineHeight?: number | string;
|
||||
};
|
||||
@ -1,6 +1,6 @@
|
||||
@import '../style/mixins/ellipsis';
|
||||
|
||||
body {
|
||||
:root {
|
||||
--van-coupon-margin: 0 var(--van-padding-sm) var(--van-padding-sm);
|
||||
--van-coupon-content-height: 84px;
|
||||
--van-coupon-content-padding: 14px 0;
|
||||
@ -76,7 +76,7 @@ body {
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
&__body {
|
||||
&__:root {
|
||||
position: relative;
|
||||
flex: 1;
|
||||
border-radius: 0 var(--van-coupon-radius) var(--van-coupon-radius) 0;
|
||||
|
||||
@ -4,6 +4,7 @@ import _Coupon from './Coupon';
|
||||
export const Coupon = withInstall(_Coupon);
|
||||
export default Coupon;
|
||||
export type { CouponInfo } from './Coupon';
|
||||
export type { CouponThemeVars } from './types';
|
||||
|
||||
declare module 'vue' {
|
||||
export interface GlobalComponents {
|
||||
|
||||
19
packages/vant/src/coupon/types.ts
Normal file
19
packages/vant/src/coupon/types.ts
Normal file
@ -0,0 +1,19 @@
|
||||
export type CouponThemeVars = {
|
||||
couponMargin?: string;
|
||||
couponContentHeight?: string;
|
||||
couponContentPadding?: string;
|
||||
couponContentTextColor?: string;
|
||||
couponBackground?: string;
|
||||
couponActiveBackground?: string;
|
||||
couponRadius?: string;
|
||||
couponShadow?: string;
|
||||
couponHeadWidth?: string;
|
||||
couponAmountColor?: string;
|
||||
couponAmountFontSize?: string;
|
||||
couponCurrencyFontSize?: string;
|
||||
couponNameFontSize?: string;
|
||||
couponDisabledTextColor?: string;
|
||||
couponDescriptionPadding?: string;
|
||||
couponDescriptionBorderColor?: string;
|
||||
couponCheckboxColor?: string;
|
||||
};
|
||||
@ -186,6 +186,7 @@ Vant exports following Dialog utility functions:
|
||||
| confirm-button-text | Confirm button text | _string_ | `Confirm` |
|
||||
| confirm-button-color | Confirm button color | _string_ | `#ee0a24` |
|
||||
| confirm-button-disabled `v3.5.0` | Whether to disable confirm button | _boolean_ | `false` |
|
||||
| z-index | Set the z-index to a fixed value | _number \| string_ | `2000+` |
|
||||
| overlay | Whether to show overlay | _boolean_ | `true` |
|
||||
| overlay-class | Custom overlay class | _string_ | - |
|
||||
| overlay-style | Custom overlay style | _object_ | - |
|
||||
|
||||
@ -207,6 +207,7 @@ Vant 中导出了以下 Dialog 相关的辅助函数:
|
||||
| cancel-button-text | 取消按钮文案 | _string_ | `取消` |
|
||||
| cancel-button-color | 取消按钮颜色 | _string_ | `black` |
|
||||
| cancel-button-disabled `v3.5.0` | 是否禁用取消按钮 | _boolean_ | `false` |
|
||||
| z-index | 将弹窗的 z-index 层级设置为一个固定值 | _number \| string_ | `2000+` |
|
||||
| overlay | 是否展示遮罩层 | _boolean_ | `true` |
|
||||
| overlay-class | 自定义遮罩层类名 | _string_ | - |
|
||||
| overlay-style | 自定义遮罩层样式 | _object_ | - |
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
body {
|
||||
:root {
|
||||
--van-dialog-width: 320px;
|
||||
--van-dialog-small-screen-width: 90%;
|
||||
--van-dialog-font-size: var(--van-font-size-lg);
|
||||
@ -132,12 +132,12 @@ body {
|
||||
}
|
||||
|
||||
&-bounce-enter-from {
|
||||
transform: translate3d(-50%, -50%, 0) scale(0.7);
|
||||
transform: translate3d(0, -50%, 0) scale(0.7);
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
&-bounce-leave-active {
|
||||
transform: translate3d(-50%, -50%, 0) scale(0.9);
|
||||
transform: translate3d(0, -50%, 0) scale(0.9);
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -17,6 +17,7 @@ export type {
|
||||
DialogTheme,
|
||||
DialogMessage,
|
||||
DialogOptions,
|
||||
DialogThemeVars,
|
||||
DialogMessageAlign,
|
||||
} from './types';
|
||||
|
||||
|
||||
@ -32,3 +32,25 @@ export type DialogOptions = {
|
||||
confirmButtonDisabled?: boolean;
|
||||
closeOnClickOverlay?: boolean;
|
||||
};
|
||||
|
||||
export type DialogThemeVars = {
|
||||
dialogWidth?: string;
|
||||
dialogSmallScreenWidth?: string;
|
||||
dialogFontSize?: string;
|
||||
dialogTransition?: string;
|
||||
dialogRadius?: string;
|
||||
dialogBackground?: string;
|
||||
dialogHeaderFontWeight?: string;
|
||||
dialogHeaderLineHeight?: number | string;
|
||||
dialogHeaderPaddingTop?: string;
|
||||
dialogHeaderIsolatedPadding?: string;
|
||||
dialogMessagePadding?: string;
|
||||
dialogMessageFontSize?: string;
|
||||
dialogMessageLineHeight?: number | string;
|
||||
dialogMessageMaxHeight?: string;
|
||||
dialogHasTitleMessageTextColor?: string;
|
||||
dialogHasTitleMessagePaddingTop?: string;
|
||||
dialogButtonHeight?: string;
|
||||
dialogRoundButtonHeight?: string;
|
||||
dialogConfirmButtonTextColor?: string;
|
||||
};
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
body {
|
||||
:root {
|
||||
--van-divider-margin: var(--van-padding-md) 0;
|
||||
--van-divider-text-color: var(--van-text-color-2);
|
||||
--van-divider-font-size: var(--van-font-size-md);
|
||||
|
||||
@ -5,6 +5,7 @@ export const Divider = withInstall(_Divider);
|
||||
export default Divider;
|
||||
export { dividerProps } from './Divider';
|
||||
export type { DividerProps, DividerContentPosition } from './Divider';
|
||||
export type { DividerThemeVars } from './types';
|
||||
|
||||
declare module 'vue' {
|
||||
export interface GlobalComponents {
|
||||
|
||||
10
packages/vant/src/divider/types.ts
Normal file
10
packages/vant/src/divider/types.ts
Normal file
@ -0,0 +1,10 @@
|
||||
export type DividerThemeVars = {
|
||||
dividerMargin?: string;
|
||||
dividerTextColor?: string;
|
||||
dividerFontSize?: string;
|
||||
dividerLineHeight?: number | string;
|
||||
dividerBorderColor?: string;
|
||||
dividerContentPadding?: string;
|
||||
dividerContentLeftWidth?: string;
|
||||
dividerContentRightWidth?: string;
|
||||
};
|
||||
@ -1,4 +1,4 @@
|
||||
body {
|
||||
:root {
|
||||
--van-dropdown-item-z-index: 10;
|
||||
}
|
||||
|
||||
|
||||
@ -5,7 +5,11 @@ export const DropdownItem = withInstall(_DropdownItem);
|
||||
export default DropdownItem;
|
||||
export { dropdownItemProps } from './DropdownItem';
|
||||
export type { DropdownItemProps };
|
||||
export type { DropdownItemInstance, DropdownItemOption } from './types';
|
||||
export type {
|
||||
DropdownItemOption,
|
||||
DropdownItemInstance,
|
||||
DropdownItemThemeVars,
|
||||
} from './types';
|
||||
|
||||
declare module 'vue' {
|
||||
export interface GlobalComponents {
|
||||
|
||||
@ -29,3 +29,7 @@ export type DropdownItemInstance = ComponentPublicInstance<
|
||||
DropdownItemProps,
|
||||
DropdownItemExpose
|
||||
>;
|
||||
|
||||
export type DropdownItemThemeVars = {
|
||||
dropdownItemZIndex?: number | string;
|
||||
};
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
body {
|
||||
:root {
|
||||
--van-dropdown-menu-height: 48px;
|
||||
--van-dropdown-menu-background: var(--van-background-2);
|
||||
--van-dropdown-menu-shadow: 0 2px 12px rgba(100, 101, 102, 0.12);
|
||||
|
||||
@ -5,7 +5,7 @@ export const DropdownMenu = withInstall(_DropdownMenu);
|
||||
export default DropdownMenu;
|
||||
export { dropdownMenuProps } from './DropdownMenu';
|
||||
export type { DropdownMenuProps };
|
||||
export type { DropdownMenuDirection } from './types';
|
||||
export type { DropdownMenuDirection, DropdownMenuThemeVars } from './types';
|
||||
|
||||
declare module 'vue' {
|
||||
export interface GlobalComponents {
|
||||
|
||||
@ -8,3 +8,17 @@ export type DropdownMenuProvide = {
|
||||
props: DropdownMenuProps;
|
||||
offset: Ref<number>;
|
||||
};
|
||||
|
||||
export type DropdownMenuThemeVars = {
|
||||
dropdownMenuHeight?: string;
|
||||
dropdownMenuBackground?: string;
|
||||
dropdownMenuShadow?: string;
|
||||
dropdownMenuTitleFontSize?: string;
|
||||
dropdownMenuTitleTextColor?: string;
|
||||
dropdownMenuTitleActiveTextColor?: string;
|
||||
dropdownMenuTitleDisabledTextColor?: string;
|
||||
dropdownMenuTitlePadding?: string;
|
||||
dropdownMenuTitleLineHeight?: number | string;
|
||||
dropdownMenuOptionActiveColor?: string;
|
||||
dropdownMenuContentMaxHeight?: string;
|
||||
};
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user