【问题标题】:grails 3.3.0: does it include bootstrap?grails 3.3.0:它包括引导程序吗?
【发布时间】:2017-07-10 16:57:01
【问题描述】:

当试图弄清楚如何将引导程序导入 grails 3.3.0 时,当支持此功能的插件已过期/不受支持时,我注意到 application.css 中已经有一个引导程序条目:

*= require bootstrap
*= require grails
*= require main
*= require mobile
*= require_self

在 bootsrap.css 中显示其版本为 3.3.6。

这似乎是一个未记录的功能,并且有很多关于如何将引导程序导入 grails 3 的帖子,如果它已经存在则毫无意义,除非他们试图弄清楚如何更新引导程序版本?

为了查看引导程序是否正常工作,我编辑了默认的 main.gsp 并添加了:

<button type="button" class="btn btn-default btn-lg">
  <span class="glyphicon glyphicon-star" aria-hidden="true"></span> Star
</button>

不幸的是,渲染的内容似乎被破坏了 - 字形应该是一个方形框。

我尝试了许多其他引导示例,但它们似乎不起作用,即没有正确呈现。我不知道这是因为 bootstrap 不起作用,还是在 grails 默认生成的数千行 CSS 的内部,所有内容都被覆盖了。

有谁知道我可以在 main.gps 中添加一些东西,如果引导程序正常工作,它会显示一种或另一种方式?

【问题讨论】:

    标签: grails twitter-bootstrap-3


    【解决方案1】:

    它只包括引导样式表。如果要使用字形图标,需要单独下载字形字体。

    这也可以在引导样式表中看到,因为字体指的是不存在的库。

    @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.woff2') format('woff2'), 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');
    }
    

    我猜唯一包括引导样式表,用于设置不使用字形图标的起始“模板”的样式。

    完整的Bootstrap包如下图(http://getbootstrap.com/getting-started/#download):

    bootstrap/
    ├── css/
    │   ├── bootstrap.css
    │   ├── bootstrap.css.map
    │   ├── bootstrap.min.css
    │   ├── bootstrap.min.css.map
    │   ├── bootstrap-theme.css
    │   ├── bootstrap-theme.css.map
    │   ├── bootstrap-theme.min.css
    │   └── bootstrap-theme.min.css.map
    ├── js/
    │   ├── bootstrap.js
    │   └── bootstrap.min.js
    └── fonts/
        ├── glyphicons-halflings-regular.eot
        ├── glyphicons-halflings-regular.svg
        ├── glyphicons-halflings-regular.ttf
        ├── glyphicons-halflings-regular.woff
        └── glyphicons-halflings-regular.woff2
    

    【讨论】:

      猜你喜欢
      • 2018-05-04
      • 1970-01-01
      • 1970-01-01
      • 2013-11-14
      • 2016-07-19
      • 2015-07-11
      • 1970-01-01
      • 2018-03-19
      • 1970-01-01
      相关资源
      最近更新 更多