【问题标题】:Where can I find compass's source files in Windows?在 Windows 中哪里可以找到 compass 的源文件?
【发布时间】:2014-11-25 12:47:36
【问题描述】:

我希望能够使用极少数选择compass mixin,但不想像这样使用compass,即完全使用指南针:

 @import "compass";
 @import "compass/reset";
 @import "compass/css3";

那么,mixin 是否安装在我的计算机上?我已经查看了类似于并包括此路径的地方:

 C:\Ruby200-x64\lib\ruby\gems\2.0.0\gems\compass-0.12.2\examples\css3\src

也许我的想法不正确?

【问题讨论】:

  • 只使用 Compass 有什么问题?您可以只导入包含所需 mixin 的特定文件。
  • 遗憾的是编译需要 5 秒,如果它需要更长的时间,我很高兴只使用没有指南针的 susy!

标签: javascript sass gruntjs compass-sass


【解决方案1】:

我不确定您是否可以在安装后实际查看源文件。由于 Compass 是开源的,你可以在 Github 上查看所有内容:https://github.com/Compass/compass/tree/stable/core/stylesheets/compass

例如,这里是来自css3/border-radius的mixin:

@mixin border-corner-radius($vert, $horz, $radius: $default-border-radius) {
  @include with-each-prefix(border-radius, $border-radius-threshold) {
    @if $current-prefix == -moz {
      // Support for mozilla's syntax for specifying a corner
      @include prefix-prop("border-radius-#{$vert}#{$horz}", $radius);
    } @else {
      // Official syntax for everyone else
      @include prefix-prop("border-#{$vert}-#{$horz}-radius", $radius);
    }
  }
}

【讨论】:

  • 要是我知道它们如此复杂就好了 :) 它似乎不仅仅是简单 sass :D
  • 那是因为它不是。它使用来自 caniuse.com 的数据来确定是否需要添加前缀。
猜你喜欢
  • 2013-11-24
  • 2016-09-18
  • 1970-01-01
  • 1970-01-01
  • 2015-08-09
  • 2012-01-16
  • 2015-08-31
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多