更新字体
This commit is contained in:
parent
3ad79bc529
commit
62f8bfda2d
@ -5,6 +5,15 @@
|
||||
|
||||
(本质上只是给创建 html 的js方法套了一层使其能够链式调用)
|
||||
|
||||
```bash
|
||||
npm version patch # 修复问题
|
||||
npm version minor # 添加功能
|
||||
npm version major # 破坏性更改
|
||||
|
||||
npm publish
|
||||
```
|
||||
|
||||
|
||||
```bash
|
||||
npm i @laniakeasupercluster/widgets
|
||||
```
|
||||
|
2
index.js
2
index.js
@ -1,4 +1,4 @@
|
||||
import { div, span, pre, h1, h2, p, ul, li, button, createElement } from './main.js'
|
||||
import { div, span, pre, h1, h2, p, ul, li, button } from './main.js'
|
||||
import { Dialog } from './widgets/dialog.js'
|
||||
|
||||
document.body.style.fontFamily = 'Arial, sans-serif'
|
||||
|
4
main.js
4
main.js
@ -103,8 +103,8 @@ export function createElement({ innerText, innerHTML, textContent, readOnly, chi
|
||||
}
|
||||
|
||||
if (key === 'font') {
|
||||
if (['bold', 'semibold'].includes(value)) {
|
||||
const fontWeightMap = { 'semibold': 600, 'bold': 700 }
|
||||
if (['medium', 'bold', 'semibold'].includes(value)) {
|
||||
const fontWeightMap = { 'medium':500, 'semibold': 600, 'bold': 700 }
|
||||
element.style.fontWeight = fontWeightMap[value]
|
||||
return
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@laniakeasupercluster/widgets",
|
||||
"description": "A simple widgets tracker",
|
||||
"version": "1.1.6",
|
||||
"version": "1.1.7",
|
||||
"type": "module",
|
||||
"main": "main.js",
|
||||
"author": "Laniakea Supercluster <huan0016@gmail.com>",
|
||||
|
Loading…
Reference in New Issue
Block a user