【问题标题】:What language is this? (Bootcamp, Compass and Sass)这是什么语言? (新兵训练营、指南针和 Sass)
【发布时间】:2014-10-08 10:12:00
【问题描述】:

我正在使用Bootcamp 进行单元测试。在官方 Bootcamp 教程中有一个示例测试套装。它为您提供三个文件:

函数/数学

@function power($base, $exponent) {
  $result: 1;

  @if $exponent >= 0 {
    @for $i from 1 through $exponent {
      $result: $result * $base;
    }
  } @else {
    @for $i from $exponent to 0 {
      $result: $result / $base;
    }
  }

  @return $result;
}

specs/math.scss

@include describe("Math Power") {
  @include it("should expect positive values to be calculated correctly") {
    @include should( expect( power( 10, 2) ), to( equal(  100 )));
    @include should( expect( power(  2, 2) ), to( equal(    4 )));
    @include should( expect( power(0.5, 2) ), to( equal( 0.25 )));
  }

  @include it("should expect negative values to be calculated correctly") {
    @include should( expect( power( 10, -2) ), to( equal( 0.01 )));
    @include should( expect( power(  2, -2) ), to( equal( 0.25 )));
    @include should( expect( power(0.5, -2) ), to( equal(    4 )));
  }
}

specs.scss

@import "functions/math";

@import "bootcamp";
$bc-setting-verbose:  false;
$bc-setting-warnings: false;

@include runner-start;
@import "specs/math";
@include runner-end;

我知道 3 号只是很粗鲁,不是吗?但是我不知道数字 1 和 2 中使用的是什么语言。今天我发现了 Compass 和 Framework Bootcamp 是什么框架,我不知道我在读的是 Compass 还是 Bootcamp。

【问题讨论】:

  • Bootcamp 和 Compass 不是语言。
  • 好的。你说得对。我只想知道数字 1 和 2 写的是什么。

标签: sass compass-sass


【解决方案1】:

所有三个代码 sn-ps 的语言都是 Sass。 Compass 和 Bootcamp 是基于 Sass 语言构建的框架。

来自 Bootcamp 的 readme.md 文件 (https://github.com/thejameskyle/bootcamp):

用 Sass for Sass 编写的 Jasmine 风格的 BDD 测试。

来自 Compass 的帮助页面 (http://compass-style.org/help/):

Compass 是一个开源 CSS 创作框架,它使用 Sass 样式表语言使编写样式表变得强大而简单。

【讨论】:

    猜你喜欢
    • 2012-10-18
    • 2011-10-04
    • 2012-04-06
    • 1970-01-01
    • 1970-01-01
    • 2011-05-05
    • 2013-04-12
    • 2015-11-19
    • 1970-01-01
    相关资源
    最近更新 更多