twitter-bootstrap 使用 bower 安装 sass 版本的 twitter bootstrap

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/24497728/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-21 21:02:30  来源:igfitidea点击:

Install sass version of twitter bootstrap with bower

twitter-bootstraptwitter-bootstrap-3

提问by Hamid

I'm trying to install twitter bootstrap-sass with compass on windows. I'm installed any require things and now I have folder with this structure after running "compass create my-new-project -r bootstrap-sass --using bootstrap" command in cmd :

我正在尝试在 Windows 上安装带有指南针的 twitter bootstrap-sass。我安装了任何需要的东西,现在在 cmd 中运行“compass create my-new-project -r bootstrap-sass --using bootstrap”命令后,我有了这个结构的文件夹:

site
 |_ .sass-cache folder
 |_ javascripts 
 | |_ bootstrap folder 
 | |_ bootstrap.js 
 | |_ bootstrap-sprockets.js 
 |_ sass 
 | |_ bootstrap-variables.scss 
 | |_ styles.scss 
 |_ stylesheets 
 | |_ fonts 
 | |_ styles
 |_ config.rb

so how can I use twitter bootstrap now ?

那么我现在如何使用 twitter bootstrap 呢?

NOTE: I think my sass files is not completely import to this folder (just two files !!!)

注意:我认为我的 sass 文件没有完全导入到这个文件夹(只有两个文件!!!)

回答by BenjaminCorey

To initialize a bower project after you've installed bower you can do

要在安装 bower 后初始化 bower 项目,您可以执行以下操作

bower init

This will walk you through an interactive prompt to setup your bower.json file.

这将引导您完成交互式提示以设置您的 bower.json 文件。

Once bower is setup, you can do:

设置凉亭后,您可以执行以下操作:

bower install bootstrap-sass-official --save

This will download and install the sass version of Bootstrap to ./bower_components

这将下载并安装 Bootstrap 的 sass 版本到 ./bower_components

Once that is complete, you can require bootstrap in styles.scsslike so:

完成后,您可以styles.scss像这样要求引导程序:

//= require ../bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap.scss

However, because you're using compass, you might just want to use the bootstrap-sass gem by following the instructions here: https://github.com/twbs/bootstrap-sass#b-compass-without-rails

但是,因为您使用的是指南针,您可能只想按照以下说明使用 bootstrap-sass gem:https: //github.com/twbs/bootstrap-sass#b-compass-without-rails