简体   繁体   English

在Wails应用程序中实现WrapBootstrap主题

[英]Implementing WrapBootstrap theme into Rails App

I just bought a wrapbootstrap theme and am trying to insert it into my rails application. 我刚买了一个wrapbootstrap主题,我试图将它插入我的rails应用程序。 Some of the css like the padding, navbar, glyphicons, and most of the javascripts are not functioning correctly. 一些像填充,导航栏,glyphicons和大多数javascripts的CSS都无法正常运行。 I copied all the stylesheets and javascripts into the assets/stylesheets and assets/javascripts respectively. 我将所有样式表和javascripts分别复制到assets / stylesheets和assets / javascripts中。 Any idea how to fix these issues? 知道如何解决这些问题吗?

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 . 您应首先打开您的css文件,并用普通images/替换所有对../img/ dir的调用,以使管道找到主题的图形元素。 That's the easy part . 这很容易。

For using the glyphs you should create a new dir under assets , for example fonts . 要使用这些字形,您应该在资产下创建一个新的目录,例如fonts Then copy the glyphs images there and expand the usable assets in application.rb file , like this : 然后在那里复制字形图像并在application.rb文件中展开可用资源,如下所示:

 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-awesome.css重命名为font-awesome.css.scss.erb并在其中更改@font-face声明,如下所示:

@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 . 如果我错过了一小部分,那是因为星期六晚上的红酒......不要犹豫,要求提供更多细节。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM