【问题标题】:Yeoman mobile with twitter bootstrap: glyphicons are missing带有 twitter 引导程序的 Yeoman 移动设备:缺少字形图标
【发布时间】:2014-06-18 14:48:47
【问题描述】:

我已经使用 yo mobile 构建了应用程序,并支持 twitter 引导程序。但是我不能使用 glyphicons,因为没有创建 /styles/vendor/fonts 文件夹(我知道 glyphicons 应该在 /styles/vendor/fonts 内,因为我可以在 chrome 网络选项卡中看到浏览器未成功请求 http://localhost:3333/styles/vendor/fonts/glyphiconshalflings-regular.woff)。

实际上字形图标保存在/bower_components/bootstrap/dist/fonts 文件夹中。我可以将这些字体复制粘贴到/styles/vendor/fonts 中,这样就可以了。但是,yeoman 应该让我免于进行额外的复制粘贴,赖特?

所以问题是:有什么方法可以修改我的配置以使字形图标出现在/styles/vendor/fonts 文件夹中?

    compass: {
        options: {
            sassDir: '<%= yeoman.app %>/styles',
            cssDir: '.tmp/styles',
            generatedImagesDir: '.tmp/images/generated',
            imagesDir: '<%= yeoman.app %>/images',
            javascriptsDir: '<%= yeoman.app %>/scripts',
            /*fontsDir: '<%= yeoman.app %>/styles/fonts',*/
            importPath: '<%= yeoman.app %>/bower_components',
            httpImagesPath: '/images',
            httpGeneratedImagesPath: '/images/generated',
            httpFontsPath: '/styles/fonts',
            relativeAssets: false
        },
        dist: {},
        server: {
            options: {
                debugInfo: true
            }
        }
    },

【问题讨论】:

    标签: twitter-bootstrap gruntjs compass-sass yeoman


    【解决方案1】:

    您可以尝试添加 grunt-contrib-copy 任务来自动化复制样式的过程

    我认为,最好为此添加单独的任务:

    grunt.registerTask('install', ['copy']);
    

    在此任务中,您可以简单地将字体样式从 bower_components/bootstrap 文件夹复制到 /styles/vendor/fonts

    【讨论】:

    • 谢谢,最终做到了。
    猜你喜欢
    • 2012-11-27
    • 1970-01-01
    • 2012-08-11
    • 1970-01-01
    • 2019-04-24
    • 2013-12-21
    • 2011-05-24
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多