最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Implementing WrapBootstrap theme into Rails App - Stack Overflow

programmeradmin4浏览0评论

I just bought a wrapbootstrap theme and am trying to insert it into my rails application. Some of the css like the padding, navbar, glyphicons, and most of the javascripts are not functioning correctly. I copied all the stylesheets and javascripts into the assets/stylesheets and assets/javascripts respectively. Any idea how to fix these issues?

I just bought a wrapbootstrap theme and am trying to insert it into my rails application. Some of the css like the padding, navbar, glyphicons, and most of the javascripts are not functioning correctly. I copied all the stylesheets and javascripts into the assets/stylesheets and assets/javascripts respectively. Any idea how to fix these issues?

Share Improve this question asked Jan 5, 2013 at 20:06 pjmanningpjmanning 1,3111 gold badge21 silver badges48 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 16

It's a nice collection of themes , indeed . You should first open your css files and replace all calls to ../img/ dir with plain images/ to make pipeline find the graphic elements of the theme . That's the easy part .

For using the glyphs you should create a new dir under assets , for example fonts . Then copy the glyphs images there and expand the usable assets in application.rb file , like this :

 config.assets.paths << Rails.root.join("app", "assets", "fonts")

After that , you should rename your font-awesome.css to font-awesome.css.scss.erb and change the @font-face declaration in it like this :

@font-face {
font-family: "FontAwesome";
src: url('<%= asset_path('fontawesome-webfont.eot')%>');
src: url('<%= asset_path('fontawesome-webfont.eot?#iefix')%>') format('eot'), url('<%=    asset_path('fontawesome-webfont.woff')%>') format('woff'), url('<%= asset_path('fontawesome-webfont.ttf')%>') format('truetype'), url('<%= asset_path('fontawesome-webfont.svg#FontAwesome')%>') format('svg');
font-weight: normal;
font-style: normal;
}

If I've missed some small part, it is because of the Saturday night red wine ... Do not hessitate to ask for more details .

发布评论

评论列表(0)

  1. 暂无评论