【发布时间】:2015-06-03 02:47:53
【问题描述】:
我正在使用这个 gem bootstrap-material-design,它是 https://github.com/FezVrasta/bootstrap-material-design 库的 sass 版本,但最近我注意到不再维护 sass 版本。
问题我面临的这个宝石是它不会将按钮和闪烁消息转换为材质样式。
这里建议的一个解决方案:https://github.com/FezVrasta/bootstrap-material-design/issues/535 是使用 LESS 版本,但我不知道如何集成这个库的 LESS 版本。 有人已经这样做了吗?
更新:
如果有人希望在不使用任何框架或服务器端语言(如 Ruby、PHP 等)的情况下将 Bootstrap-Material-Design 添加到他们的网站,只需使用 HTML5、CSS3 和 JS。他们可以按照以下说明进行操作:
安装和下载 bootstrap-material 文件夹
bower install bootstrap-material-design
在head标签下链接bootstrap css和material css压缩文件
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="./bower_components/bootstrap-material-design/dist/css/material-fullpalette.min.css">
链接 Javascript 文件
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<script src="/bower_components/bootstrap-material-design/dist/js/ripples.min.js"></script>
<script src="/bower_components/bootstrap-material-design/dist/js/material.min.js"></script>
最后你必须用这个脚本在你的身体底部初始化一些材质组件
<script>
$(document).ready(function() {
$.material.init();
});
</script>
【问题讨论】:
-
您可能想查看Rails Assets,它具有从相应的 Bower 包构建的
rails-assets-bootstrap-material-designgem。这可能会使事情变得更简单。或者可能不是。无论如何都值得一试。 -
看起来很有趣,我一定会去看看。谢谢你:)
标签: css ruby-on-rails twitter-bootstrap-3 less bootstrap-material-design