【问题标题】:How to use Bootstrap Mixins with Sass rather than Less? [closed]如何在 Sass 而不是 Less 中使用 Bootstrap Mixins? [关闭]
【发布时间】:2012-12-26 18:19:33
【问题描述】:

我第一次在使用 Sass/Scss 和 bootstrap-sass https://github.com/thomas-mcdonald/bootstrap-sass 的 Rails 应用程序中使用 Bootstrap mixin,例如 @include border-radius(5px);

这是一次很棒的体验,因为我能够使用许多 bootstrap mixin 而无需迁移到/学习 LESS,如果您想在应用中启用 mixins,bootstrap 会建议您:http://twitter.github.com/bootstrap/extend.html

我现在正在开发一个非 Rails 应用程序,但仍希望将 bootstrap mixins 与 SASS 一起使用,而不是 LESS。有谁知道非 Rails 应用程序的库或引导 sass mixin?

如果相关,我在新应用中使用 django。

【问题讨论】:

    标签: twitter-bootstrap sass less mixins


    【解决方案1】:

    更新

    Bootstrap 现在有一个官方 Sass 端口,可在此处获得:https://github.com/twbs/bootstrap-sass

    以前的

    我发现了一个用 sass 编写的 bootstrap 版本,比将 ruby​​/compass/bootstrap-sass 安装到运行非 Rails 应用程序的系统上要容易得多。

    https://www.github.com/jlong/sass-twitter-bootstrap

    我从 sass-twitter-bootstrap 复制了 lib 并附加了主 sass 文件“bootstrap.scss”。

    完成!无需在任何已经可以处理 sass 的系统上安装任何额外的东西。

    【讨论】:

    • Bootstrap 现在有一个official Sass port,应该使用它来代替上面答案中的链接。
    • @Chris 谢谢,我会更新这个答案。
    猜你喜欢
    • 2013-08-26
    • 2012-06-21
    • 2015-03-05
    • 2014-04-29
    • 2020-01-27
    • 2020-11-20
    • 2014-03-03
    • 2015-08-25
    相关资源
    最近更新 更多