Tag: twitter bootstrap

通过LESS将字体松鼠生成的字体集成到Twitter Bootstrap中

我试图使用字体松鼠生成的字体作为Twitter Bootstrap的基础字体(从LESS文件编译)。 我在Node.js中使用Express.js,并在字体目录中包含了字体文件 myapp |_ public |_ stylesheets |_ font 我已经通过更改bootstrap.less的variables来“安装”Font Awesome,并让它工作,所以我知道目录结构是正确的。 使用字体目录中的自定义字体文件,我下一步要去哪里? 我是否需要制作一个包含@font-face声明的my-custom-font.less文件,还是需要在引导LESS文件之一中声明这个文件? 我知道基础字体是通过@baseFontFamily属性在variables.less声明的,但正如我所描述的,我不太确定如何声明这是我的自定义字体系列。 提前致谢。 编辑 下面是我尝试使用的代码片段: @ChatypePath: "font"; @font-face { font-family: 'chatypeb2.1regular'; src: url('@{ChatypePathPath}/chatypeb2.1regular-webfont.eot?v=3.0.1'); src: url('@{ChatypePathPath}/chatypeb2.1regular-webfont.eot?#iefix&v=3.0.1') format('embedded-opentype'), url('@{ChatypePathPath}/chatypeb2.1regular-webfont.woff?v=3.0.1') format('woff'), url('@{ChatypePathPath}/chatypeb2.1regular-webfont.ttf?v=3.0.1') format('truetype'); } 注 :这里有一些错误。 更新: 正确的声明: @chatypeFontFamily: "ChatypeB2.1ThinThin", "Courier New", monospace; @font-face { font-family: 'ChatypeB2.1ThinThin'; src: url('font/chatypeb2.1thin-webfont.eot'); src: url('font/chatypeb2.1thin-webfont.eot?#iefix') format('embedded-opentype'), url('font/chatypeb2.1thin-webfont.woff') format('woff'), url('font/chatypeb2.1thin-webfont.ttf') […]

Bootstrap和JQuery与节点js

我想知道当我运行这两个命令: npm install jquery npm install boostrap 比我添加我的package.json文件中的两个依赖。 比我的代码我的app.js文件 var $ = require('jquery'); var bootstrap = require('bootstrap'); 在我的index.ejs文件中,是否需要将链接放到jquery文件或css文件中,或者我可以直接使用这些库? 如果不是的话,有人可以给我的configuration,我需要使用npm bootstrap。

在纯npm版本的NW.js(node-webkit)应用程序中加载Bootstrap

我正在尝试使用NW.js构build一个简单的桌面应用程序。 受到包括这一个职位在内的一些职位的启发,我想尝试一种纯粹的npm方法,没有任何bower , grunt或gulp 。 所以我继续使用安装了npm模块的jquery和bootstrap库。 当我在我的应用程序的JavaScript注入模块像这样: global.jQuery = $ = require("jquery"); var bootstrap = require("bootstrap"); 我得到一个ReferenceError: document is not defined从bootstrap ReferenceError: document is not defined 。 我可以通过老式的方式加载HTML文件,虽然: <script type="text/javascript" src="node_modules/bootstrap/dist/js/bootstrap.js"></script> 我问自己,如果这是一个愚蠢的想法加载引导低谷require在脚本文件? 基本上,我不需要那里。 它可以通过html中的脚本标签加载。 什么是最佳实践? 我很困惑。 更新。 解决scheme 从@Kuf的build议,我创build了一个build.js脚本 var copyfiles = require('copyfiles'); copyfiles(["node_modules/bootstrap/dist/js/bootstrap.js", "vendor/js"], true, function (err) { if (err) return console.error(err); }); copyfiles(["node_modules/bootstrap/dist/css/bootstrap.css", […]

Node.js无法find模块 – 干扰Windows上的cygwin

我正在testingBootstrap框架(来自Twitter),并尝试在安装Node.js之后在本地构build它。 它失败了,因为它找不到较less的模块(我也安装了'npm install -g less'): C:\Users\geir\code\bootstrap>make lessc html/less/bootstrap.less > html/css/bootstrap.css node.js:201 throw e; // process.nextTick error, or 'error' event on first tick ^ Error: Cannot find module 'C:\cygdrive\c\Users\geir\AppData\Roaming\npm\node_modules\less\bin\lessc' at Function._resolveFilename (module.js:332:11) at Function._load (module.js:279:25) at Array.0 (module.js:479:10) at EventEmitter._tickCallback (node.js:192:40) Makefile:2: recipe for target `all' failed make: *** [all] Error 1 之所以失败,是因为“cygdrive”是在制作模块时查找文件夹的层次结构,我已经validation了“lessc”实际上是在C:\ Users \ geir […]

节点JSconfiguration

我试图configuration我的节点js运行我的HTML代码。我使用引导程序和Express Js也。当我运行节点js它不加载css.Can任何人都可以帮我什么可能是问题。这里是节点js代码片段。 var express = require("express"); var app = express(); var path = require("path"); app.get('/',function(req,res) { res.sendFile(__dirname + '/home.html') }) app.use(express.static(__dirname + '/public')) app.listen(3000); console.log("Running at Port 3000"); 当我直接加载的HTML文件,它正确地加载CSS,但是当我使用节点js加载它失败。什么可能是问题的原因?

Sails.js:如何在bootstrap中使用i18n

如何在Sails.js的bootstrap中使用i18n? 这里是控制器动作中的“res.i18n”,但是我没有find像sails.i18n这样的全局实例(已经初始化)。 我猜下面的代码应该在bootstrap.js中工作: i18n = require('i18n'), i18n.configure({ locales: sails.config.i18n.locales, directory: sails.config.appPath + sails.config.i18n.localesDirectory, defaultLocale: sails.config.i18n.defaultLocale, updateFiles: false, extension: '.json' }); __('Hello'); 但是可能有更好的办法吗?

用nodejspipe理第三方库(不是节点模块)?

我正在使用package.json文件来定义nodejs需求,以及npm update ,当然,工作正常。 我怎样才能pipe理(更新简单的方法)与节点的其他第三方库? 例如: https://github.com/documentcloud/backbone.git https://github.com/twitter/bootstrap.git 在vendor文件夹。

错误:找不到模块npm-shrinkwrap

设置引导与咕噜声。 获取以下错误: 找不到模块npm-shrinkwrap 尝试npm安装shrinkwrap,仍然得到相同的错误。

在安装引导程序4testing版时使用npm解决依赖关系

我是bootstrap的新手4.在使用npm安装bootstrap 4 beta(bootstrap的最后一个版本)时,它显示了这些错误:npm WARN bootstrap@4.0.0-beta需要jquery @> = 3.0.0的同位体,但是没有被安装。 npm WARN bootstrap@4.0.0-beta需要popper.js@^1.11.0的同行,但没有安装。 我正在使用Git Bash,我也试图单独安装jquery,但无法安装,请你帮我解决这些问题?

我们如何在Windows中使用NPM将Lesscss升级到最新版本?

我最近把我的网站从Bootstrap 2升级到了Bootstrap 3.在编译bootstrap.less时,我遇到了以分号分隔参数的错误。 该修复显然是升级到最新版本的Lesscss。 我已经尝试了以下内容: 打开一个node.js命令提示符并运行以下命令 npm安装较less 这并不能解决问题。 需要做些什么才能正确更新lesscss?