Skip to content

Commit 682d3c2

Browse files
committed
feat: update veui and import number font
1 parent 714d2a4 commit 682d3c2

File tree

6 files changed

+118
-60
lines changed

6 files changed

+118
-60
lines changed

assets/styles/post.styl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,17 +64,17 @@ margin-y($top, $bottom = $top)
6464

6565
h4
6666
h4&
67-
margin-y(1.15em, 1.1em)
67+
margin-y(1.4em, 1.2em)
6868
font-size 18px
6969

7070
h5
7171
h5&
72-
margin-y(1.05em)
72+
margin-y(1.5em)
7373
font-size 14px
7474

7575
h6
7676
h6&
77-
margin-y(1em)
77+
margin-y(1.3em)
7878
font-size 12px
7979

8080
h1
@@ -384,6 +384,7 @@ margin-y($top, $bottom = $top)
384384
h4
385385
h4&
386386
font-size 16px
387+
387388
h5
388389
h5&
389390
font-size 14px

nuxt.config.js

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,11 @@ module.exports = {
3030
content: 'Website for VEUI: an enterprise component library for Vue.js.'
3131
},
3232
{
33-
name: 'theme-color', content: '#0052cc'
33+
name: 'theme-color',
34+
content: '#0052cc'
3435
}
3536
],
36-
link: [
37-
{ rel: 'shortcut icon', href: 'https://www.baidu.com/favicon.ico' }
38-
]
37+
link: [{ rel: 'shortcut icon', href: 'https://www.baidu.com/favicon.ico' }]
3938
},
4039
/**
4140
* Customize the progress bar color
@@ -46,7 +45,12 @@ module.exports = {
4645
css: false
4746
},
4847

49-
css: ['veui-theme-dls/common.less', '@/assets/styles/global.styl', 'veui-theme-dls/'],
48+
css: [
49+
'veui-theme-dls/common.less',
50+
'veui-theme-dls/typography.less',
51+
'@/assets/styles/global.styl',
52+
'veui-theme-dls/'
53+
],
5054

5155
plugins: [
5256
{ src: '~plugins/hm.js', ssr: false },
@@ -64,7 +68,13 @@ module.exports = {
6468

6569
parallel: true,
6670

67-
transpile: ['veui', 'vue-awesome', 'resize-detector', 'less-plugin-dls', 'dls-graphics'],
71+
transpile: [
72+
'veui',
73+
'vue-awesome',
74+
'resize-detector',
75+
'less-plugin-dls',
76+
'dls-graphics'
77+
],
6878

6979
babel: {
7080
plugins: ['veui']

one/docs/en-US/getting-started/index.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,27 @@ Import from JavaScript:
8282
```js
8383
import 'veui-theme-dls/common.less'
8484
```
85+
86+
87+
#### The number font
88+
89+
[[ demo src="/demo/style/number.vue" ]]
90+
91+
The default theme `veui-theme-dls` comes with a display type number font “Baidu Number”, but it is not included in the global style by default because the web font will be loaded automatically. If you need to use it, please import it manually in your project:
92+
93+
```js
94+
import 'veui-theme-dls/typography.less'
95+
```
96+
97+
Once imported, you can use a font named `"Baidu Number"` in your CSS. For scenarios envolving dynamic numbers, we may want fixed width numbers to ensure layout stability. You can set `font-variant-numeric: tabular-nums` to enable the corresponding Open Type feature which comes with this font.
98+
99+
```css
100+
.heading-numbers {
101+
font-family: "Baidu Number", sans-serif;
102+
font-variant-numeric: tabular-nums; /* Fixed-width numbers */
103+
}
104+
```
105+
106+
:::warning
107+
Please make sure that `veui-theme-dls/common.less` and `veui-theme-dls/typography.less` are only introduced once, importing them in multiple components' `<style>` blocks will result in duplicate content output.
108+
:::

one/docs/getting-started/index.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,33 @@ VEUI 采取了样式主题与组件代码分离的开发、发布方式。组件
7676

7777
### 全局样式
7878

79-
在使用 `veui-theme-dls` 时,需要先全局引入基础样式以及,包括样式的 normalize 及一些基本元素的样式。
79+
在使用默认主题 `veui-theme-dls` 时,需要先全局引入基础样式以及,包括样式的 normalize 及一些基本元素的样式。
8080

8181
从 JavaScript 引入:
8282

8383
```js
8484
import 'veui-theme-dls/common.less'
8585
```
86+
87+
#### 数字字体
88+
89+
[[ demo src="/demo/style/number.vue" ]]
90+
91+
默认主题 `veui-theme-dls` 自带一款展示型的数字字体“Baidu Number”,但由于启用后会自动加载 Web 字体,故默认未包含在全局样式中。需要使用时请在项目中手动引入:
92+
93+
```js
94+
import 'veui-theme-dls/typography.less'
95+
```
96+
97+
引入后可在 CSS 中使用名为 `"Baidu Number"` 的字体。同时在动态数字场景下,往往需要数字等宽以保证布局的相对稳定,此时可以设置 `font-variant-numeric: tabular-nums` 以开启字体中的对应 Open Type 功能。
98+
99+
```css
100+
.heading-numbers {
101+
font-family: "Baidu Number", sans-serif;
102+
font-variant-numeric: tabular-nums; /* 等宽场景 */
103+
}
104+
```
105+
106+
:::warning
107+
请确保 `veui-theme-dls/common.less``veui-theme-dls/typography.less` 只被引入一次,在多个组件中重复引入将导致内容重复输出。
108+
:::

package-lock.json

Lines changed: 45 additions & 45 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"@vue/runtime-dom": "^3.2.31",
2828
"babel-eslint": "^10.1.0",
2929
"babel-plugin-lodash": "^3.3.4",
30-
"babel-plugin-veui": "^2.6.5",
30+
"babel-plugin-veui": "^2.7.0",
3131
"cheerio": "^1.0.0-rc.10",
3232
"dls-graphics": "^1.0.0-alpha.3",
3333
"dls-icons-vue": "^2.6.0",
@@ -86,10 +86,10 @@
8686
"typescript": "^4.6.2",
8787
"unist-util-remove": "^1.0.1",
8888
"unist-util-visit": "^1.4.0",
89-
"veui": "^2.6.5",
90-
"veui-loader": "^2.6.5",
91-
"veui-theme-dls": "^2.6.5",
92-
"veui-theme-dls-icons": "^2.6.5",
89+
"veui": "^2.7.0",
90+
"veui-loader": "^2.7.0",
91+
"veui-theme-dls": "^2.7.0",
92+
"veui-theme-dls-icons": "^2.7.0",
9393
"vue-awesome": "^4.5.0",
9494
"vue-frag": "^1.4.0",
9595
"vue-i18n": "^8.16.0",

0 commit comments

Comments
 (0)