kraken
kraken copied to clipboard
Kraken input element 默认 font-size 大小与 web 不一致
使用的 Kraken 版本 | What version of kraken are you using
main
重现步骤 | Steps To Reproduce
Kraken 上 input 默认 font-size 为 16px,web 上为 13.3333px。
重现代码 | Code example:
it('basic', async () => {
const input = document.createElement('input');
input.style.width = '100px';
input.setAttribute('value', 'Hello World');
document.body.appendChild(input);
await snapshot();
});
预期结果 | Expected results:
实际结果 | Actual results:
Thanks for opening this issue!
通过比较发现 input 的默认 font-size 大小并无标准,取决于浏览器自身设置,chrome 为 13.3333px,safari 和 firefox 为 11px,因此 Kraken 是否需要 follow chrome 的设置?还是保留目前 16px 的不变即可。
input的font-size应该是相对 input 本身的高度的吧?
我记得默认值是按照 line-height 实现的, 当时还查过标准
我记得默认值是按照 line-height 实现的, 当时还查过标准
应该都是UA定义的,w3c 应该不会去规范组件的样式
看 W3C mail list 讨论,form 字体大小是继承自系统设置,从字体大小来看正好等于 10pt
Linux menu fonts long ago were typically 10pt (13.33px),
https://lists.w3.org/Archives/Public/www-style/2018Apr/0012.html