-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,3 +9,4 @@ gem "haml" | |
gem "sass" | ||
gem "RedCloth" | ||
gem "rdiscount" | ||
gem "compass" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
Feature: Compass integration | ||
|
||
I want to integrate Compass | ||
So that I can use it inside a layout | ||
|
||
Background: | ||
|
||
Given input file "_pith/config.rb" contains | ||
""" | ||
require 'pith/plugins/compass' | ||
""" | ||
|
||
Scenario: Sass template | ||
|
||
Given input file "style.css.sass" contains | ||
""" | ||
@import "compass/typography/links/hover-link" | ||
a.mylink | ||
@include hover-link | ||
""" | ||
|
||
When I build the site | ||
Then output file "style.css" should contain /a.mylink { text-decoration: none; }/ | ||
|
||
Scenario: Scss template | ||
|
||
Given input file "style.css.scss" contains | ||
""" | ||
@import "compass/typography/links/hover-link"; | ||
a.mylink { | ||
@include hover-link; | ||
} | ||
""" | ||
|
||
When I build the site | ||
Then output file "style.css" should contain /a.mylink { text-decoration: none; }/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
require "compass" | ||
require "tilt/css" | ||
|
||
module Pith | ||
module Compass | ||
|
||
module Initialize | ||
|
||
def initialize(file=nil, line=1, options={}, &block) | ||
options = options.merge(::Compass.sass_engine_options) | ||
super(file, line, options, &block) | ||
end | ||
|
||
end | ||
|
||
class SassTemplate < Tilt::SassTemplate | ||
include Initialize | ||
end | ||
|
||
class ScssTemplate < Tilt::ScssTemplate | ||
include Initialize | ||
end | ||
|
||
end | ||
end | ||
|
||
Tilt.register Pith::Compass::SassTemplate, 'sass' | ||
Tilt.register Pith::Compass::ScssTemplate, 'scss' |
82dd823
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I love all of this.