加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

twitter-bootstrap – 为什么Twitter Bootstrap使用像素字体大小

发布时间:2020-12-17 23:34:00 所属栏目:安全 来源:网络整理
导读:鉴于Twitter Bootstrap设计为响应/设备友好,为什么不使用相对字体大小? 解决方法 好像看起来他们是 hiding behind the browser zoom excuse.真的很遗憾看到这样一个高度使用和有影响力的框架完全忽视可访问性问题和响应式设计的根本基石。他们处于极大责任
鉴于Twitter Bootstrap设计为响应/设备友好,为什么不使用相对字体大小?

解决方法

好像看起来他们是 hiding behind the browser zoom excuse.真的很遗憾看到这样一个高度使用和有影响力的框架完全忽视可访问性问题和响应式设计的根本基石。他们处于极大责任的位置,不幸的是似乎没有打算采取相应行动。

[更新]所以今天马克Otto回答我上面提到的线程。可以预见,没有提及的可达性和使用短语“像素完美”:

Okay,so here’s a bit of a background on the decisions of yesteryear
and plans for moving forward.

Pixels provide absolute control and consistent rendering across every
browser.

Designers still mostly think and operate in pixels.

Browsers
scale up entire pages these days,so it’s not an issue with type
scaling or anything.

Nesting ems historically has been a pain and can require extra math for figure computed/intended pixel values.

Mixing units of measurements is ugly and my inner OCD hates it.
Using units on line-height is generally discouraged,but provides immediate
knowledge of what the computed value is. We’ll probably try to steer
away from this in the future.
In the future,we’ll likely use ems for type sizing,perhaps rems even,but not for anything else. This is also debatable on font sizes for inputs and the like. It’s just not how folks build pixel perfect sites.

That’s a bit all over and hopefully coherent enough. I’ll try to blog about these changes as they come up more,but I’m unsure how close 3.0 is and what that will all entail yet.

我建议任何人有强烈的感觉这一点和1 this thread。

[更新] 07路线图V2.3 release blogpost中没有提到添加支持ems。

[更新]了解有关Bootstrap V3的更多信息,请求here包括以下来自Mark Otto:

We explored the use of rem units over pixels,but found little benefit
to offset the implications of their use. IE8 would still need a pixel
fallback,and that’s a lot of duplicate lines of code. Moreover,using
rems everywhere instead of pixels would exacerbate that problem.
Mixing rems and pixels doesn’t seem to make sense either right now.
However,we can and will continue to evaluate this in future releases.

然后最近(在其评论):

I highly doubt we’ll be shipping with rems at this point. Changing
everything—beyond font-sizes—is a huge task and one that comes with
few benefits to offset that. Double the lines of code for font-sizes
aside,supporting rems in any other way seems tedious at best. That
said,we can always revisit in a future release. For now,we’re
sticking with pixels.

对大量的Bootstrap的功能不满意,特别是缺乏em支持,我强烈建议看Susy如果你只是想要网格,或者Zurb Foundation 4为整个enchilada。不要让Bootstrap的受欢迎程度影响你的判断。任何人都可以使用Bootstrap构建一个东西,这正是它的问题 – 它是为最小的web体验的人设计的。只是因为有很多麦当劳在世界上并不意味着它是一个健康的地方吃。

[编辑]这是一个蠢的事情要说。自从我写这个,我使用BS3,它已经提高了它的游戏相当。我不应该这样一个一次性的评论,但我仍然认为它使用像素的字体大小做了一个坏的决定。除了辅助功能问题,ems在其他方面很有用。

[更新]看起来像V4支持rems(Mdo引自here):

For those following along,we’ll be able to change from pixels to REMs in v4 when we drop IE8 support. Can’t do much until then.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读