Skip to content

Commit

Permalink
types: update styleVars.d.ts and improve docs
Browse files Browse the repository at this point in the history
  • Loading branch information
haoziqaq committed Oct 11, 2024
1 parent 2c9273e commit 213a605
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 19 deletions.
10 changes: 3 additions & 7 deletions packages/varlet-ui/src/alert/example/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ onThemeChange()
<app-type>{{ t('title') }}</app-type>
<var-alert :title="t('alertTitle')" />

<app-type>{{ t('content') }}</app-type>
<app-type>{{ t('message') }}</app-type>
<var-alert :message="t('alertText')" />

<app-type>{{ t('type') }}</app-type>
Expand All @@ -29,7 +29,7 @@ onThemeChange()

<app-type>{{ t('variant') }}</app-type>
<var-space direction="column" size="large">
<var-select v-model="type" :options="options" />
<var-select variant="outlined" size="small" v-model="type" :options="options" />
<var-alert :title="t('alertTitle')" :message="t('alertText')" :type="type" />
<var-alert variant="tonal" :title="t('alertTitle')" :message="t('alertText')" :type="type" />
<var-alert variant="outlined" :title="t('alertTitle')" :message="t('alertText')" :type="type" />
Expand All @@ -43,9 +43,5 @@ onThemeChange()
</var-alert>

<app-type>{{ t('allowToClose') }}</app-type>
<var-alert v-if="show" :title="t('alertTitle')" :message="t('alertText')" closeable @close="show = false">
<template #icon>
<var-icon name="heart" />
</template>
</var-alert>
<var-alert v-if="show" :title="t('alertTitle')" :message="t('alertText')" closeable @close="show = false" />
</template>
2 changes: 1 addition & 1 deletion packages/varlet-ui/src/alert/example/locale/en-US.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export default {
title: 'Title',
content: 'Content',
message: 'Message',
alertTitle: 'Pride And Prejudice',
alertText: `I can't say exactly when, where, what expression I saw on your face, or what words I heard, that made me fall in love with you.`,
type: 'Type',
Expand Down
2 changes: 1 addition & 1 deletion packages/varlet-ui/src/alert/example/locale/zh-CN.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export default {
title: '标题',
content: '内容',
message: '信息',
alertTitle: '傲慢与偏见',
alertText: '我也说不准是在什么时间,什么地点,看见你的什么神情,听见你的什么言语,便开始爱上了你。',
type: '类型',
Expand Down
24 changes: 14 additions & 10 deletions packages/varlet-ui/types/styleVars.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,26 @@ interface BaseStyleVars {
'--action-sheet-icon-size'?: string
'--alert-padding'?: string
'--alert-border-radius'?: string
'--alert-icon-margin-right'?: string
'--alert-close-icon-margin-left'?: string
'--alert-outlined-color'?: string
'--alert-standard-color'?: string
'--alert-error-background'?: string
'--alert-icon-size'?: string
'--alert-icon-margin'?: string
'--alert-close-icon-size'?: string
'--alert-close-icon-margin'?: string
'--alert-standard-info-text-color'?: string
'--alert-standard-danger-text-color'?: string
'--alert-standard-success-text-color'?: string
'--alert-standard-warning-text-color'?: string
'--alert-danger-background'?: string
'--alert-success-background'?: string
'--alert-warning-background'?: string
'--alert-info-background'?: string
'--alert-tonal-error-background'?: string
'--alert-tonal-danger-background'?: string
'--alert-tonal-success-background'?: string
'--alert-tonal-warning-background'?: string
'--alert-tonal-info-background'?: string
'--alert-tonal-error-color'?: string
'--alert-tonal-success-color'?: string
'--alert-tonal-warning-color'?: string
'--alert-tonal-info-color'?: string
'--alert-tonal-danger-text-color'?: string
'--alert-tonal-success-text-color'?: string
'--alert-tonal-warning-text-color'?: string
'--alert-tonal-info-text-color'?: string
'--alert-message-font-size'?: string
'--alert-title-font-size'?: string
'--alert-title-font-weight'?: string
Expand Down

0 comments on commit 213a605

Please sign in to comment.