Merge branch 'stable'

* stable: (81 commits)
  Gemfiles for testing and a rails test helper that works for both rails 2 and rails 3.
  provide correct installation steps when the compass validator is not found.
  Fix a broken test case.
  That wasn't supposed to be released yet.
  Fixed error: there is no opposite-position(both)
  Fix a bug in the statistics analyzer for rules with interpolation.
  bump version for release
  upgrade to bundler 1.0
  link the docs to the stable branch.
  Update the CHANGELOG for the 0.10.5 release
  Read assets in binary mode for the windows users.
  bump version.
  Get the imports straightend out for the new mixins.
  Bug fix: make the path-based configuration really work right.
  inline-block-list tests
  inline-block-list documentation
  inline-block-list mixin
  added additional html5 block-level elements per recommended reset stylesheet: http://html5doctor.com/html-5-reset-stylesheet/
  Prepare for release.
  Prepare for release
  ...

Conflicts:
	VERSION.yml
	doc-src/content/CHANGELOG.markdown
	frameworks/blueprint/stylesheets/blueprint/_colors.scss
	frameworks/compass/stylesheets/compass/css3/_box-shadow.scss
	frameworks/compass/stylesheets/compass/css3/_font-face.scss
This commit is contained in:
Chris Eppstein 2010-08-28 14:07:47 -07:00
commit 034012295a
87 changed files with 1126 additions and 381 deletions

1
.gitignore vendored
View File

@ -1,5 +1,6 @@
*.DS_Store *.DS_Store
*.tmproj *.tmproj
*.lock
sync sync
tmp/* tmp/*
examples/*/stylesheets/* examples/*/stylesheets/*

8
Gemfile Normal file
View File

@ -0,0 +1,8 @@
source :rubygems
gem "compass", :path => "."
gem "cucumber"
gem "rspec"
gem "rails", "~>3.0.0.rc"
gem "compass-validator"
gem "css_parser"

8
Gemfile_rails2 Normal file
View File

@ -0,0 +1,8 @@
source :rubygems
gem "compass", :path => "."
gem "cucumber"
gem "rspec"
gem "rails", "~>2.3"
gem "compass-validator"
gem "css_parser"

View File

@ -3,3 +3,4 @@
:minor: 11 :minor: 11
:state: alpha :state: alpha
:build: 0 :build: 0

View File

@ -13,7 +13,7 @@ Gem::Specification.new do |gemspec|
gemspec.executables = %w(compass) gemspec.executables = %w(compass)
gemspec.has_rdoc = false gemspec.has_rdoc = false
gemspec.require_paths = %w(lib) gemspec.require_paths = %w(lib)
gemspec.rubygems_version = "1.3.6" gemspec.rubygems_version = "1.3.5"
gemspec.summary = %q{A Real Stylesheet Framework} gemspec.summary = %q{A Real Stylesheet Framework}
gemspec.add_dependency('haml', '>= 3.0.4') gemspec.add_dependency('haml', '>= 3.0.4')
gemspec.files = %w(README.markdown LICENSE.markdown VERSION.yml Rakefile) gemspec.files = %w(README.markdown LICENSE.markdown VERSION.yml Rakefile)

View File

@ -1,116 +1,55 @@
--- GIT
dependencies: remote: git://github.com/chriseppstein/nanoc.git
fssm: revision: 3982942
group:
- :default
version: ">= 0"
compass:
group:
- :default
version: ">= 0"
rake:
group:
- :default
version: ">= 0"
haml:
group:
- :default
version: ">= 3.0.6"
require:
- sass
thor:
group:
- :default
version: ">= 0"
serve:
group:
- :default
version: = 0.10.2
mime-types:
group:
- :default
version: ">= 0"
rack:
group:
- :default
version: ">= 0"
json:
group:
- :default
version: ">= 0"
nanoc3:
group:
- :default
version: ">= 0"
require: []
css-slideshow:
group:
- :default
version: = 0.2.0
compass-susy-plugin:
group:
- :default
version: ">= 0.7.0.pre8"
rdiscount:
group:
- :default
version: ">= 0"
coderay:
group:
- :default
version: ">= 0"
nokogiri:
group:
- :default
version: ">= 0"
specs:
- rake:
version: 0.8.7
- activesupport:
version: 2.3.8
- coderay:
version: 0.9.3
- haml:
version: 3.0.6
- compass:
version: 0.10.2
source: 0
- compass-susy-plugin:
version: 0.7.0.rc2
- cri:
version: 1.0.1
- css-slideshow:
version: 0.2.0
- fssm:
version: 0.1.4
- json:
version: 1.4.3
- mime-types:
version: "1.16"
- nanoc3:
version: 3.1.2
source: 1
- nokogiri:
version: 1.4.2
- rack:
version: 1.1.0
- rdiscount:
version: 1.6.3.2
- serve:
version: 0.10.2
- thor:
version: 0.13.6
hash: 178d5e4f426c2d1a39af604e5edcd8bae16a395e
sources:
- Path:
path: !ruby/object:Pathname
path: ..
- Git:
uri: git://github.com/chriseppstein/nanoc.git
branch: 3.1.x branch: 3.1.x
require: false specs:
git: git://github.com/chriseppstein/nanoc.git nanoc3 (3.1.2)
ref: 398294262623dac9bb15dcbbfc0ba33c04f8125e cri (>= 1.0.0)
- Rubygems:
uri: http://gemcutter.org PATH
remote: /Users/chris/Projects/compass
specs:
compass (0.10.5.pre.0)
haml (>= 3.0.4)
GEM
remote: http://rubygems.org/
specs:
activesupport (2.3.8)
coderay (0.9.3)
compass-susy-plugin (0.7.0)
compass (>= 0.10.0)
cri (1.0.1)
css-slideshow (0.2.0)
compass (>= 0.10.0.rc3)
fssm (0.1.4)
haml (3.0.16)
json (1.4.5)
mime-types (1.16)
nokogiri (1.4.3.1)
rack (1.2.1)
rake (0.8.7)
rdiscount (1.6.5)
serve (0.10.2)
activesupport (>= 2.0.2)
thor (0.14.0)
PLATFORMS
ruby
DEPENDENCIES
coderay
compass!
compass-susy-plugin (>= 0.7.0.pre8)
css-slideshow (= 0.2.0)
fssm
haml (>= 3.0.6)
json
mime-types
nanoc3!
nokogiri
rack
rake
rdiscount
serve (= 0.10.2)
thor

View File

@ -2,8 +2,6 @@
require 'compass' require 'compass'
puts "Compass running from: #{Compass.lib_directory}"
Compass.add_configuration "#{File.dirname(__FILE__)}/.compass/config.rb" Compass.add_configuration "#{File.dirname(__FILE__)}/.compass/config.rb"
SITE_ROOT = "/docs" SITE_ROOT = "/docs"

View File

@ -7,6 +7,7 @@ layout: article
COMPASS CHANGELOG COMPASS CHANGELOG
================= =================
<<<<<<< HEAD:doc-src/content/CHANGELOG.markdown
0.11.alpha.1 0.11.alpha.1
------------ ------------
@ -39,6 +40,79 @@ COMPASS CHANGELOG
* `+opacity` no longer uses any prefixed variations, as IE uses `filter` and * `+opacity` no longer uses any prefixed variations, as IE uses `filter` and
all other modern browsers support the official spec or nothing at all. all other modern browsers support the official spec or nothing at all.
=======
0.10.5 (UNRELEASED)
-------------------
* The [HTML5 Reset mixin][html5-reset] now resets the following new elements:
`canvas`, `details`, `figcaption`, `hgroup`, `menu`, `summary`
* A new Utility mixin has been added: [inline-block-list][inline-block-list].
* Compass projects can now (as was always intended) use paths outside of the project directory
for css, images, fonts, etc by configuring those locations using `xxx_path` instead of
`xxx_dir`. For instance: `css_path = "/var/www/docroot/css"`. It is recommended
to set the corresponding `http_xxx_path` when you do this, for instance:
`http_stylesheets_path = "/css"`. On the command line, all absolute urls are
treated as paths instead of relative directories so
`--css-dir /var/www/docroot/css` will set `css_path`. Should both a directory
and a path be specified, the path will override the corresponding directory.
0.10.4 (8/08/2010)
------------------
* [Rails] Fixed a bug introduced in 0.10.3 that caused rails applications using the old configuration file (config/compass.config) to break.
* [Extensions] Make it easier to create manifest files by allowing template files to be discovered. See the Manifest Declarations section of [extensions tutorial](http://compass-style.org/docs/tutorials/extensions/) for details.
* [Rails] Don't install configuration files when installing extensions.
* [Compass Core] All url helpers now accept a second argument that when true will cause only the path to be emitted. This allows the url helpers to be used with IE filters.
0.10.3 (8/1/2010)
-----------------
### !important
All rails users should run the following command:
compass init rails --prepare
This will update your compass initializer file.
### Compass Core
* Add missing clearfix import to horizontal-list.
* Emit less css for inline lists with the same result.
* New helper `opposite-position($position)` returns the opposite value of a position. [Documentation](http://compass-style.org/docs/reference/compass/helpers/constants/)
* Allow horizontal lists to be floated to the right.
* Bugfix for inline-font-files helper.
* `+font-face` mixin no longer uses `$postscript` name or `$style` type variables, in favor of the Paul Irish [smiley bulletproof technique](http://paulirish.com/2009/bulletproof-font-face-implementation-syntax/). Older declarations will still work, but will not apply the variables and will display a deprecation warning.
* `+box-shadow` now supports `$spread` length and `$inset` declarations.
* The gradient mixins output official w3c declarations along with the `-webkit` and `-moz` prefixed versions. The official code is based on the w3c spec and is nearly ideantical to the mozilla version, although it is currently not supported by any browser.
* `+opacity` no longer uses any prefixed variations, as IE uses `filter` and
all other modern browsers support the official spec or nothing at all.
* Support for specifying horizontal and vertical radii for the shorthand border-radius property.
* The `has-layout` mixin now uses pixels instead of ems to work around an opera bug.
### Blueprint
* Two colors used in typography can now be customized.
* Support for inputs of type email.
### Extensions
* Extensions can now create empty directories with the `directory` directive. [Docs](http://compass-style.org/docs/tutorials/extensions/).
* It's now easier to load extensions from a configuration file using the `load` and `discover` directives.
### Rails
As stated above, all rails users should run the following command:
compass init rails . --prepare
This will fix a bug in the rails initializer that caused compass extensions to not be recognized when placed into the `vendor/plugins/compass_extensions` directory. It will also make sure that future bugs in the boot process won't require an end-user action to fix.
### Contributors:
* [Milo Winningham](http://github.com/quadule)
* [jonathanpberger](http://github.com/jonathanpberger)
* [Stephan Kaag](http://github.com/stephankaag)
>>>>>>> stable:doc-src/content/CHANGELOG.markdown
0.10.2 (May 31, 2010) 0.10.2 (May 31, 2010)
--------------------- ---------------------
@ -792,3 +866,5 @@ Almost definitely. Please let me know if you encounter any problems and I'll get
[der-rich]: http://github.com/der-rich [der-rich]: http://github.com/der-rich
[adamstac]: http://github.com/adamstac [adamstac]: http://github.com/adamstac
[ttilley]: http://github.com/ttilley [ttilley]: http://github.com/ttilley
[inline-block-list]: http://compass-style.org/docs/reference/compass/utilities/lists/inline-block-list/
[html5-reset]: http://compass-style.org/docs/reference/compass/reset/utilities/#mixin-reset-html5

View File

@ -0,0 +1,14 @@
---
title: Compass Documentation | All Mixins
crumb: Docs
body_id: home
---
%article
%h1#logo Compass Mixins
- all_mixins.sort_by{|i| i.first.identifier}.each do |item, mixins|
%h3= link_to item[:title], item
%ul
- mixins.sort_by{|m| m.name}.each do |m|
%li= mixin_signature(m)

View File

@ -0,0 +1,15 @@
---
title: Compass Documentation | All Variables
crumb: Docs
body_id: home
---
%article
%h1#logo Compass Variables
- all_constants.sort_by{|i| i.first.identifier}.each do |item, constants|
%h3= link_to item[:title], item
%ul
- constants.sort_by{|c| c.name}.each do |c|
%li $#{c.name}

View File

@ -0,0 +1,31 @@
---
title: Compass Constant Helpers
crumb: Constants
framework: compass
meta_description: Helper functions for working with constants.
layout: core
classnames:
- reference
- core
- helpers
---
%h1 Compass Constant Helpers
:markdown
These helpers manipulate CSS Constants.
#opposite-position.helper
%h3
%a(href="#opposite-position")
opposite-position($position)
.details
:markdown
Returns the opposition position for the position given. Examples:
Input Output
------------------------------- ------------
opposite-position(left) => right
opposite-position(top) => bottom
opposite-position(center) => center
opposite-position(top left) => bottom right
opposite-position(center right) => center left

View File

@ -21,24 +21,33 @@ classnames:
#stylesheet-url.helper #stylesheet-url.helper
%h3 %h3
%a(href="#stylesheet-url") %a(href="#stylesheet-url")
stylesheet-url($path) stylesheet-url($path, $only-path: false)
.details .details
%p %p
Generates a path to an asset found relative to the project's css directory. Generates a path to an asset found relative to the project's css directory.
%br
Passing a true value as the second argument will cause the only the path to be returned
instead of a `url()` function
#font-url.helper #font-url.helper
%h3 %h3
%a(href="#font-url") %a(href="#font-url")
font-url($path) font-url($path, $only-path: false)
.details .details
%p %p
Generates a path to an asset found relative to the project's font directory. Generates a path to an asset found relative to the project's font directory.
%br
Passing a true value as the second argument will cause the only the path to be returned
instead of a `url()` function
#image-url.helper #image-url.helper
%h3 %h3
%a(href="#image-url") %a(href="#image-url")
image-url($path) image-url($path, $only-path: false)
.details .details
%p %p
Generates a path to an asset found relative to the project's images directory. Generates a path to an asset found relative to the project's images directory.
%br
Passing a true value as the second argument will cause the only the path to be returned
instead of a `url()` function

View File

@ -0,0 +1,30 @@
---
title: Compass Inline-Block List
crumb: Inline-Block List
framework: compass
stylesheet: compass/utilities/lists/_inline-block-list.scss
layout: core
meta_description: set list-elements to inline-block so they appear horizontally while retaining their structure.
nav_stylesheet: compass/_utilities.scss
classnames:
- reference
- core
- utilities
---
- render 'reference' do
:markdown
Easy mode using simple descendant li selectors:
ul.nav
+inline-block-list
Advanced mode:
If you need to target the list items using a different selector then use
+inline-block-list-container on your ul/ol and +inline-block-list-item on
your li. This may help when working on layouts involving nested lists. For
example:
ul.nav
+inline-block-list-container
> li
+inline-block-list-item

View File

@ -17,7 +17,7 @@ variables and ([often][2]) the framework utilities you plan to use:
@import "compass/reset"; @import "compass/reset";
@import "compass/utilities"; @import "compass/utilities";
@import "blueprint/screen"; @import "blueprint";
// etc. // etc.

View File

@ -108,6 +108,18 @@ command line will override the corresponding settings in your configuration file
Defaults to <code>"stylesheets"</code>. Defaults to <code>"stylesheets"</code>.
</td> </td>
</tr> </tr>
<tr>
<td style="vertical-align:top;"><code>css_path</code> </td>
<td style="vertical-align:top;">String </td>
<td style="vertical-align:top;">The full path to where css stylesheets are kept.
Defaults to <code>&lt;project_path&gt;/&lt;css_dir&gt;</code>.
</td>
</tr>
<tr>
<td style="vertical-align:top;"><code>http_stylesheets_path</code> </td>
<td style="vertical-align:top;">String </td>
<td style="vertical-align:top;">The full http path to stylesheets on the web server. Defaults to <code>http_path + "/" + css_dir</code>. </td>
</tr>
<tr> <tr>
<td style="vertical-align:top;"><code>sass_dir</code> </td> <td style="vertical-align:top;"><code>sass_dir</code> </td>
<td style="vertical-align:top;">String </td> <td style="vertical-align:top;">String </td>
@ -115,6 +127,13 @@ command line will override the corresponding settings in your configuration file
It is relative to the <code>project_path</code>. Defaults to <code>"src"</code>. It is relative to the <code>project_path</code>. Defaults to <code>"src"</code>.
</td> </td>
</tr> </tr>
<tr>
<td style="vertical-align:top;"><code>sass_path</code> </td>
<td style="vertical-align:top;">String </td>
<td style="vertical-align:top;">The full path to where sass stylesheets are kept.
Defaults to <code>&lt;project_path&gt;/&lt;sass_dir&gt;</code>.
</td>
</tr>
<tr> <tr>
<td style="vertical-align:top;"><code>images_dir</code> </td> <td style="vertical-align:top;"><code>images_dir</code> </td>
<td style="vertical-align:top;">String </td> <td style="vertical-align:top;">String </td>
@ -123,6 +142,20 @@ command line will override the corresponding settings in your configuration file
Defaults to <code>"images"</code>. Defaults to <code>"images"</code>.
</td> </td>
</tr> </tr>
<tr>
<td style="vertical-align:top;"><code>images_path</code> </td>
<td style="vertical-align:top;">String </td>
<td style="vertical-align:top;">The full path to where images are kept.
Defaults to <code>&lt;project_path&gt;/&lt;images_dir&gt;</code>.
</td>
</tr>
<tr>
<td style="vertical-align:top;"><code>http_images_path</code> </td>
<td style="vertical-align:top;">String </td>
<td style="vertical-align:top;">The full http path to images on the web server.
Defaults to <code>http_path + "/" + images_dir</code>.
</td>
</tr>
<tr> <tr>
<td style="vertical-align:top;"><code>javascripts_dir</code> </td> <td style="vertical-align:top;"><code>javascripts_dir</code> </td>
<td style="vertical-align:top;">String </td> <td style="vertical-align:top;">String </td>
@ -131,6 +164,20 @@ command line will override the corresponding settings in your configuration file
<code>"javascripts"</code>. <code>"javascripts"</code>.
</td> </td>
</tr> </tr>
<tr>
<td style="vertical-align:top;"><code>javascripts_path</code> </td>
<td style="vertical-align:top;">String </td>
<td style="vertical-align:top;">The full path to where javascripts are kept.
Defaults to <code>&lt;project_path&gt;/&lt;javascripts_dir&gt;</code>.
</td>
</tr>
<tr>
<td style="vertical-align:top;"><code>http_javascripts_path</code> </td>
<td style="vertical-align:top;">String </td>
<td style="vertical-align:top;">The full http path to javascripts on the web server.
Defaults to <code>http_path + "/" + javascripts_dir</code>.
</td>
</tr>
<tr> <tr>
<td style="vertical-align:top;"><code>output_style</code> </td> <td style="vertical-align:top;"><code>output_style</code> </td>
<td style="vertical-align:top;">Symbol </td> <td style="vertical-align:top;">Symbol </td>
@ -147,25 +194,6 @@ command line will override the corresponding settings in your configuration file
using the http path for that asset type. using the http path for that asset type.
</td> </td>
</tr> </tr>
<tr>
<td style="vertical-align:top;"><code>http_images_path</code> </td>
<td style="vertical-align:top;">String </td>
<td style="vertical-align:top;">The full http path to images on the web server.
Defaults to <code>http_path + "/" + images_dir</code>.
</td>
</tr>
<tr>
<td style="vertical-align:top;"><code>http_stylesheets_path</code> </td>
<td style="vertical-align:top;">String </td>
<td style="vertical-align:top;">The full http path to stylesheets on the web server. Defaults to <code>http_path + "/" + css_dir</code>. </td>
</tr>
<tr>
<td style="vertical-align:top;"><code>http_javascripts_path</code> </td>
<td style="vertical-align:top;">String </td>
<td style="vertical-align:top;">The full http path to javascripts on the web server.
Defaults to <code>http_path + "/" + javascripts_dir</code>.
</td>
</tr>
<tr> <tr>
<td style="vertical-align:top;"><code>additional_import_paths</code> </td> <td style="vertical-align:top;"><code>additional_import_paths</code> </td>
<td style="vertical-align:top;">Array of Strings </td> <td style="vertical-align:top;">Array of Strings </td>

View File

@ -165,13 +165,26 @@ You may also see some real manifest files here:
### Manifest Declarations ### Manifest Declarations
There are five kinds of manifest declarations: **Easy Mode:** If you just have some basic files and nothing fancy going on, simply place this line in your manifest:
discover :all
This will cause compass to find all the files in your template and use the files' extension to determine where they should go. Alternatively, you can request that compass only discover files of a certain type. For example, the following will only discover javascript and image assets, you could then declare other file types on your own.
discover :javascripts
discover :images
The following types may be discovered: `:stylesheets`, `:images`, `:javascripts`, `:fonts`, `:html`, `:files`, and `:directories`
**Normal Mode:** There are seven kinds of manifest declarations:
1. `stylesheet` - Declares a sass file. 1. `stylesheet` - Declares a sass file.
2. `image` - Declares an image. 2. `image` - Declares an image.
3. `javascript` - Declares a javascript file. 3. `javascript` - Declares a javascript file.
4. `html` - Declares an html file. 4. `font` - Declares a font file.
5. `file` - Declares a random file. 5. `html` - Declares an html file.
6. `file` - Declares a random file.
7. `directory` - Declares a directory should be created.
All declarations take the path to the file as their first argument. Note that the All declarations take the path to the file as their first argument. Note that the
normal slash `/` can and should be used in a manifest. Compass will take care of normal slash `/` can and should be used in a manifest. Compass will take care of
@ -196,6 +209,15 @@ Stylesheet options:
* `:condition` - this is used to hint the user that a conditional comment should be * `:condition` - this is used to hint the user that a conditional comment should be
used to import the stylesheet with the given condition. used to import the stylesheet with the given condition.
Directory options:
* `:within` - where the directory should be created. If omitted, the directory
will be relative to the project directory. Can be one of: the following
* `sass_dir`
* `javascripts_dir`
* `fonts_dir`
* `images_dir`
HTML files: HTML files:
You can provide html as haml or as plain html. If you provide haml, the haml will be You can provide html as haml or as plain html. If you provide haml, the haml will be

View File

@ -1,5 +1,5 @@
- render 'main' do - render 'main' do
%aside(role="sidebar") %aside(role="sidebar")
%nav#local-nav %nav#local-nav
%ul=item_tree(reference_item(:stylesheet => "_blueprint.scss"), :depth => 2, :omit_self => false, :heading_level => 2) %ul=item_tree(reference_item(:stylesheet => "blueprint.scss"), :depth => 2, :omit_self => false, :heading_level => 2)
%article= yield %article= yield

View File

@ -1,5 +1,5 @@
- render 'main' do - render 'main' do
- content_for :module_nav do - content_for :module_nav do
%ul= item_tree(reference_item(:stylesheet => "_compass.scss"), :depth => 1, :omit_self => true, :headings => false) %ul= item_tree(reference_item(:stylesheet => "compass.scss"), :depth => 1, :omit_self => true, :headings => false)
%aside(role="sidebar")= render 'partials/sidebar', :default_stylesheet => "_compass.scss" %aside(role="sidebar")= render 'partials/sidebar', :default_stylesheet => "_compass.scss"
%article= yield %article= yield

View File

@ -7,7 +7,7 @@
%code @import "#{departialize(item[:stylesheet][0..-6])}" %code @import "#{departialize(item[:stylesheet][0..-6])}"
%p %p
- gh_url = "http://github.com/chriseppstein/compass/blob/master/frameworks/" - gh_url = "http://github.com/chriseppstein/compass/blob/stable/frameworks/"
- gh_url << "#{item[:framework]}/stylesheets/#{item[:stylesheet]}" - gh_url << "#{item[:framework]}/stylesheets/#{item[:stylesheet]}"
View the View the
%a{:href => gh_url} Source for this module on Github. %a{:href => gh_url} Source for this module on Github.

View File

@ -11,7 +11,7 @@ class SyntaxHighlighterFilter < Nanoc3::Filter
def pygmentize(code, type) def pygmentize(code, type)
# -O linenos=table # -O linenos=table
IO.popen("pygmentize -l #{type} -f html", "r+") do |io| IO.popen("pygmentize -l #{type} -f html -O encoding=utf-8", "r+") do |io|
io.write(code) io.write(code)
io.close_write io.close_write
return io.read return io.read

View File

@ -30,9 +30,9 @@ end
def reference_item(options) def reference_item(options)
stylesheet = options[:stylesheet] stylesheet = options[:stylesheet]
@site.cached("reference/item/#{stylesheet}") do
path = stylesheet_path(stylesheet) path = stylesheet_path(stylesheet)
if path if path
@site.cached("reference/item/#{path}") do
@items.detect do |i| @items.detect do |i|
if i.identifier =~ /^\/reference/ && i[:stylesheet] if i.identifier =~ /^\/reference/ && i[:stylesheet]
i[:stylesheet] == path i[:stylesheet] == path
@ -54,17 +54,18 @@ def reference_path(options)
end end
def import_paths def import_paths
paths = Compass::Frameworks::ALL.inject([]) {|m, f| m << f.stylesheets_directory} paths = []
paths.map!{|p|[p, '']}
if @item[:stylesheet] if @item[:stylesheet]
paths << [File.join(Compass::Frameworks[@item[:framework]].stylesheets_directory, paths << [File.join(Compass::Frameworks[@item[:framework]].stylesheets_directory,
File.dirname(@item[:stylesheet])), File.dirname(@item[:stylesheet])] File.dirname(@item[:stylesheet])),
@item[:stylesheet]["/"] ? File.dirname(@item[:stylesheet]) : ""]
end end
paths += Compass::Frameworks::ALL.inject([]) {|m, f| m << f.stylesheets_directory}.map!{|p|[p, '']}
paths paths
end end
def stylesheet_path(ss) def stylesheet_path(ss)
@site.cached("stylesheet/path/#{ss}") do
possible_names = possible_filenames_for_stylesheet(ss) possible_names = possible_filenames_for_stylesheet(ss)
import_paths.each do |import_path| import_paths.each do |import_path|
possible_names.each do |filename| possible_names.each do |filename|
@ -74,7 +75,7 @@ def stylesheet_path(ss)
end end
end end
end end
end nil
end end
def possible_filenames_for_stylesheet(ss) def possible_filenames_for_stylesheet(ss)
@ -85,9 +86,9 @@ def possible_filenames_for_stylesheet(ss)
extensions = if ext.size > 0 extensions = if ext.size > 0
[ext] [ext]
else else
[".sass", ".scss"] [".scss", ".sass"]
end end
basenames = [base, "_#{base}"] basenames = ["_#{base}", base]
filenames = [] filenames = []
basenames.each do |basename| basenames.each do |basename|
extensions.each do |extension| extensions.each do |extension|
@ -125,6 +126,7 @@ def constants(item)
if child.is_a?(Sass::Tree::VariableNode) if child.is_a?(Sass::Tree::VariableNode)
child.comment = comment && Sass::Tree::CommentNode.clean(comment) child.comment = comment && Sass::Tree::CommentNode.clean(comment)
comment = nil comment = nil
child.name.tr!("_",'-')
constants << child constants << child
elsif child.is_a?(Sass::Tree::CommentNode) elsif child.is_a?(Sass::Tree::CommentNode)
comment ||= "" comment ||= ""
@ -137,6 +139,32 @@ def constants(item)
constants constants
end end
def all_constants
variables = []
@items.each do |item|
next unless item.identifier =~ %r{/reference}
next unless item[:stylesheet]
vars = constants(item)
if vars.any?
variables << [item, vars]
end
end
variables
end
def all_mixins
all_mixins = []
@items.each do |item|
next unless item.identifier =~ %r{/reference}
next unless item[:stylesheet]
ms = mixins(item)
if ms.any?
all_mixins << [item, ms]
end
end
all_mixins
end
def mixin_signature(mixin, format = :html) def mixin_signature(mixin, format = :html)
mixin.sass_signature(:none, format) mixin.sass_signature(:none, format)
end end

View File

@ -0,0 +1,18 @@
@import "compass/layout/floated";
// It's easy to build a grid with a floated layout
$gutter: $compass-gutter-width;
$col-width: 30px;
$number-of-columns: 24;
$total-width: $number-of-columns * ($col-width + $gutter) - $gutter ;
@mixin span($n) {
width: $n * ($col-width + $gutter) - $gutter;
}
// Provides a number of base classes.
@include act-like-blueprint;
#page { @extend .container; @include span($number-of-columns); }
#sidebar { @extend .column; @include span(8); }
#content { @extend .column; @include span(16); @extend .last; }

View File

@ -259,14 +259,20 @@ Feature: Command Line
When I run: compass stats When I run: compass stats
Then I am told statistics for each file: Then I am told statistics for each file:
| Filename | Rules | Properties | Mixins Defs | Mixins Used | CSS Rules | CSS Properties | | Filename | Rules | Properties | Mixins Defs | Mixins Used | CSS Rules | CSS Properties |
| sass/border_radius.scss | 3 | 0 | 0 | 3 | 3 | 18 |
| sass/box.sass | 15 | 0 | 0 | 19 | 15 | 59 | | sass/box.sass | 15 | 0 | 0 | 19 | 15 | 59 |
| sass/fonts.sass | 0 | 0 | 0 | 1 | 1 | 2 |
| sass/gradients.sass | 19 | 0 | 0 | 19 | 19 | 19 | | sass/gradients.sass | 19 | 0 | 0 | 19 | 19 | 19 |
| sass/image_size.sass | 4 | 8 | 0 | 0 | 4 | 8 | | sass/image_size.sass | 4 | 8 | 0 | 0 | 4 | 8 |
| sass/images.scss | 3 | 3 | 0 | 0 | 3 | 3 |
| sass/layout.sass | 0 | 0 | 0 | 1 | 5 | 10 | | sass/layout.sass | 0 | 0 | 0 | 1 | 5 | 10 |
| sass/legacy_clearfix.scss | 2 | 0 | 0 | 2 | 5 | 11 |
| sass/lists.scss | 9 | 0 | 0 | 9 | 35 | 111 |
| sass/print.sass | 0 | 0 | 0 | 2 | 61 | 61 | | sass/print.sass | 0 | 0 | 0 | 2 | 61 | 61 |
| sass/reset.sass | 4 | 1 | 0 | 2 | 190 | 664 | | sass/reset.sass | 4 | 1 | 0 | 2 | 190 | 664 |
| sass/utilities.scss | 2 | 0 | 0 | 2 | 5 | 11 | | sass/utilities.scss | 2 | 0 | 0 | 2 | 3 | 9 |
| Total.* | 44 | 9 | 0 | 45 | 299 | 832 | | ------------------------- | ----- | ---------- | -------------- | ----------- | --------- | -------------- |
| Total.* | 61 | 12 | 0 | 60 | 344 | 975 |
@listframeworks @listframeworks
Scenario: List frameworks registered with compass Scenario: List frameworks registered with compass

View File

@ -34,7 +34,7 @@ Given %r{^I am in the parent directory$} do
Dir.chdir ".." Dir.chdir ".."
end end
Given /^I'm in a newly created rails project: (.+)$/ do |project_name| Given %r{^I'm in a newly created rails project: (.+)$} do |project_name|
@cleanup_directories << project_name @cleanup_directories << project_name
begin begin
generate_rails_app project_name generate_rails_app project_name

View File

@ -23,8 +23,7 @@ $blueprint_button_active_font_color: white !default;
// Sets the colors for a button // Sets the colors for a button
// @param border_highlight_color // @param border_highlight_color
// The highlight color defaults to whatever is the value of the border_color but it's one shade lighter. // The highlight color defaults to whatever is the value of the border_color but it's one shade lighter.
@mixin button-colors @mixin button-colors(
(
$font_color: $blueprint_button_font_color, $font_color: $blueprint_button_font_color,
$bg_color: $blueprint_button_background_color, $bg_color: $blueprint_button_background_color,
$border_color: $blueprint_button_border_color, $border_color: $blueprint_button_border_color,
@ -39,8 +38,7 @@ $blueprint_button_active_font_color: white !default;
// Sets the colors for a button in the active state // Sets the colors for a button in the active state
// @param border_highlight_color // @param border_highlight_color
// The highlight color defaults to whatever is the value of the border_color but it's one shade lighter. // The highlight color defaults to whatever is the value of the border_color but it's one shade lighter.
@mixin button-active-colors @mixin button-active-colors(
(
$font_color: $blueprint_button_active_font_color, $font_color: $blueprint_button_active_font_color,
$bg_color: $blueprint_button_active_background_color, $bg_color: $blueprint_button_active_background_color,
$border_color: $blueprint_button_active_border_color, $border_color: $blueprint_button_active_border_color,
@ -55,8 +53,7 @@ $blueprint_button_active_font_color: white !default;
// Sets the colors for a button in the hover state. // Sets the colors for a button in the hover state.
// @param border_highlight_color // @param border_highlight_color
// The highlight color defaults to whatever is the value of the border_color but it's one shade lighter. // The highlight color defaults to whatever is the value of the border_color but it's one shade lighter.
@mixin button-hover-colors @mixin button-hover-colors(
(
$font_color: $blueprint_button_hover_font_color, $font_color: $blueprint_button_hover_font_color,
$bg_color: $blueprint_button_hover_background_color, $bg_color: $blueprint_button_hover_background_color,
$border_color: $blueprint_button_hover_border_color, $border_color: $blueprint_button_hover_border_color,

View File

@ -3,6 +3,7 @@ $quiet-color: lighten($font-color, 20%) !default;
$loud-color: darken($font-color, 13.33%) !default; $loud-color: darken($font-color, 13.33%) !default;
$header-color: darken($font-color, 6.67%) !default; $header-color: darken($font-color, 6.67%) !default;
$alt-text-color: #666666 !default; $alt-text-color: #666666 !default;
$blueprint-background-color: #eeeeee !default;
$link-color: #000099 !default; $link-color: #000099 !default;
$link-hover-color: black !default; $link-hover-color: black !default;

View File

@ -56,8 +56,7 @@ $alternate-text-font : "Warnock Pro", "Goudy Old Style", "Palatino", "Book Antiq
// `$base-font-size` - The base font size in pixels. Defaults to 12px // `$base-font-size` - The base font size in pixels. Defaults to 12px
// `$old-line-height` - The old line height. Defaults to 1.5 times the base-font-size // `$old-line-height` - The old line height. Defaults to 1.5 times the base-font-size
@mixin incr @mixin incr(
(
$font-size: 10px, $font-size: 10px,
$base-font-size: $blueprint-font-size, $base-font-size: $blueprint-font-size,
$old-line-height: $base-font-size * 1.5 $old-line-height: $base-font-size * 1.5

View File

@ -21,6 +21,7 @@
input { input {
&.text, &.text,
&.title, &.title,
&[type=email],
&[type=text], &[type=text],
&[type=password] { margin: 0.5em 0; background-color: white; padding: 5px; } &[type=password] { margin: 0.5em 0; background-color: white; padding: 5px; }
&.title { font-size: 1.5em; } &.title { font-size: 1.5em; }
@ -42,6 +43,7 @@
input { input {
&.text, &.text,
&.title, &.title,
&[type=email],
&[type=text], &[type=text],
&[type=password] { width: $input_width; } &[type=password] { width: $input_width; }
} }
@ -56,7 +58,7 @@
) { ) {
fieldset { fieldset {
border: 1px solid $fieldset_border_color; } border: 1px solid $fieldset_border_color; }
input.text, input.title, input[type=text], input[type=password], input.text, input.title, input[type=email], input[type=text], input[type=password],
textarea, select { textarea, select {
border: 1px solid $unfocused_border_color; border: 1px solid $unfocused_border_color;
&:focus { &:focus {

View File

@ -61,14 +61,14 @@ $blueprint-font-size: 12px !default;
img.right { @include float-right; margin: 1.5em 0 1.5em 1.5em; padding: 0; } img.right { @include float-right; margin: 1.5em 0 1.5em 1.5em; padding: 0; }
} }
a { text-decoration: underline; @include link-colors($link-color, $link-hover-color, $link-active-color, $link-visited-color, $link-focus-color); } a { text-decoration: underline; @include link-colors($link-color, $link-hover-color, $link-active-color, $link-visited-color, $link-focus-color); }
blockquote { margin: 1.5em; color: #666666; font-style: italic; } blockquote { margin: 1.5em; color: $alt_text_color; font-style: italic; }
strong { font-weight: bold; } strong { font-weight: bold; }
em { font-style: italic; } em { font-style: italic; }
dfn { font-style: italic; font-weight: bold; } dfn { font-style: italic; font-weight: bold; }
sup, sub { line-height: 0; } sup, sub { line-height: 0; }
abbr, acronym { border-bottom: 1px dotted #666666; } abbr, acronym { border-bottom: 1px dotted #666666; }
address { margin: 0 0 1.5em; font-style: italic; } address { margin: 0 0 1.5em; font-style: italic; }
del { color: #666666; } del { color: $alt_text_color; }
pre { margin: 1.5em 0; white-space: pre; } pre { margin: 1.5em 0; white-space: pre; }
pre, code, tt { @include fixed-width-text; } pre, code, tt { @include fixed-width-text; }
li ul, li ol { margin: 0; } li ul, li ol { margin: 0; }
@ -84,7 +84,7 @@ $blueprint-font-size: 12px !default;
th, td, caption { padding: 4px 10px 4px 5px; } th, td, caption { padding: 4px 10px 4px 5px; }
tr.even td { background: $blueprint-table-stripe-color; } tr.even td { background: $blueprint-table-stripe-color; }
tfoot { font-style: italic; } tfoot { font-style: italic; }
caption { background: #eeeeee; } caption { background: $blueprint_background_color; }
.quiet { @include quiet; } .quiet { @include quiet; }
.loud { @include loud; } .loud { @include loud; }
} }

View File

@ -3,10 +3,70 @@
$default-border-radius: 5px !default; $default-border-radius: 5px !default;
// Round all corners by a specific amount, defaults to value of `$default-border-radius`. // Round all corners by a specific amount, defaults to value of `$default-border-radius`.
//
// When two values are passed, the first is the horizontal radius
// and the second is the vertical radius.
//
// Note: webkit does not support shorthand syntax for several corners at once.
// So in the case where you pass several values only the first will be passed to webkit.
//
// Examples:
//
// .simple { @include border-radius(4px, 4px); }
// .compound { @include border-radius(2px 5px, 3px 6px); }
// .crazy { @include border-radius(1px 3px 5px 7px, 2px 4px 6px 8px)}
//
// Which generates:
// .simple {
// -webkit-border-radius: 4px 4px;
// -moz-border-radius: 4px / 4px;
// -o-border-radius: 4px / 4px;
// -ms-border-radius: 4px / 4px;
// -khtml-border-radius: 4px / 4px;
// border-radius: 4px / 4px; }
//
// .compound {
// -webkit-border-radius: 2px 3px;
// -moz-border-radius: 2px 5px / 3px 6px;
// -o-border-radius: 2px 5px / 3px 6px;
// -ms-border-radius: 2px 5px / 3px 6px;
// -khtml-border-radius: 2px 5px / 3px 6px;
// border-radius: 2px 5px / 3px 6px; }
//
// .crazy {
// -webkit-border-radius: 1px 2px;
// -moz-border-radius: 1px 3px 5px 7px / 2px 4px 6px 8px;
// -o-border-radius: 1px 3px 5px 7px / 2px 4px 6px 8px;
// -ms-border-radius: 1px 3px 5px 7px / 2px 4px 6px 8px;
// -khtml-border-radius: 1px 3px 5px 7px / 2px 4px 6px 8px;
// border-radius: 1px 3px 5px 7px / 2px 4px 6px 8px; }
@mixin border-radius($radius: $default-border-radius) { @mixin border-radius($radius: $default-border-radius, $vertical-radius: false) {
@if $vertical-radius {
// Webkit doesn't understand the official shorthand syntax for specifying
// a vertical radius unless so in case there's several we only take the first.
@include experimental(border-radius, first-value-of($radius) first-value-of($vertical-radius),
not -moz,
-webkit,
not -o,
not -ms,
not -khtml,
not official
);
@include experimental("border-radius", $radius unquote("/") $vertical-radius,
-moz,
not -webkit,
-o,
-ms,
-khtml,
official
);
}
@else {
@include experimental(border-radius, $radius); @include experimental(border-radius, $radius);
} }
}
// Round radius at position by amount. // Round radius at position by amount.
// //

View File

@ -18,10 +18,10 @@ $default-box-shadow-v-offset: 1px !default;
$default-box-shadow-blur: 5px !default; $default-box-shadow-blur: 5px !default;
// The default spread length. // The default spread length.
$default-box-shadow-spread : 0 !default $default-box-shadow-spread : 0 !default;
// The default shadow instet: inset or false (for standard shadow). // The default shadow instet: inset or false (for standard shadow).
$default-box-shadow-inset : false !default $default-box-shadow-inset : false !default;
// Provides cross-browser CSS box shadows for Webkit, Gecko, and CSS3. // Provides cross-browser CSS box shadows for Webkit, Gecko, and CSS3.
// Arguments are color, horizontal offset, vertical offset, blur length, spread length, and inset. // Arguments are color, horizontal offset, vertical offset, blur length, spread length, and inset.

View File

@ -12,10 +12,9 @@
@warn "The $postscript and $style variables have been deprecated in favor of the Paul Irish smiley bulletproof technique."; @warn "The $postscript and $style variables have been deprecated in favor of the Paul Irish smiley bulletproof technique.";
} }
@font-face { @font-face {
font-family: "#{$name}"; font-family: quote($name);
@if $eot { @if $eot { src: font-url($eot); }
src: font-url($eot); } src: local(""), $font-files;
src: local(""), #{$font-files};
} }
} }

View File

@ -37,7 +37,7 @@
$background: unquote(""); $background: unquote("");
@if $image { $background : $image + unquote(", "); } @if $image { $background : $image + unquote(", "); }
$start: unquote($start); $start: unquote($start);
$end: grad-opposite-position($start); $end: opposite-position($start);
@if $experimental-support-for-webkit { @if $experimental-support-for-webkit {
background-image: #{$background}-webkit-gradient(linear, grad-point($start), grad-point($end), grad-color-stops($color-stops)); background-image: #{$background}-webkit-gradient(linear, grad-point($start), grad-point($end), grad-color-stops($color-stops));
} }

View File

@ -104,7 +104,7 @@
// This reset provides a basic reset for html5 elements // This reset provides a basic reset for html5 elements
// so they are rendered correctly in browsers that don't recognize them. // so they are rendered correctly in browsers that don't recognize them.
@mixin reset-html5 { @mixin reset-html5 {
section, article, aside, header, footer, nav, dialog, figure { article, aside, canvas, details, figcaption, figure, footer, header, hgroup, menu, nav, section, summary {
display: block; } } display: block; } }
// Resets the display of inline and block elements to their default display // Resets the display of inline and block elements to their default display

View File

@ -1,3 +1,4 @@
@import "lists/horizontal-list"; @import "lists/horizontal-list";
@import "lists/inline-list"; @import "lists/inline-list";
@import "lists/inline-block-list";
@import "lists/bullets"; @import "lists/bullets";

View File

@ -18,12 +18,9 @@
// [Easy Clearing](http://www.positioniseverything.net/easyclearing.html) // [Easy Clearing](http://www.positioniseverything.net/easyclearing.html)
// has the advantage of allowing positioned elements to hang // has the advantage of allowing positioned elements to hang
// outside the bounds of the container at the expense of more tricky CSS. // outside the bounds of the container at the expense of more tricky CSS.
//
// This method of clearing might cause a gap at the bottom of the page in
// some browsers when used on the last element of the page.
@mixin pie-clearfix { @mixin pie-clearfix {
&:after { &:after {
content : " "; content : "\0020";
display : block; display : block;
height : 0; height : 0;
clear : both; clear : both;

View File

@ -1,12 +1,32 @@
// The `zoom` approach generates less CSS but does not validate.
// Set this to `block` to use the display-property to hack the
// element to gain layout.
$default-has-layout-approach: zoom !default;
// This mixin causes an element matching the selector // This mixin causes an element matching the selector
// to gain the "hasLayout" property in internet explorer. // to gain the "hasLayout" property in internet explorer.
// More information on [hasLayout](http://reference.sitepoint.com/css/haslayout). // More information on [hasLayout](http://reference.sitepoint.com/css/haslayout).
@mixin has-layout { @mixin has-layout($using: $default-has-layout-approach) {
@if $using == zoom {
@include has-layout-zoom;
} @else if $using == block {
@include has-layout-block;
} @else {
@warn "Unknown has-layout approach: #{$using}";
@include has-layout-zoom;
}
}
@mixin has-layout-zoom {
*zoom: 1;
}
@mixin has-layout-block {
// This makes ie6 get layout // This makes ie6 get layout
display: inline-block; display: inline-block;
// and this puts it back to block // and this puts it back to block
& { & { display: block; }
display: block; } } }
// A hack to supply IE6 (and below) with a different property value. // A hack to supply IE6 (and below) with a different property value.
// [Read more](http://www.cssportal.com/css-hacks/#in_css-important). // [Read more](http://www.cssportal.com/css-hacks/#in_css-important).

View File

@ -16,6 +16,7 @@
// +horizontal-list-item // +horizontal-list-item
@import "bullets"; @import "bullets";
@import "compass/utilities/general/clearfix";
@import "compass/utilities/general/reset"; @import "compass/utilities/general/reset";
@import "compass/utilities/general/float"; @import "compass/utilities/general/float";
@ -31,21 +32,21 @@
// :last-child is not fully supported // :last-child is not fully supported
// see http://www.quirksmode.org/css/contents.html#t29 for the support matrix // see http://www.quirksmode.org/css/contents.html#t29 for the support matrix
@mixin horizontal-list-item($padding: 4px) { @mixin horizontal-list-item($padding: 4px, $direction: left) {
@include no-bullet; @include no-bullet;
white-space: nowrap; white-space: nowrap;
@include float-left; @include float($direction);
padding: { padding: {
left: $padding; left: $padding;
right: $padding; }; right: $padding;
&:first-child, &.first { };
padding-left: 0px; } &:first-child, &.first { padding-#{$direction}: 0px; }
&:last-child, &.last { &:last-child, &.last { padding-#{opposite-position($direction)}: 0px; }
padding-right: 0px; } } }
// A list(ol,ul) that is layed out such that the elements are floated left and won't wrap. // A list(ol,ul) that is layed out such that the elements are floated left and won't wrap.
// This is not an inline list. // This is not an inline list.
@mixin horizontal-list($padding: 4px) { @mixin horizontal-list($padding: 4px, $direction: left) {
@include horizontal-list-container; @include horizontal-list-container;
li { li {
@include horizontal-list-item($padding); } } @include horizontal-list-item($padding, $direction); } }

View File

@ -0,0 +1,47 @@
// Inline-Block list layout module.
//
// Easy mode using simple descendant li selectors:
//
// ul.nav
// +inline-block-list
//
// Advanced mode:
// If you need to target the list items using a different selector then use
// +inline-block-list-container on your ul/ol and +inline-block-list-item on your li.
// This may help when working on layouts involving nested lists. For example:
//
// ul.nav
// +inline-block-list-container
// > li
// +inline-block-list-item
@import "bullets";
@import "horizontal-list";
@import "compass/utilities/general/float";
@import "compass/css3/inline-block";
// Can be mixed into any selector that target a ul or ol that is meant
// to have an inline-block layout. Used to implement +inline-block-list.
@mixin inline-block-list-container {
@include horizontal-list-container; }
// Can be mixed into any li selector that is meant to participate in a horizontal layout.
// Used to implement +inline-block-list.
@mixin inline-block-list-item($padding: false) {
@include no-bullet;
@include inline-block;
white-space: nowrap;
@if $padding {
padding: {
left: $padding;
right: $padding;
};
}
}
// A list(ol,ul) that is layed out such that the elements are inline-block and won't wrap.
@mixin inline-block-list($padding: false) {
@include inline-block-list-container;
li {
@include inline-block-list-item($padding); } }

View File

@ -2,18 +2,17 @@
@mixin inline-list { @mixin inline-list {
list-style-type: none; list-style-type: none;
&, & li {
margin: 0px; margin: 0px;
padding: 0px; padding: 0px;
display: inline; display: inline;
li { }
margin: 0px; }
padding: 0px;
display: inline; } }
// makes an inline list that is comma delimited. // makes an inline list that is comma delimited.
// Please make note of the browser support issues before using this mixin. // Please make note of the browser support issues before using this mixin.
// //
// use of `:content` and `:after` is not fully supported in all browsers. // use of `content` and `:after` is not fully supported in all browsers.
// See quirksmode for the [support matrix](http://www.quirksmode.org/css/contents.html#t15) // See quirksmode for the [support matrix](http://www.quirksmode.org/css/contents.html#t15)
// //
// `:last-child` is not fully supported. // `:last-child` is not fully supported.
@ -22,8 +21,9 @@
@mixin comma-delimited-list { @mixin comma-delimited-list {
@include inline-list; @include inline-list;
li { li {
&:after { &:after { content: ", "; }
content: ", "; }
&:last-child, &.last { &:last-child, &.last {
&:after { &:after { content: ""; }
content: ""; } } } } }
}
}

View File

@ -26,7 +26,9 @@
// Hides text in an element so you can see the background. // Hides text in an element so you can see the background.
@mixin hide-text { @mixin hide-text {
text-indent: -9999em; $approximate_em_value: 12px / 1em;
$wider_than_any_screen: -9999em;
text-indent: $wider_than_any_screen * $approximate_em_value;
overflow: hidden; overflow: hidden;
text-align: left; text-align: left;
} }

View File

@ -34,6 +34,13 @@ module Compass
end end
end end
def initialize!
config_file = Compass.detect_configuration_file(root)
Compass.add_project_configuration(config_file)
Compass.discover_extensions!
Compass.configure_sass_plugin!
Compass.handle_configuration_change!
end
end end
end end
end end

View File

@ -1,8 +1,12 @@
module Compass::SassExtensions::Functions::Urls module Compass::SassExtensions::Functions::Urls
def image_url_with_rails_integration(path) def image_url_with_rails_integration(path, only_path = Sass::Script::Bool.new(false))
if (@controller = Sass::Plugin.rails_controller) && @controller.respond_to?(:request) && @controller.request if (@controller = Sass::Plugin.rails_controller) && @controller.respond_to?(:request) && @controller.request
begin begin
if only_path.to_bool
Sass::Script::String.new image_path(path.value)
else
Sass::Script::String.new "url(#{image_path(path.value)})" Sass::Script::String.new "url(#{image_path(path.value)})"
end
ensure ensure
@controller = nil @controller = nil
end end

View File

@ -19,19 +19,16 @@ module Compass
def write_configuration_files(config_file = nil) def write_configuration_files(config_file = nil)
config_file ||= targetize('config/compass.rb') config_file ||= targetize('config/compass.rb')
unless File.exists?(config_file)
directory File.dirname(config_file) directory File.dirname(config_file)
write_file config_file, config_contents write_file config_file, config_contents
end
directory File.dirname(targetize('config/initializers/compass.rb')) directory File.dirname(targetize('config/initializers/compass.rb'))
write_file targetize('config/initializers/compass.rb'), initializer_contents write_file targetize('config/initializers/compass.rb'), initializer_contents
end end
def config_files_exist?
File.exists?(targetize('config/compass.rb')) &&
File.exists?(targetize('config/initializers/compass.rb'))
end
def prepare def prepare
write_configuration_files unless config_files_exist? write_configuration_files
end end
def finalize(options = {}) def finalize(options = {})
@ -55,12 +52,14 @@ Sass will automatically compile your stylesheets during the next
page request and keep them up to date when they change. page request and keep them up to date when they change.
NEXTSTEPS NEXTSTEPS
end end
unless options[:prepare]
if manifest.has_stylesheet? if manifest.has_stylesheet?
puts "\nNext add these lines to the head of your layouts:\n\n" puts "\nNext add these lines to the head of your layouts:\n\n"
puts stylesheet_links puts stylesheet_links
puts "\n(You are using haml, aren't you?)" puts "\n(You are using haml, aren't you?)"
end end
end end
end
def install_location_for_html(to, options) def install_location_for_html(to, options)
@ -105,10 +104,8 @@ NEXTSTEPS
def initializer_contents def initializer_contents
%Q{require 'compass' %Q{require 'compass'
|rails_root = (defined?(Rails) ? Rails.root : RAILS_ROOT).to_s |require 'compass/app_integration/rails'
|Compass.add_project_configuration(File.join(rails_root, "config", "compass.rb")) |Compass::AppIntegration::Rails.initialize!
|Compass.configure_sass_plugin!
|Compass.handle_configuration_change!
|}.gsub(/^\s+\|/,'') |}.gsub(/^\s+\|/,'')
end end

View File

@ -43,7 +43,12 @@ module Compass
self.options[:preferred_syntax] = syntax self.options[:preferred_syntax] = syntax
end end
opts.on("--prepare", "Prepare the project by only creating configuration files.") do
self.options[:prepare] = true
end
super super
end end
end end

View File

@ -33,13 +33,14 @@ module Compass
require 'compass/stats' require 'compass/stats'
compiler = new_compiler_instance compiler = new_compiler_instance
sass_files = sorted_sass_files(compiler) sass_files = sorted_sass_files(compiler)
total_label = "Total (#{sass_files.size} files):"
rows = [[ :-, :-, :-, :-, :-, :-, :- ], rows = [[ :-, :-, :-, :-, :-, :-, :- ],
[ 'Filename', 'Rules', 'Properties', 'Mixins Defs', 'Mixins Used', 'CSS Rules', 'CSS Properties' ], [ 'Filename', 'Rules', 'Properties', 'Mixins Defs', 'Mixins Used', 'CSS Rules', 'CSS Properties' ],
[ :-, :-, :-, :-, :-, :-, :- ]] [ :-, :-, :-, :-, :-, :-, :- ]]
maximums = [ 8, 5, 10, 14, 11, 9, 14 ] maximums = [ total_label.length, 5, 10, 14, 11, 9, 14 ]
alignments = [ :left, :right, :right, :right, :right, :right, :right ] alignments = [ :left, :right, :right, :right, :right, :right, :right ]
delimiters = [ ['| ', ' |'], [' ', ' |'], [' ', ' |'], [' ', ' |'], [' ', ' |'], [' ', ' |'], [' ', ' |'] ] delimiters = [ ['| ', ' |'], [' ', ' |'], [' ', ' |'], [' ', ' |'], [' ', ' |'], [' ', ' |'], [' ', ' |'] ]
totals = [ "Total (#{sass_files.size} files):", 0, 0, 0, 0, 0, 0 ] totals = [ total_label, 0, 0, 0, 0, 0, 0 ]
sass_files.each do |sass_file| sass_files.each do |sass_file|
css_file = compiler.corresponding_css_file(sass_file) unless sass_file[0..0] == '_' css_file = compiler.corresponding_css_file(sass_file) unless sass_file[0..0] == '_'

View File

@ -72,9 +72,9 @@ Options:
# all commands must implement perform # all commands must implement perform
def perform def perform
installer.init installer.init
installer.run(:skip_finalization => true) installer.run(:skip_finalization => true, :skip_preparation => !is_project_creation?)
UpdateProject.new(working_path, options).perform if installer.compilation_required? UpdateProject.new(working_path, options).perform if installer.compilation_required?
installer.finalize(:create => is_project_creation?) installer.finalize(options.merge(:create => is_project_creation?))
end end
def is_project_creation? def is_project_creation?

View File

@ -53,8 +53,8 @@ module Compass
:dry_run => options[:dry_run]) :dry_run => options[:dry_run])
compiler_opts.merge!(additional_options) compiler_opts.merge!(additional_options)
Compass::Compiler.new(working_path, Compass::Compiler.new(working_path,
projectize(Compass.configuration.sass_dir), Compass.configuration.sass_path,
projectize(Compass.configuration.css_dir), Compass.configuration.css_path,
compiler_opts) compiler_opts)
end end

View File

@ -25,7 +25,7 @@ module Compass
extend Compass::Configuration::Paths extend Compass::Configuration::Paths
inherited_accessor *ATTRIBUTES inherited_accessor *ATTRIBUTES
inherited_accessor :required_libraries #XXX we should make this array add up cumulatively. inherited_accessor :required_libraries, :loaded_frameworks, :framework_path #XXX we should make these arrays add up cumulatively.
strip_trailing_separator *ATTRIBUTES.select{|a| a.to_s =~ /dir|path/} strip_trailing_separator *ATTRIBUTES.select{|a| a.to_s =~ /dir|path/}
@ -95,6 +95,16 @@ module Compass
super super
end end
def load(framework_dir)
(self.loaded_frameworks ||= []) << framework_dir
Compass::Frameworks.register_directory framework_dir
end
def discover(frameworks_dir)
(self.framework_path ||= []) << frameworks_dir
Compass::Frameworks.discover frameworks_dir
end
def relative_assets? def relative_assets?
# the http_images_path is deprecated, but here for backwards compatibility. # the http_images_path is deprecated, but here for backwards compatibility.
relative_assets || http_images_path == :relative relative_assets || http_images_path == :relative

View File

@ -44,43 +44,43 @@ module Compass
def default_sass_path def default_sass_path
if (pp = top_level.project_path) && (dir = top_level.sass_dir) if (pp = top_level.project_path) && (dir = top_level.sass_dir)
File.join(pp, dir) Compass.projectize(dir, pp)
end end
end end
def default_css_path def default_css_path
if (pp = top_level.project_path) && (dir = top_level.css_dir) if (pp = top_level.project_path) && (dir = top_level.css_dir)
File.join(pp, dir) Compass.projectize(dir, pp)
end end
end end
def default_images_path def default_images_path
if (pp = top_level.project_path) && (dir = top_level.images_dir) if (pp = top_level.project_path) && (dir = top_level.images_dir)
File.join(pp, dir) Compass.projectize(dir, pp)
end end
end end
def default_javascripts_path def default_javascripts_path
if (pp = top_level.project_path) && (dir = top_level.javascripts_dir) if (pp = top_level.project_path) && (dir = top_level.javascripts_dir)
File.join(pp, dir) Compass.projectize(dir, pp)
end end
end end
def default_extensions_path def default_extensions_path
if (pp = top_level.project_path) && (dir = top_level.extensions_dir) if (pp = top_level.project_path) && (dir = top_level.extensions_dir)
File.join(pp, dir) Compass.projectize(dir, pp)
end end
end end
def default_fonts_path def default_fonts_path
if (pp = top_level.project_path) && (dir = top_level.fonts_dir) if (pp = top_level.project_path) && (dir = top_level.fonts_dir)
File.join(pp, dir) Compass.projectize(dir, pp)
end end
end end
def default_cache_path def default_cache_path
if (pp = top_level.project_path) && (dir = top_level.cache_dir) if (pp = top_level.project_path) && (dir = top_level.cache_dir)
File.join(pp, dir) Compass.projectize(dir, pp)
end end
end end

View File

@ -56,6 +56,12 @@ module Compass
(required_libraries || []).each do |lib| (required_libraries || []).each do |lib|
contents << %Q{require '#{lib}'\n} contents << %Q{require '#{lib}'\n}
end end
(loaded_frameworks || []).each do |lib|
contents << %Q{load '#{lib}'\n}
end
(framework_path || []).each do |lib|
contents << %Q{discover '#{lib}'\n}
end
contents << "# Require any additional compass plugins here.\n" contents << "# Require any additional compass plugins here.\n"
contents << "\n" if (required_libraries || []).any? contents << "\n" if (required_libraries || []).any?
ATTRIBUTES.each do |prop| ATTRIBUTES.each do |prop|

View File

@ -6,6 +6,7 @@ require 'compass/actions'
require 'compass/installers' require 'compass/installers'
require 'compass/commands' require 'compass/commands'
require 'rbconfig' require 'rbconfig'
require 'pathname'
begin begin
require 'win32console' if RbConfig::CONFIG['host_os'] =~ /mswin|mingw/ require 'win32console' if RbConfig::CONFIG['host_os'] =~ /mswin|mingw/
rescue LoadError rescue LoadError

View File

@ -7,10 +7,25 @@ module Compass::Exec::GlobalOptionsParser
opts.on('-r LIBRARY', '--require LIBRARY', opts.on('-r LIBRARY', '--require LIBRARY',
"Require the given ruby LIBRARY before running commands.", "Require the given ruby LIBRARY before running commands.",
" This is used to access compass plugins without having a", " This is used to access compass plugins without having a",
" project configuration file.") do |library| " project configuration file."
) do |library|
::Compass.configuration.require library ::Compass.configuration.require library
end end
opts.on('-l FRAMEWORK_DIR', '--load FRAMEWORK_DIR',
"Load the framework or extensions found in the FRAMEWORK directory."
) do |framework_dir|
require 'pathname'
::Compass.configuration.load Pathname.new(framework_dir).realpath
end
opts.on('-L FRAMEWORKS_DIR', '--load-all FRAMEWORKS_DIR',
"Load all the frameworks or extensions found in the FRAMEWORKS_DIR directory."
) do |frameworks_dir|
require 'pathname'
::Compass.configuration.discover Pathname.new(frameworks_dir).realpath
end
opts.on('-q', '--quiet', :NONE, 'Quiet mode.') do opts.on('-q', '--quiet', :NONE, 'Quiet mode.') do
self.options[:quiet] = true self.options[:quiet] = true
end end

View File

@ -3,6 +3,14 @@ module Compass::Exec::ProjectOptionsParser
super super
set_project_options(opts) set_project_options(opts)
end end
def set_dir_or_path(type, dir)
if Pathname.new(dir).absolute?
self.options[:"#{type}_path"] = dir.tr('\\','/')
else
self.options[:"#{type}_dir"] = dir.tr('\\','/')
end
end
def set_project_options(opts) def set_project_options(opts)
opts.on('-c', '--config CONFIG_FILE', 'Specify the location of the configuration file explicitly.') do |configuration_file| opts.on('-c', '--config CONFIG_FILE', 'Specify the location of the configuration file explicitly.') do |configuration_file|
self.options[:configuration_file] = configuration_file self.options[:configuration_file] = configuration_file
@ -13,19 +21,19 @@ module Compass::Exec::ProjectOptionsParser
end end
opts.on('--sass-dir SRC_DIR', "The source directory where you keep your sass stylesheets.") do |sass_dir| opts.on('--sass-dir SRC_DIR', "The source directory where you keep your sass stylesheets.") do |sass_dir|
self.options[:sass_dir] = sass_dir set_dir_or_path(:sass, sass_dir)
end end
opts.on('--css-dir CSS_DIR', "The target directory where you keep your css stylesheets.") do |css_dir| opts.on('--css-dir CSS_DIR', "The target directory where you keep your css stylesheets.") do |css_dir|
self.options[:css_dir] = css_dir set_dir_or_path(:css, css_dir)
end end
opts.on('--images-dir IMAGES_DIR', "The directory where you keep your images.") do |images_dir| opts.on('--images-dir IMAGES_DIR', "The directory where you keep your images.") do |images_dir|
self.options[:images_dir] = images_dir set_dir_or_path(:images, images_dir)
end end
opts.on('--javascripts-dir JS_DIR', "The directory where you keep your javascripts.") do |javascripts_dir| opts.on('--javascripts-dir JS_DIR', "The directory where you keep your javascripts.") do |javascripts_dir|
self.options[:javascripts_dir] = javascripts_dir set_dir_or_path(:javascripts, javascripts_dir)
end end
opts.on('-e ENV', '--environment ENV', [:development, :production], 'Use sensible defaults for your current environment.', opts.on('-e ENV', '--environment ENV', [:development, :production], 'Use sensible defaults for your current environment.',

View File

@ -28,10 +28,10 @@ module Compass
# Runs the installer. # Runs the installer.
# Every installer must conform to the installation strategy of prepare, install, and then finalize. # Every installer must conform to the installation strategy of prepare, install, and then finalize.
# A default implementation is provided for each step. # A default implementation is provided for each step.
def run(options = {}) def run(run_options = {})
prepare prepare unless run_options[:skip_preparation]
install install unless options[:prepare]
finalize(options) unless options[:skip_finalization] finalize(options.merge(run_options)) unless options[:prepare] || run_options[:skip_finalization]
end end
# The default prepare method -- it is a no-op. # The default prepare method -- it is a no-op.
@ -116,6 +116,19 @@ module Compass
"#{pattern_name_as_dir}#{to}" "#{pattern_name_as_dir}#{to}"
end end
def install_directory(from, to, options)
d = if within = options[:within]
if respond_to?(within)
targetize("#{send(within)}/#{to}")
else
raise Compass::Error, "Unrecognized location: #{within}"
end
else
targetize(to)
end
directory d
end
alias install_html_without_haml install_html alias install_html_without_haml install_html
def install_html(from, to, options) def install_html(from, to, options)
if to =~ /\.haml$/ if to =~ /\.haml$/

View File

@ -20,7 +20,19 @@ module Compass
parse(manifest_file) if manifest_file parse(manifest_file) if manifest_file
end end
def self.type(t) def self.known_extensions
@known_extensions ||= {}
end
def self.plural_types
@plural_types ||= {}
end
def self.type(t, options = {})
Array(options[:extensions]).each do |ext|
self.known_extensions[ext] = t
end
self.plural_types[options[:plural]] = t if options[:plural]
eval <<-END eval <<-END
def #{t}(from, options = {}) def #{t}(from, options = {})
@entries << Entry.new(:#{t}, from, options) @entries << Entry.new(:#{t}, from, options)
@ -34,12 +46,35 @@ module Compass
END END
end end
type :stylesheet type :stylesheet, :plural => :stylesheets, :extensions => %w(scss sass)
type :image type :image, :plural => :images, :extensions => %w(png gif jpg jpeg tiff gif)
type :javascript type :javascript, :plural => :javascripts, :extensions => %w(js)
type :font type :font, :plural => :fonts, :extensions => %w(otf woff ttf)
type :file type :html, :plural => :html, :extensions => %w(html haml)
type :html type :file, :plural => :files
type :directory, :plural => :directories
def discover(type)
type = self.class.plural_types[type] || type
dir = File.dirname(@manifest_file)
Dir.glob("#{dir}/**/*").each do |file|
next if /manifest\.rb/ =~ file
short_name = file[(dir.length+1)..-1]
options = {}
ext = if File.extname(short_name) == ".erb"
options[:erb] = true
File.extname(short_name[0..-5])
else
File.extname(short_name)
end[1..-1]
file_type = self.class.known_extensions[ext]
file_type = :file if file_type.nil?
file_type = :directory if File.directory?(file)
if type == :all || type == file_type
send(file_type, short_name, options)
end
end
end
def help(value = nil) def help(value = nil)
if value if value
@ -95,13 +130,23 @@ module Compass
@compile_after_generation = false @compile_after_generation = false
end end
def with_manifest(manifest_file)
@manifest_file = manifest_file
yield
ensure
@manifest_file = nil
end
# parses a manifest file which is a ruby script # parses a manifest file which is a ruby script
# evaluated in a Manifest instance context # evaluated in a Manifest instance context
def parse(manifest_file) def parse(manifest_file)
with_manifest(manifest_file) do
open(manifest_file) do |f| open(manifest_file) do |f|
eval(f.read, instance_binding, manifest_file) eval(f.read, instance_binding, manifest_file)
end end
end end
end
def instance_binding def instance_binding
binding binding
end end

View File

@ -17,9 +17,11 @@ module Compass
# Initializes the project to work with compass # Initializes the project to work with compass
def init def init
dirs = manifest.map do |entry| dirs = manifest.map do |entry|
unless entry.type == :directory
loc = send("install_location_for_#{entry.type}", entry.to, entry.options) loc = send("install_location_for_#{entry.type}", entry.to, entry.options)
File.dirname(loc) File.dirname(loc)
end end
end.compact
if manifest.has_stylesheet? if manifest.has_stylesheet?
dirs << sass_dir dirs << sass_dir

View File

@ -1,7 +1,11 @@
module Compass::SassExtensions::Functions module Compass::SassExtensions::Functions
end end
%w(selectors enumerate urls display inline_image image_size gradient_support font_files).each do |func| %w(
selectors enumerate urls display
inline_image image_size gradient_support
font_files constants lists
).each do |func|
require "compass/sass_extensions/functions/#{func}" require "compass/sass_extensions/functions/#{func}"
end end
@ -14,6 +18,8 @@ module Sass::Script::Functions
include Compass::SassExtensions::Functions::ImageSize include Compass::SassExtensions::Functions::ImageSize
include Compass::SassExtensions::Functions::GradientSupport::Functions include Compass::SassExtensions::Functions::GradientSupport::Functions
include Compass::SassExtensions::Functions::FontFiles include Compass::SassExtensions::Functions::FontFiles
include Compass::SassExtensions::Functions::Constants
include Compass::SassExtensions::Functions::Lists
end end
# Wierd that this has to be re-included to pick up sub-modules. Ruby bug? # Wierd that this has to be re-included to pick up sub-modules. Ruby bug?

View File

@ -0,0 +1,17 @@
module Compass::SassExtensions::Functions::Constants
# returns the opposite position of a side or corner.
def opposite_position(position)
opposite = position.value.split(/ +/).map do |pos|
case pos
when "top" then "bottom"
when "bottom" then "top"
when "left" then "right"
when "right" then "left"
when "center" then "center"
else
raise Sass::SyntaxError, "Cannot determine the opposite of #{pos}"
end
end
Sass::Script::String.new(opposite.join(" "), position.type)
end
end

View File

@ -36,22 +36,6 @@ module Compass::SassExtensions::Functions::GradientSupport
end end
module Functions module Functions
# returns the opposite position of a side or corner.
def grad_opposite_position(position)
opposite = position.value.split(/ +/).map do |pos|
case pos
when "top" then "bottom"
when "bottom" then "top"
when "left" then "right"
when "right" then "left"
when "center" then "center"
else
raise Sass::SyntaxError, "Cannot determine the opposite of #{pos}"
end
end
Sass::Script::String.new(opposite.join(" "))
end
# returns color-stop() calls for use in webkit. # returns color-stop() calls for use in webkit.
def grad_color_stops(color_list) def grad_color_stops(color_list)
assert_list(color_list) assert_list(color_list)

View File

@ -1,4 +1,3 @@
require 'base64'
module Compass::SassExtensions::Functions::InlineImage module Compass::SassExtensions::Functions::InlineImage
def inline_image(path, mime_type = nil) def inline_image(path, mime_type = nil)
@ -10,19 +9,18 @@ module Compass::SassExtensions::Functions::InlineImage
def inline_font_files(*args) def inline_font_files(*args)
raise Sass::SyntaxError, "An even number of arguments must be passed to font_files()" unless args.size % 2 == 0 raise Sass::SyntaxError, "An even number of arguments must be passed to font_files()" unless args.size % 2 == 0
path = path.value
files = [] files = []
while args.size > 0 while args.size > 0
path = args.shift.value path = args.shift.value
real_path = File.join(Compass.configuration.fonts_path, path) real_path = File.join(Compass.configuration.fonts_path, path)
url = "url('data:#{compute_mime_type(path,mime_type)};base64,#{data(real_path)}')" url = "url('data:#{compute_mime_type(path)};base64,#{data(real_path)}')"
files << "#{url} format('#{args.shift}')" files << "#{url} format('#{args.shift}')"
end end
Sass::Script::String.new(files.join(", ")) Sass::Script::String.new(files.join(", "))
end end
private private
def compute_mime_type(path, mime_type) def compute_mime_type(path, mime_type = nil)
return mime_type if mime_type return mime_type if mime_type
case path case path
when /\.png$/i when /\.png$/i
@ -48,7 +46,7 @@ private
def data(real_path) def data(real_path)
if File.readable?(real_path) if File.readable?(real_path)
Base64.encode64(File.read(real_path)).gsub("\n","") [File.open(real_path, "rb") {|io| io.read}].pack('m').gsub("\n","")
else else
raise Compass::Error, "File not found or cannot be read: #{real_path}" raise Compass::Error, "File not found or cannot be read: #{real_path}"
end end

View File

@ -0,0 +1,9 @@
module Compass::SassExtensions::Functions::Lists
def first_value_of(list)
if list.is_a?(Sass::Script::String)
Sass::Script::String.new(list.value.split(/\s+/).first)
else
list
end
end
end

View File

@ -1,20 +1,25 @@
module Compass::SassExtensions::Functions::Urls module Compass::SassExtensions::Functions::Urls
def stylesheet_url(path) def stylesheet_url(path, only_path = Sass::Script::Bool.new(false))
# Compute the path to the stylesheet, either root relative or stylesheet relative # Compute the path to the stylesheet, either root relative or stylesheet relative
# or nil if the http_images_path is not set in the configuration. # or nil if the http_images_path is not set in the configuration.
http_stylesheets_path = if relative? http_stylesheets_path = if relative?
compute_relative_path(Compass.configuration.css_dir) compute_relative_path(Compass.configuration.css_path)
elsif Compass.configuration.http_stylesheets_path elsif Compass.configuration.http_stylesheets_path
Compass.configuration.http_stylesheets_path Compass.configuration.http_stylesheets_path
else else
Compass.configuration.http_root_relative(Compass.configuration.css_dir) Compass.configuration.http_root_relative(Compass.configuration.css_dir)
end end
clean_url("#{http_stylesheets_path}/#{path}") path = "#{http_stylesheets_path}/#{path}"
if only_path.to_bool
Sass::Script::String.new(clean_path(path))
else
clean_url(path)
end
end end
def font_url(path) def font_url(path, only_path = Sass::Script::Bool.new(false))
path = path.value # get to the string value of the literal. path = path.value # get to the string value of the literal.
# Short curcuit if they have provided an absolute url. # Short curcuit if they have provided an absolute url.
@ -25,26 +30,36 @@ module Compass::SassExtensions::Functions::Urls
# Compute the path to the font file, either root relative or stylesheet relative # Compute the path to the font file, either root relative or stylesheet relative
# or nil if the http_fonts_path cannot be determined from the configuration. # or nil if the http_fonts_path cannot be determined from the configuration.
http_fonts_path = if relative? http_fonts_path = if relative?
compute_relative_path(Compass.configuration.fonts_dir) compute_relative_path(Compass.configuration.fonts_path)
else else
Compass.configuration.http_fonts_path Compass.configuration.http_fonts_path
end end
clean_url("#{http_fonts_path}/#{path}") path = "#{http_fonts_path}/#{path}"
if only_path.to_bool
Sass::Script::String.new(clean_path(path))
else
clean_url(path)
end
end end
def image_url(path) def image_url(path, only_path = Sass::Script::Bool.new(false))
path = path.value # get to the string value of the literal. path = path.value # get to the string value of the literal.
if path =~ %r{^#{Regexp.escape(Compass.configuration.http_images_path)}/(.*)}
# Treat root relative urls (without a protocol) like normal if they start with
# the images path.
path = $1
elsif absolute_path?(path)
# Short curcuit if they have provided an absolute url. # Short curcuit if they have provided an absolute url.
if absolute_path?(path)
return Sass::Script::String.new("url(#{path})") return Sass::Script::String.new("url(#{path})")
end end
# Compute the path to the image, either root relative or stylesheet relative # Compute the path to the image, either root relative or stylesheet relative
# or nil if the http_images_path is not set in the configuration. # or nil if the http_images_path is not set in the configuration.
http_images_path = if relative? http_images_path = if relative?
compute_relative_path(Compass.configuration.images_dir) compute_relative_path(Compass.configuration.images_path)
elsif Compass.configuration.http_images_path elsif Compass.configuration.http_images_path
Compass.configuration.http_images_path Compass.configuration.http_images_path
else else
@ -75,16 +90,24 @@ module Compass::SassExtensions::Functions::Urls
# prepend the asset host if there is one. # prepend the asset host if there is one.
path = "#{asset_host}#{'/' unless path[0..0] == "/"}#{path}" if asset_host path = "#{asset_host}#{'/' unless path[0..0] == "/"}#{path}" if asset_host
if only_path.to_bool
Sass::Script::String.new(clean_path(path))
else
clean_url(path) clean_url(path)
end end
end
private private
# Emits a url, taking off any leading "./" # Emits a path, taking off any leading "./"
def clean_url(url) def clean_path(url)
url = url.to_s url = url.to_s
url = url[0..1] == "./" ? url[2..-1] : url url = url[0..1] == "./" ? url[2..-1] : url
Sass::Script::String.new("url('#{url}')") end
# Emits a url, taking off any leading "./"
def clean_url(url)
Sass::Script::String.new("url('#{clean_path(url)}')")
end end
def relative? def relative?
@ -95,9 +118,8 @@ module Compass::SassExtensions::Functions::Urls
path[0..0] == "/" || path[0..3] == "http" path[0..0] == "/" || path[0..3] == "http"
end end
def compute_relative_path(dir) def compute_relative_path(path)
if (target_css_file = options[:css_filename]) if (target_css_file = options[:css_filename])
path = File.join(Compass.configuration.project_path, dir)
Pathname.new(path).relative_path_from(Pathname.new(File.dirname(target_css_file))).to_s Pathname.new(path).relative_path_from(Pathname.new(File.dirname(target_css_file))).to_s
end end
end end

View File

@ -11,7 +11,7 @@ module Compass
def visit(node) def visit(node)
self.prop_count += 1 if node.is_a?(Sass::Tree::PropNode) && !node.children.any? self.prop_count += 1 if node.is_a?(Sass::Tree::PropNode) && !node.children.any?
if node.is_a?(Sass::Tree::RuleNode) if node.is_a?(Sass::Tree::RuleNode)
self.rule_count += node.rule.map{|r| r.split(/,/)}.flatten.compact.size self.rule_count += node.rule.reject{|r| r.is_a?(Sass::Script::Node)}.map{|r| r.split(/,/)}.flatten.compact.size
end end
self.mixin_def_count += 1 if node.is_a?(Sass::Tree::MixinDefNode) self.mixin_def_count += 1 if node.is_a?(Sass::Tree::MixinDefNode)
self.mixin_count += 1 if node.is_a?(Sass::Tree::MixinNode) self.mixin_count += 1 if node.is_a?(Sass::Tree::MixinNode)

View File

@ -4,6 +4,6 @@ begin
rescue LoadError rescue LoadError
raise Compass::MissingDependency, %Q{The Compass CSS Validator could not be loaded. Please install it: raise Compass::MissingDependency, %Q{The Compass CSS Validator could not be loaded. Please install it:
sudo gem install chriseppstein-compass-validator --source http://gems.github.com/ sudo gem install compass-validator
} }
end end

View File

@ -200,9 +200,7 @@ caption {
.clearfix { .clearfix {
overflow: hidden; overflow: hidden;
display: inline-block; } *zoom: 1; }
.clearfix {
display: block; }
.small { .small {
font-size: 0.8em; font-size: 0.8em;
@ -234,9 +232,7 @@ caption {
width: 950px; width: 950px;
margin: 0 auto; margin: 0 auto;
overflow: hidden; overflow: hidden;
display: inline-block; } *zoom: 1; }
.container {
display: block; }
.column, div.span-1, div.span-2, div.span-3, div.span-4, div.span-5, div.span-6, div.span-7, div.span-8, div.span-9, div.span-10, div.span-11, div.span-12, div.span-13, div.span-14, div.span-15, div.span-16, div.span-17, div.span-18, div.span-19, div.span-20, div.span-21, div.span-22, div.span-23, div.span-24 { .column, div.span-1, div.span-2, div.span-3, div.span-4, div.span-5, div.span-6, div.span-7, div.span-8, div.span-9, div.span-10, div.span-11, div.span-12, div.span-13, div.span-14, div.span-15, div.span-16, div.span-17, div.span-18, div.span-19, div.span-20, div.span-21, div.span-22, div.span-23, div.span-24 {
display: inline; display: inline;
@ -726,7 +722,7 @@ legend {
font-weight: bold; font-weight: bold;
font-size: 1.2em; } font-size: 1.2em; }
input.text, input.title, input[type=text], input[type=password] { input.text, input.title, input[type=email], input[type=text], input[type=password] {
margin: 0.5em 0; margin: 0.5em 0;
background-color: white; background-color: white;
padding: 5px; } padding: 5px; }
@ -746,14 +742,14 @@ select {
fieldset { fieldset {
border: 1px solid #cccccc; } border: 1px solid #cccccc; }
input.text, input.title, input[type=text], input[type=password], input.text, input.title, input[type=email], input[type=text], input[type=password],
textarea, select { textarea, select {
border: 1px solid #bbbbbb; } border: 1px solid #bbbbbb; }
input.text:focus, input.title:focus, input[type=text]:focus, input[type=password]:focus, input.text:focus, input.title:focus, input[type=email]:focus, input[type=text]:focus, input[type=password]:focus,
textarea:focus, select:focus { textarea:focus, select:focus {
border: 1px solid #666666; } border: 1px solid #666666; }
input.text, input.title, input[type=text], input[type=password] { input.text, input.title, input[type=email], input[type=text], input[type=password] {
width: 300px; } width: 300px; }
textarea { textarea {

View File

@ -11,7 +11,7 @@ form.bp fieldset {
form.bp legend { form.bp legend {
font-weight: bold; font-weight: bold;
font-size: 1.2em; } font-size: 1.2em; }
form.bp input.text, form.bp input.title, form.bp input[type=text], form.bp input[type=password] { form.bp input.text, form.bp input.title, form.bp input[type=email], form.bp input[type=text], form.bp input[type=password] {
margin: 0.5em 0; margin: 0.5em 0;
background-color: white; background-color: white;
padding: 5px; } padding: 5px; }
@ -27,13 +27,13 @@ form.bp select {
margin: 0.5em 0; } margin: 0.5em 0; }
form.bp fieldset { form.bp fieldset {
border: 1px solid #cccccc; } border: 1px solid #cccccc; }
form.bp input.text, form.bp input.title, form.bp input[type=text], form.bp input[type=password], form.bp input.text, form.bp input.title, form.bp input[type=email], form.bp input[type=text], form.bp input[type=password],
form.bp textarea, form.bp select { form.bp textarea, form.bp select {
border: 1px solid #bbbbbb; } border: 1px solid #bbbbbb; }
form.bp input.text:focus, form.bp input.title:focus, form.bp input[type=text]:focus, form.bp input[type=password]:focus, form.bp input.text:focus, form.bp input.title:focus, form.bp input[type=email]:focus, form.bp input[type=text]:focus, form.bp input[type=password]:focus,
form.bp textarea:focus, form.bp select:focus { form.bp textarea:focus, form.bp select:focus {
border: 1px solid #666666; } border: 1px solid #666666; }
form.bp input.text, form.bp input.title, form.bp input[type=text], form.bp input[type=password] { form.bp input.text, form.bp input.title, form.bp input[type=email], form.bp input[type=text], form.bp input[type=password] {
width: 300px; } width: 300px; }
form.bp textarea { form.bp textarea {
width: 390px; width: 390px;

View File

@ -2,9 +2,7 @@
width: 950px; width: 950px;
margin: 0 auto; margin: 0 auto;
overflow: hidden; overflow: hidden;
display: inline-block; } *zoom: 1; }
.container {
display: block; }
.column, div.span-1, div.span-2, div.span-3, div.span-4, div.span-5, div.span-6, div.span-7, div.span-8, div.span-9, div.span-10, div.span-11, div.span-12, div.span-13, div.span-14, div.span-15, div.span-16, div.span-17, div.span-18, div.span-19, div.span-20, div.span-21, div.span-22, div.span-23, div.span-24 { .column, div.span-1, div.span-2, div.span-3, div.span-4, div.span-5, div.span-6, div.span-7, div.span-8, div.span-9, div.span-10, div.span-11, div.span-12, div.span-13, div.span-14, div.span-15, div.span-16, div.span-17, div.span-18, div.span-19, div.span-20, div.span-21, div.span-22, div.span-23, div.span-24 {
display: inline; display: inline;

View File

@ -3,9 +3,7 @@
width: 80%; width: 80%;
margin: 0 auto; margin: 0 auto;
overflow: hidden; overflow: hidden;
display: inline-block; } *zoom: 1; }
.container {
display: block; }
.span-1 { .span-1 {
width: 3.167%; } width: 3.167%; }

View File

@ -3,9 +3,7 @@
margin: 0 auto; margin: 0 auto;
direction: rtl; direction: rtl;
overflow: hidden; overflow: hidden;
display: inline-block; } *zoom: 1; }
.container {
display: block; }
.column, div.span-1, div.span-2, div.span-3, div.span-4, div.span-5, div.span-6, div.span-7, div.span-8, div.span-9, div.span-10, div.span-11, div.span-12, div.span-13, div.span-14, div.span-15, div.span-16, div.span-17, div.span-18, div.span-19, div.span-20, div.span-21, div.span-22, div.span-23, div.span-24 { .column, div.span-1, div.span-2, div.span-3, div.span-4, div.span-5, div.span-6, div.span-7, div.span-8, div.span-9, div.span-10, div.span-11, div.span-12, div.span-13, div.span-14, div.span-15, div.span-16, div.span-17, div.span-18, div.span-19, div.span-20, div.span-21, div.span-22, div.span-23, div.span-24 {
display: inline; display: inline;

View File

@ -6,9 +6,7 @@
.clearfix { .clearfix {
overflow: hidden; overflow: hidden;
display: inline-block; } *zoom: 1; }
.clearfix {
display: block; }
.small { .small {
font-size: 0.8em; font-size: 0.8em;

View File

@ -7,3 +7,8 @@ output_style = :nested
# To enable relative image paths using the images_url() function: # To enable relative image paths using the images_url() function:
# http_images_path = :relative # http_images_path = :relative
http_images_path = "/images" http_images_path = "/images"
line_comments = false
asset_cache_buster do |path, file|
"busted=true"
end

View File

@ -0,0 +1,23 @@
.simple {
-webkit-border-radius: 4px 4px;
-moz-border-radius: 4px / 4px;
-o-border-radius: 4px / 4px;
-ms-border-radius: 4px / 4px;
-khtml-border-radius: 4px / 4px;
border-radius: 4px / 4px; }
.compound {
-webkit-border-radius: 2px 3px;
-moz-border-radius: 2px 5px / 3px 6px;
-o-border-radius: 2px 5px / 3px 6px;
-ms-border-radius: 2px 5px / 3px 6px;
-khtml-border-radius: 2px 5px / 3px 6px;
border-radius: 2px 5px / 3px 6px; }
.crazy {
-webkit-border-radius: 1px 2px;
-moz-border-radius: 1px 3px 5px 7px / 2px 4px 6px 8px;
-o-border-radius: 1px 3px 5px 7px / 2px 4px 6px 8px;
-ms-border-radius: 1px 3px 5px 7px / 2px 4px 6px 8px;
-khtml-border-radius: 1px 3px 5px 7px / 2px 4px 6px 8px;
border-radius: 1px 3px 5px 7px / 2px 4px 6px 8px; }

View File

@ -0,0 +1,3 @@
@font-face {
font-family: "font1";
src: local("☺"), url('/tmp/fonts/font1.woff') format('woff'); }

View File

@ -1,75 +1,94 @@
.linear-1 { .linear-1 {
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(0%, #dddddd), color-stop(100%, #aaaaaa)); background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(0%, #dddddd), color-stop(100%, #aaaaaa));
background-image: -moz-linear-gradient(top, #dddddd 0%, #aaaaaa 100%); } background-image: -moz-linear-gradient(top, #dddddd 0%, #aaaaaa 100%);
background-image: linear-gradient(top, #dddddd 0%, #aaaaaa 100%); }
.linear-2 { .linear-2 {
background-image: -webkit-gradient(linear, 0% 0%, 100% 0%, color-stop(0%, #dddddd), color-stop(100%, #aaaaaa)); background-image: -webkit-gradient(linear, 0% 0%, 100% 0%, color-stop(0%, #dddddd), color-stop(100%, #aaaaaa));
background-image: -moz-linear-gradient(left, #dddddd 0%, #aaaaaa 100%); } background-image: -moz-linear-gradient(left, #dddddd 0%, #aaaaaa 100%);
background-image: linear-gradient(left, #dddddd 0%, #aaaaaa 100%); }
.linear-3 { .linear-3 {
background-image: -webkit-gradient(linear, 0% 0%, 100% 100%, color-stop(0%, #dddddd), color-stop(100%, #aaaaaa)); background-image: -webkit-gradient(linear, 0% 0%, 100% 100%, color-stop(0%, #dddddd), color-stop(100%, #aaaaaa));
background-image: -moz-linear-gradient(top left, #dddddd 0%, #aaaaaa 100%); } background-image: -moz-linear-gradient(top left, #dddddd 0%, #aaaaaa 100%);
background-image: linear-gradient(top left, #dddddd 0%, #aaaaaa 100%); }
.linear-4 { .linear-4 {
background-image: -webkit-gradient(linear, 100% 0%, 0% 100%, color-stop(0%, #dddddd), color-stop(100%, #aaaaaa)); background-image: -webkit-gradient(linear, 100% 0%, 0% 100%, color-stop(0%, #dddddd), color-stop(100%, #aaaaaa));
background-image: -moz-linear-gradient(top right, #dddddd 0%, #aaaaaa 100%); } background-image: -moz-linear-gradient(top right, #dddddd 0%, #aaaaaa 100%);
background-image: linear-gradient(top right, #dddddd 0%, #aaaaaa 100%); }
.linear-5 { .linear-5 {
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(0%, #dddddd), color-stop(50%, #cccccc), color-stop(100%, #aaaaaa)); background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(0%, #dddddd), color-stop(50%, #cccccc), color-stop(100%, #aaaaaa));
background-image: -moz-linear-gradient(top, #dddddd 0%, #cccccc 50%, #aaaaaa 100%); } background-image: -moz-linear-gradient(top, #dddddd 0%, #cccccc 50%, #aaaaaa 100%);
background-image: linear-gradient(top, #dddddd 0%, #cccccc 50%, #aaaaaa 100%); }
.linear-6 { .linear-6 {
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(0%, #dddddd), color-stop(20%, #cccccc), color-stop(100%, #aaaaaa)); background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(0%, #dddddd), color-stop(20%, #cccccc), color-stop(100%, #aaaaaa));
background-image: -moz-linear-gradient(top, #dddddd 0%, #cccccc 20%, #aaaaaa 100%); } background-image: -moz-linear-gradient(top, #dddddd 0%, #cccccc 20%, #aaaaaa 100%);
background-image: linear-gradient(top, #dddddd 0%, #cccccc 20%, #aaaaaa 100%); }
.linear-7 { .linear-7 {
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(0%, #dddddd), color-stop(20%, #cccccc), color-stop(60%, #eeeeee), color-stop(100%, #aaaaaa)); background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(0%, #dddddd), color-stop(20%, #cccccc), color-stop(60%, #eeeeee), color-stop(100%, #aaaaaa));
background-image: -moz-linear-gradient(top, #dddddd 0%, #cccccc 20%, #eeeeee 60%, #aaaaaa 100%); } background-image: -moz-linear-gradient(top, #dddddd 0%, #cccccc 20%, #eeeeee 60%, #aaaaaa 100%);
background-image: linear-gradient(top, #dddddd 0%, #cccccc 20%, #eeeeee 60%, #aaaaaa 100%); }
.linear-8 { .linear-8 {
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(80%, #dddddd), color-stop(100%, #aaaaaa)); background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(80%, #dddddd), color-stop(100%, #aaaaaa));
background-image: -moz-linear-gradient(top, #dddddd 80%, #aaaaaa 100%); } background-image: -moz-linear-gradient(top, #dddddd 80%, #aaaaaa 100%);
background-image: linear-gradient(top, #dddddd 80%, #aaaaaa 100%); }
.linear-9 { .linear-9 {
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(0%, #dddddd), color-stop(100%, #aaaaaa)); background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(0%, #dddddd), color-stop(100%, #aaaaaa));
background-image: -moz-linear-gradient(top, #dddddd 0%, #aaaaaa 20%); } background-image: -moz-linear-gradient(top, #dddddd 0%, #aaaaaa 20%);
background-image: linear-gradient(top, #dddddd 0%, #aaaaaa 20%); }
.linear-10 { .linear-10 {
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(80%, #dddddd), color-stop(100%, #aaaaaa)); background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(80%, #dddddd), color-stop(100%, #aaaaaa));
background-image: -moz-linear-gradient(top, #dddddd 40%, #aaaaaa 50%); } background-image: -moz-linear-gradient(top, #dddddd 40%, #aaaaaa 50%);
background-image: linear-gradient(top, #dddddd 40%, #aaaaaa 50%); }
.linear-11 { .linear-11 {
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(80%, #dddddd), color-stop(90%, #000000), color-stop(100%, #aaaaaa)); background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(80%, #dddddd), color-stop(90%, #000000), color-stop(100%, #aaaaaa));
background-image: -moz-linear-gradient(top, #dddddd 40%, #000000 45%, #aaaaaa 50%); } background-image: -moz-linear-gradient(top, #dddddd 40%, #000000 45%, #aaaaaa 50%);
background-image: linear-gradient(top, #dddddd 40%, #000000 45%, #aaaaaa 50%); }
.radial-1 { .radial-1 {
background-image: -webkit-gradient(radial, 50% 50%, 0, 50% 50%, 100, color-stop(0%, #dddddd), color-stop(100%, #aaaaaa)); background-image: -webkit-gradient(radial, 50% 50%, 0, 50% 50%, 100, color-stop(0%, #dddddd), color-stop(100%, #aaaaaa));
background-image: -moz-radial-gradient(center center, circle, #dddddd 0%, #aaaaaa 100%); } background-image: -moz-radial-gradient(center center, circle, #dddddd 0%, #aaaaaa 100%);
background-image: radial-gradient(center center, circle, #dddddd 0%, #aaaaaa 100%); }
.radial-2 { .radial-2 {
background-image: -webkit-gradient(radial, 50% 50%, 0, 50% 50%, 100, color-stop(0%, #dddddd), color-stop(100%, #aaaaaa)); background-image: -webkit-gradient(radial, 50% 50%, 0, 50% 50%, 100, color-stop(0%, #dddddd), color-stop(100%, #aaaaaa));
background-image: -moz-radial-gradient(center center, circle, #dddddd 0%, #aaaaaa 100%); } background-image: -moz-radial-gradient(center center, circle, #dddddd 0%, #aaaaaa 100%);
background-image: radial-gradient(center center, circle, #dddddd 0%, #aaaaaa 100%); }
.radial-3 { .radial-3 {
background-image: -webkit-gradient(radial, 50% 0%, 0, 50% 0%, 100, color-stop(0%, #dddddd), color-stop(100%, #aaaaaa)); background-image: -webkit-gradient(radial, 50% 0%, 0, 50% 0%, 100, color-stop(0%, #dddddd), color-stop(100%, #aaaaaa));
background-image: -moz-radial-gradient(top center, circle, #dddddd 0%, #aaaaaa 100%); } background-image: -moz-radial-gradient(top center, circle, #dddddd 0%, #aaaaaa 100%);
background-image: radial-gradient(top center, circle, #dddddd 0%, #aaaaaa 100%); }
.radial-4 { .radial-4 {
background-image: -webkit-gradient(radial, 50% 50%, 0, 50% 50%, 100, color-stop(0%, #dddddd), color-stop(100%, #aaaaaa)); background-image: -webkit-gradient(radial, 50% 50%, 0, 50% 50%, 100, color-stop(0%, #dddddd), color-stop(100%, #aaaaaa));
background-image: -moz-radial-gradient(center center, circle, #dddddd 0%, #aaaaaa 100%); } background-image: -moz-radial-gradient(center center, circle, #dddddd 0%, #aaaaaa 100%);
background-image: radial-gradient(center center, circle, #dddddd 0%, #aaaaaa 100%); }
.radial-5 { .radial-5 {
background-image: -webkit-gradient(radial, 50% 0%, 0, 50% 0%, 100, color-stop(0%, #dddddd), color-stop(100%, #aaaaaa)); background-image: -webkit-gradient(radial, 50% 0%, 0, 50% 0%, 100, color-stop(0%, #dddddd), color-stop(100%, #aaaaaa));
background-image: -moz-radial-gradient(top center, circle, #dddddd 0%, #aaaaaa 100%); } background-image: -moz-radial-gradient(top center, circle, #dddddd 0%, #aaaaaa 100%);
background-image: radial-gradient(top center, circle, #dddddd 0%, #aaaaaa 100%); }
.radial-6 { .radial-6 {
background-image: -webkit-gradient(radial, 50% 50%, 0, 50% 50%, 50, color-stop(40%, #dddddd), color-stop(100%, #aaaaaa)); background-image: -webkit-gradient(radial, 50% 50%, 0, 50% 50%, 50, color-stop(40%, #dddddd), color-stop(100%, #aaaaaa));
background-image: -moz-radial-gradient(center center, circle, #dddddd 20px, #aaaaaa 50px); } background-image: -moz-radial-gradient(center center, circle, #dddddd 20px, #aaaaaa 50px);
background-image: radial-gradient(center center, circle, #dddddd 20px, #aaaaaa 50px); }
.radial-7 { .radial-7 {
background-image: -webkit-gradient(radial, 50% 50%, 0, 50% 50%, 50, color-stop(20%, #dddddd), color-stop(100%, #aaaaaa)); background-image: -webkit-gradient(radial, 50% 50%, 0, 50% 50%, 50, color-stop(20%, #dddddd), color-stop(100%, #aaaaaa));
background-image: -moz-radial-gradient(center center, circle, #dddddd 20%, #aaaaaa 50px); } background-image: -moz-radial-gradient(center center, circle, #dddddd 20%, #aaaaaa 50px);
background-image: radial-gradient(center center, circle, #dddddd 20%, #aaaaaa 50px); }
.alpha-linear { .alpha-linear {
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(80%, rgba(255, 255, 255, 0)), color-stop(90%, rgba(255, 127, 127, 0.5)), color-stop(100%, #ffffff)); background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(80%, rgba(255, 255, 255, 0)), color-stop(90%, rgba(255, 127, 127, 0.5)), color-stop(100%, #ffffff));
background-image: -moz-linear-gradient(top, rgba(255, 255, 255, 0) 40%, rgba(255, 127, 127, 0.5) 45%, #ffffff 50%); } background-image: -moz-linear-gradient(top, rgba(255, 255, 255, 0) 40%, rgba(255, 127, 127, 0.5) 45%, #ffffff 50%);
background-image: linear-gradient(top, rgba(255, 255, 255, 0) 40%, rgba(255, 127, 127, 0.5) 45%, #ffffff 50%); }

View File

@ -0,0 +1,8 @@
.relative {
background-image: url('/images/4x6.png?busted=true'); }
.root-relative {
background-image: url('/images/4x6.png?busted=true'); }
.absolute {
background-image: url(http://example.com/images/4x6.png); }

View File

@ -0,0 +1,17 @@
.clearfix {
overflow: hidden;
display: inline-block; }
.clearfix {
display: block; }
.pie-clearfix {
display: inline-block; }
.pie-clearfix:after {
content: "\0020";
display: block;
height: 0;
clear: both;
overflow: hidden;
visibility: hidden; }
.pie-clearfix {
display: block; }

View File

@ -0,0 +1,134 @@
ul.horizontal {
margin: 0;
padding: 0;
border: 0;
outline: 0;
overflow: hidden;
*zoom: 1; }
ul.horizontal li {
list-style-image: none;
list-style-type: none;
margin-left: 0px;
white-space: nowrap;
display: inline;
float: left;
padding-left: 4px;
padding-right: 4px; }
ul.horizontal li:first-child, ul.horizontal li.first {
padding-left: 0px; }
ul.horizontal li:last-child, ul.horizontal li.last {
padding-right: 0px; }
ul.wide-horizontal {
margin: 0;
padding: 0;
border: 0;
outline: 0;
overflow: hidden;
*zoom: 1; }
ul.wide-horizontal li {
list-style-image: none;
list-style-type: none;
margin-left: 0px;
white-space: nowrap;
display: inline;
float: left;
padding-left: 10px;
padding-right: 10px; }
ul.wide-horizontal li:first-child, ul.wide-horizontal li.first {
padding-left: 0px; }
ul.wide-horizontal li:last-child, ul.wide-horizontal li.last {
padding-right: 0px; }
ul.right-horizontal {
margin: 0;
padding: 0;
border: 0;
outline: 0;
overflow: hidden;
*zoom: 1; }
ul.right-horizontal li {
list-style-image: none;
list-style-type: none;
margin-left: 0px;
white-space: nowrap;
display: inline;
float: right;
padding-left: 4px;
padding-right: 4px; }
ul.right-horizontal li:first-child, ul.right-horizontal li.first {
padding-right: 0px; }
ul.right-horizontal li:last-child, ul.right-horizontal li.last {
padding-left: 0px; }
ul.inline-block {
margin: 0;
padding: 0;
border: 0;
outline: 0;
overflow: hidden;
*zoom: 1; }
ul.inline-block li {
list-style-image: none;
list-style-type: none;
margin-left: 0px;
display: -moz-inline-box;
-moz-box-orient: vertical;
display: inline-block;
vertical-align: middle;
*display: inline;
*vertical-align: auto;
white-space: nowrap; }
ul.wide-inline-block {
margin: 0;
padding: 0;
border: 0;
outline: 0;
overflow: hidden;
*zoom: 1; }
ul.wide-inline-block li {
list-style-image: none;
list-style-type: none;
margin-left: 0px;
display: -moz-inline-box;
-moz-box-orient: vertical;
display: inline-block;
vertical-align: middle;
*display: inline;
*vertical-align: auto;
white-space: nowrap;
padding-left: 10px;
padding-right: 10px; }
ul.inline {
list-style-type: none; }
ul.inline, ul.inline li {
margin: 0px;
padding: 0px;
display: inline; }
ul.comma {
list-style-type: none; }
ul.comma, ul.comma li {
margin: 0px;
padding: 0px;
display: inline; }
ul.comma li:after {
content: ", "; }
ul.comma li:last-child:after, ul.comma li.last:after {
content: ""; }
ul.no-bullets {
list-style: none; }
ul.no-bullets li {
list-style-image: none;
list-style-type: none;
margin-left: 0px; }
ul.pretty {
margin-left: 0; }
ul.pretty li {
padding-left: 14px;
background: url('/images/4x6.png?busted=true') no-repeat 4px 7px;
list-style-type: none; }

View File

@ -1,17 +1,13 @@
.clearfix { .clearfix {
overflow: hidden; overflow: hidden;
display: inline-block; } *zoom: 1; }
.clearfix {
display: block; }
.pie-clearfix { .pie-clearfix {
display: inline-block; } *zoom: 1; }
.pie-clearfix:after { .pie-clearfix:after {
content: " "; content: "\0020";
display: block; display: block;
height: 0; height: 0;
clear: both; clear: both;
overflow: hidden; overflow: hidden;
visibility: hidden; } visibility: hidden; }
.pie-clearfix {
display: block; }

Binary file not shown.

After

Width:  |  Height:  |  Size: 875 B

View File

@ -0,0 +1,5 @@
@import "compass/css3/border-radius";
.simple { @include border-radius(4px, 4px); }
.compound { @include border-radius(2px 5px, 3px 6px); }
.crazy { @include border-radius(1px 3px 5px 7px, 2px 4px 6px 8px)}

View File

@ -0,0 +1,3 @@
@import compass/css3/font-face
+font-face("font1", font-files("font1.woff", woff))

View File

@ -0,0 +1,9 @@
.relative {
background-image: image-url("4x6.png");
}
.root-relative {
background-image: image-url("/images/4x6.png");
}
.absolute {
background-image: image-url("http://example.com/images/4x6.png");
}

View File

@ -0,0 +1,11 @@
$default-has-layout-approach: block;
@import "compass/utilities";
.clearfix {
@include clearfix;
}
.pie-clearfix {
@include pie-clearfix;
}

View File

@ -0,0 +1,11 @@
@import "compass/utilities/lists";
ul.horizontal { @include horizontal-list; }
ul.wide-horizontal { @include horizontal-list(10px); }
ul.right-horizontal { @include horizontal-list(4px, right); }
ul.inline-block { @include inline-block-list; }
ul.wide-inline-block { @include inline-block-list(10px); }
ul.inline { @include inline-list; }
ul.comma { @include comma-delimited-list; }
ul.no-bullets { @include no-bullets; }
ul.pretty { @include pretty-bullets("4x6.png"); }

View File

@ -19,6 +19,10 @@ module Compass
end end
else else
begin begin
require 'action_pack/version'
if ActionPack::VERSION::MAJOR >= 3
`rails new #{name}`
else
require 'rails/version' require 'rails/version'
require 'rails_generator' require 'rails_generator'
require 'rails_generator/scripts/generate' require 'rails_generator/scripts/generate'
@ -27,6 +31,7 @@ module Compass
Rails::Generator::Base.logger = Rails::Generator::SimpleLogger.new $stdout Rails::Generator::Base.logger = Rails::Generator::SimpleLogger.new $stdout
Rails::Generator::Scripts::Generate.new.run([name], :generator => 'app') Rails::Generator::Scripts::Generate.new.run([name], :generator => 'app')
end end
end
rescue LoadError rescue LoadError
Kernel.exit!(2) Kernel.exit!(2)
rescue => e rescue => e