【问题标题】:re-adding glyphicons back to bootstrap 4.0将 glyphicons 重新添加回 bootstrap 4.0
【发布时间】:2019-02-05 17:33:04
【问题描述】:

您好,我使用称为minton 的引导程序主题,它使用很棒的字体处理图标。我认为这是一个引导 3/4 的事情。

简而言之:This boostrap 4.0 lacks glypicons。我想添加它们。太多的依赖项需要它们。我在字体目录中有字形字体

  • asssets/fonts/glyphicons-halflings-regular.eot
  • asssets/fonts/glyphicons-halflings-regular.svg
  • asssets/fonts/glyphicons-halflings-regular.tff
  • asssets/fonts/glyphicons-halflings-regular.woff

并且 bootstrap.min.css 在这里 - asssets/css/bootstrap.min.css

我通过 icons.css(除其他外)将这个 css 添加到页面中

@font-face {
    font-family: 'Glyphicons Halflings';

    src: url('../fonts/glyphicons-halflings-regular.eot');
    src: url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('../fonts/glyphicons-halflings-regular.woff') format('woff'), url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg');
}

但它们没有在请求时出现。任何人都可以阐明这一点吗?

【问题讨论】:

  • 你能更清楚地知道你需要字体真棒还是字形?它们是独立的产品
  • This boostrap 4.0 lacks glypicons. I would like to add them 我使用依赖字形图标的malot.fr/bootstrap-datetimepicker/demo.php

标签: html css bootstrap-4 glyphicons


【解决方案1】:

Bootstrap 4 不再有字形图标,因此如果您使用 boostrap 4,则需要找到另一个解决方案(例如 font-awesome)

您提到了日期选择器库,该库支持引导程序 2 和 3,并提到它正在贬值以支持这个:https://eonasdan.github.io/bootstrap-datetimepicker/

最好的办法是替换该组件,而不是尝试改造某些旧库的部分以使另一个旧库正常工作,最终需要更换。你不妨早点而不是晚点把它联系起来。无论如何都需要完成工作,这可能是因为我们有点面向未来。

【讨论】:

  • 其他日期时间选择器在 minton 上不起作用(它拒绝显示)。我在这上面花了 2 天时间。作为一个方面,请你不要再猜测一个问题。用 OP 回答问题“这是一个糟糕的问题”并不是正确的行为方式。
  • 我的观点更多的是寻找另一种解决方案,而不是提到的解决方案。你用的是什么 JS 库?
  • minton 使用 datepicker 和 daterangepicker 并故意(我认为)从它的表单中错过 datetimepicker-> 高级页面 coderthemes.com/minton/dark-dark/form-advanced.html
  • 如果你去coderthemes.com/minton/dark-dark/form-elements.html你也会看到他们也没有在那里使用它。我在使用了 4 个库(其中三个被称为 boostrap-datetimepicker 但彼此之间没有任何共同点,其中一个是古老的、可怕的但至少有效的)之后发现了最简单的事情是使用一个可以工作的库,但唯一的问题是字形图标。添加它们应该很简单
  • 有趣的是,eonasdan 的项目 i18n 更差,功能更少,标记因您所在的页面而异,根本无法说明 format(我发现它使用moment 进行日期格式设置,但它没有say 所以),并且它没有仅日期机制的工作示例(该示例至少不起作用)并且不是引导程序4 并且也依赖于使用 glyphicons
猜你喜欢
  • 2014-01-08
  • 1970-01-01
  • 1970-01-01
  • 2015-11-26
  • 2017-08-23
  • 2014-06-15
  • 2013-08-15
  • 2013-05-02
相关资源
最近更新 更多