Skip to content
This repository has been archived by the owner on Nov 3, 2020. It is now read-only.

Commit

Permalink
close #26. add support for rem. add submodule for bootcamp
Browse files Browse the repository at this point in the history
  • Loading branch information
ezekg committed Nov 6, 2014
1 parent 2256445 commit aef9953
Show file tree
Hide file tree
Showing 10 changed files with 96 additions and 40 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "tests/bootcamp"]
path = tests/bootcamp
url = git://github.com/thejameskyle/bootcamp.git
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

### 2.1.0
* Added support for `rem` values.
* Set up proper submodule for Bootcamp.

### 2.0.9
* Fixed issue with `$gutter: center` attempting to divide by `auto`.
* Wrote tests for `$gutter` modifiers.
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "flint",
"version": "2.0.9",
"version": "2.1.0",
"main": "stylesheets/_flint.scss",
"description": "Flint is a highly advanced Sass grid framework designed for rapid responsive development.",
"authors": ["Ezekiel Gabrielse <ezekg@yahoo.com>"],
Expand Down
2 changes: 1 addition & 1 deletion lib/flint/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Flint
VERSION = "2.0.9"
VERSION = "2.1.0"
end
14 changes: 14 additions & 0 deletions stylesheets/flint/functions/helpers/_helpers.scss
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,20 @@
@return ($target / $context) * 1em;
}

//
/// Convert pixel value to rem
///
/// @access private
///
/// @param {Number} $target - pixel value
/// @param {Number} $context - context to divide by
///
/// @return {Number} rem value of target relative to context
///
@function flint-to-rem($target, $context: $flint__base-font-size) {
@return ($target / $context) * 1rem;
}

///
/// Use Ruby functions in place of Sass functions where possible
/// to speed up performance, especially with string functions
Expand Down
65 changes: 39 additions & 26 deletions stylesheets/flint/mixins/lib/_main.scss

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion tests/bootcamp
Submodule bootcamp updated from 7e98f3 to b3616e
21 changes: 21 additions & 0 deletions tests/input/functions/helpers/_helpers.scss
Original file line number Diff line number Diff line change
Expand Up @@ -414,3 +414,24 @@
);
}
}

//
// Convert pixel value to rem
//
@include describe("[function] to-rem") {

@include it("should expect passed pixel value to be converted to rems") {
@include should(expect(
flint-to-rem(16px)),
to(be(1rem))
);
@include should(expect(
flint-to-rem(32px)),
to(be(2rem))
);
@include should(expect(
flint-to-rem(16px, 32px)),
to(be(0.5rem))
);
}
}
15 changes: 8 additions & 7 deletions tests/input/output.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
///
/// Configuration map
///

// Bootcamp
@import "../bootcamp/dist/bootcamp";

// Flint
@import "../../stylesheets/flint";

$flint: (
"breakpoints": (
"desktop": (
Expand Down Expand Up @@ -32,13 +39,7 @@ $flint: (
"support-syntax": false,
"debug-mode": false
)
);

// Bootcamp
@import "../bootcamp/bootcamp";

// Flint
@import "../../stylesheets/flint";
) !global;

// Enable development mode
$flint__development-mode: true !global;
Expand Down
8 changes: 4 additions & 4 deletions tests/output/output.css
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,10 @@

Test Results {
Success: true;
Stats: ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔;
Tests: 77;
Asserts: 177;
Passed: 77;
Stats: ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔;
Tests: 78;
Asserts: 180;
Passed: 78;
Failed: 0;
Skipped: 0;
}
Expand Down

0 comments on commit aef9953

Please sign in to comment.