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
*.tmproj
*.lock
sync
tmp/*
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
:state: alpha
:build: 0

View File

@ -13,7 +13,7 @@ Gem::Specification.new do |gemspec|
gemspec.executables = %w(compass)
gemspec.has_rdoc = false
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.add_dependency('haml', '>= 3.0.4')
gemspec.files = %w(README.markdown LICENSE.markdown VERSION.yml Rakefile)

View File

@ -1,116 +1,55 @@
---
dependencies:
fssm:
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: []
GIT
remote: git://github.com/chriseppstein/nanoc.git
revision: 3982942
branch: 3.1.x
specs:
nanoc3 (3.1.2)
cri (>= 1.0.0)
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
require: false
git: git://github.com/chriseppstein/nanoc.git
ref: 398294262623dac9bb15dcbbfc0ba33c04f8125e
- 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'
puts "Compass running from: #{Compass.lib_directory}"
Compass.add_configuration "#{File.dirname(__FILE__)}/.compass/config.rb"
SITE_ROOT = "/docs"

View File

@ -7,6 +7,7 @@ layout: article
COMPASS CHANGELOG
=================
<<<<<<< HEAD:doc-src/content/CHANGELOG.markdown
0.11.alpha.1
------------
@ -39,6 +40,79 @@ COMPASS CHANGELOG
* `+opacity` no longer uses any prefixed variations, as IE uses `filter` and
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)
---------------------
@ -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
[adamstac]: http://github.com/adamstac
[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
%h3
%a(href="#stylesheet-url")
stylesheet-url($path)
stylesheet-url($path, $only-path: false)
.details
%p
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
%h3
%a(href="#font-url")
font-url($path)
font-url($path, $only-path: false)
.details
%p
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
%h3
%a(href="#image-url")
image-url($path)
image-url($path, $only-path: false)
.details
%p
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/utilities";
@import "blueprint/screen";
@import "blueprint";
// etc.

View File

@ -108,6 +108,18 @@ command line will override the corresponding settings in your configuration file
Defaults to <code>"stylesheets"</code>.
</td>
</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>
<td style="vertical-align:top;"><code>sass_dir</code> </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>.
</td>
</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>
<td style="vertical-align:top;"><code>images_dir</code> </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>.
</td>
</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>
<td style="vertical-align:top;"><code>javascripts_dir</code> </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>.
</td>
</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>
<td style="vertical-align:top;"><code>output_style</code> </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.
</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>
<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>
<td style="vertical-align:top;"><code>additional_import_paths</code> </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
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.
2. `image` - Declares an image.
3. `javascript` - Declares a javascript file.
4. `html` - Declares an html file.
5. `file` - Declares a random file.
4. `font` - Declares a font 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
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
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:
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
%aside(role="sidebar")
%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

View File

@ -1,5 +1,5 @@
- render 'main' 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"
%article= yield

View File

@ -7,7 +7,7 @@
%code @import "#{departialize(item[:stylesheet][0..-6])}"
%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]}"
View the
%a{:href => gh_url} Source for this module on Github.

View File

@ -11,7 +11,7 @@ class SyntaxHighlighterFilter < Nanoc3::Filter
def pygmentize(code, type)
# -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.close_write
return io.read

View File

@ -30,9 +30,9 @@ end
def reference_item(options)
stylesheet = options[:stylesheet]
@site.cached("reference/item/#{stylesheet}") do
path = stylesheet_path(stylesheet)
if path
path = stylesheet_path(stylesheet)
if path
@site.cached("reference/item/#{path}") do
@items.detect do |i|
if i.identifier =~ /^\/reference/ && i[:stylesheet]
i[:stylesheet] == path
@ -54,27 +54,28 @@ def reference_path(options)
end
def import_paths
paths = Compass::Frameworks::ALL.inject([]) {|m, f| m << f.stylesheets_directory}
paths.map!{|p|[p, '']}
paths = []
if @item[:stylesheet]
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
paths += Compass::Frameworks::ALL.inject([]) {|m, f| m << f.stylesheets_directory}.map!{|p|[p, '']}
paths
end
def stylesheet_path(ss)
@site.cached("stylesheet/path/#{ss}") do
possible_names = possible_filenames_for_stylesheet(ss)
import_paths.each do |import_path|
possible_names.each do |filename|
full_path = File.join(import_path.first, filename)
if File.exist?(full_path)
return "#{import_path.last}#{"/" if import_path.last && import_path.last.length > 0}#{filename}"
end
possible_names = possible_filenames_for_stylesheet(ss)
import_paths.each do |import_path|
possible_names.each do |filename|
full_path = File.join(import_path.first, filename)
if File.exist?(full_path)
return "#{import_path.last}#{"/" if import_path.last && import_path.last.length > 0}#{filename}"
end
end
end
nil
end
def possible_filenames_for_stylesheet(ss)
@ -85,9 +86,9 @@ def possible_filenames_for_stylesheet(ss)
extensions = if ext.size > 0
[ext]
else
[".sass", ".scss"]
[".scss", ".sass"]
end
basenames = [base, "_#{base}"]
basenames = ["_#{base}", base]
filenames = []
basenames.each do |basename|
extensions.each do |extension|
@ -125,6 +126,7 @@ def constants(item)
if child.is_a?(Sass::Tree::VariableNode)
child.comment = comment && Sass::Tree::CommentNode.clean(comment)
comment = nil
child.name.tr!("_",'-')
constants << child
elsif child.is_a?(Sass::Tree::CommentNode)
comment ||= ""
@ -137,6 +139,32 @@ def constants(item)
constants
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)
mixin.sass_signature(:none, format)
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

@ -258,15 +258,21 @@ Feature: Command Line
Given I am using the existing project in test/fixtures/stylesheets/compass
When I run: compass stats
Then I am told statistics for each file:
| Filename | Rules | Properties | Mixins Defs | Mixins Used | CSS Rules | CSS Properties |
| sass/box.sass | 15 | 0 | 0 | 19 | 15 | 59 |
| sass/gradients.sass | 19 | 0 | 0 | 19 | 19 | 19 |
| sass/image_size.sass | 4 | 8 | 0 | 0 | 4 | 8 |
| sass/layout.sass | 0 | 0 | 0 | 1 | 5 | 10 |
| sass/print.sass | 0 | 0 | 0 | 2 | 61 | 61 |
| sass/reset.sass | 4 | 1 | 0 | 2 | 190 | 664 |
| sass/utilities.scss | 2 | 0 | 0 | 2 | 5 | 11 |
| Total.* | 44 | 9 | 0 | 45 | 299 | 832 |
| 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/fonts.sass | 0 | 0 | 0 | 1 | 1 | 2 |
| sass/gradients.sass | 19 | 0 | 0 | 19 | 19 | 19 |
| 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/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/reset.sass | 4 | 1 | 0 | 2 | 190 | 664 |
| sass/utilities.scss | 2 | 0 | 0 | 2 | 3 | 9 |
| ------------------------- | ----- | ---------- | -------------- | ----------- | --------- | -------------- |
| Total.* | 61 | 12 | 0 | 60 | 344 | 975 |
@listframeworks
Scenario: List frameworks registered with compass

View File

@ -34,7 +34,7 @@ Given %r{^I am in the parent directory$} do
Dir.chdir ".."
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
begin
generate_rails_app project_name

View File

@ -23,8 +23,7 @@ $blueprint_button_active_font_color: white !default;
// Sets the colors for a button
// @param border_highlight_color
// 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,
$bg_color: $blueprint_button_background_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
// @param border_highlight_color
// 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,
$bg_color: $blueprint_button_active_background_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.
// @param border_highlight_color
// 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,
$bg_color: $blueprint_button_hover_background_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;
$header-color: darken($font-color, 6.67%) !default;
$alt-text-color: #666666 !default;
$blueprint-background-color: #eeeeee !default;
$link-color: #000099 !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
// `$old-line-height` - The old line height. Defaults to 1.5 times the base-font-size
@mixin incr
(
@mixin incr(
$font-size: 10px,
$base-font-size: $blueprint-font-size,
$old-line-height: $base-font-size * 1.5

View File

@ -21,6 +21,7 @@
input {
&.text,
&.title,
&[type=email],
&[type=text],
&[type=password] { margin: 0.5em 0; background-color: white; padding: 5px; }
&.title { font-size: 1.5em; }
@ -42,6 +43,7 @@
input {
&.text,
&.title,
&[type=email],
&[type=text],
&[type=password] { width: $input_width; }
}
@ -56,7 +58,7 @@
) {
fieldset {
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 {
border: 1px solid $unfocused_border_color;
&: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; }
}
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; }
em { font-style: italic; }
dfn { font-style: italic; font-weight: bold; }
sup, sub { line-height: 0; }
abbr, acronym { border-bottom: 1px dotted #666666; }
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, code, tt { @include fixed-width-text; }
li ul, li ol { margin: 0; }
@ -84,7 +84,7 @@ $blueprint-font-size: 12px !default;
th, td, caption { padding: 4px 10px 4px 5px; }
tr.even td { background: $blueprint-table-stripe-color; }
tfoot { font-style: italic; }
caption { background: #eeeeee; }
caption { background: $blueprint_background_color; }
.quiet { @include quiet; }
.loud { @include loud; }
}

View File

@ -3,9 +3,69 @@
$default-border-radius: 5px !default;
// 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) {
@include experimental(border-radius, $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);
}
}
// 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;
// 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).
$default-box-shadow-inset : false !default
$default-box-shadow-inset : false !default;
// Provides cross-browser CSS box shadows for Webkit, Gecko, and CSS3.
// 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.";
}
@font-face {
font-family: "#{$name}";
@if $eot {
src: font-url($eot); }
src: local(""), #{$font-files};
font-family: quote($name);
@if $eot { src: font-url($eot); }
src: local(""), $font-files;
}
}

View File

@ -37,7 +37,7 @@
$background: unquote("");
@if $image { $background : $image + unquote(", "); }
$start: unquote($start);
$end: grad-opposite-position($start);
$end: opposite-position($start);
@if $experimental-support-for-webkit {
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
// so they are rendered correctly in browsers that don't recognize them.
@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; } }
// Resets the display of inline and block elements to their default display

View File

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

View File

@ -18,12 +18,9 @@
// [Easy Clearing](http://www.positioniseverything.net/easyclearing.html)
// has the advantage of allowing positioned elements to hang
// 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 {
&:after {
content : " ";
content : "\0020";
display : block;
height : 0;
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
// to gain the "hasLayout" property in internet explorer.
// 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
display: inline-block;
// and this puts it back to block
& {
display: block; } }
& { display: block; }
}
// A hack to supply IE6 (and below) with a different property value.
// [Read more](http://www.cssportal.com/css-hacks/#in_css-important).

View File

@ -16,6 +16,7 @@
// +horizontal-list-item
@import "bullets";
@import "compass/utilities/general/clearfix";
@import "compass/utilities/general/reset";
@import "compass/utilities/general/float";
@ -31,21 +32,21 @@
// :last-child is not fully supported
// 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;
white-space: nowrap;
@include float-left;
@include float($direction);
padding: {
left: $padding;
right: $padding; };
&:first-child, &.first {
padding-left: 0px; }
&:last-child, &.last {
padding-right: 0px; } }
right: $padding;
};
&:first-child, &.first { padding-#{$direction}: 0px; }
&:last-child, &.last { padding-#{opposite-position($direction)}: 0px; }
}
// 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.
@mixin horizontal-list($padding: 4px) {
@mixin horizontal-list($padding: 4px, $direction: left) {
@include horizontal-list-container;
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 {
list-style-type: none;
margin: 0px;
padding: 0px;
display: inline;
li {
&, & li {
margin: 0px;
padding: 0px;
display: inline; } }
display: inline;
}
}
// makes an inline list that is comma delimited.
// 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)
//
// `:last-child` is not fully supported.
@ -22,8 +21,9 @@
@mixin comma-delimited-list {
@include inline-list;
li {
&:after {
content: ", "; }
&:after { content: ", "; }
&:last-child, &.last {
&:after {
content: ""; } } } }
&:after { content: ""; }
}
}
}

View File

@ -26,7 +26,9 @@
// Hides text in an element so you can see the background.
@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;
text-align: left;
}

View File

@ -34,6 +34,13 @@ module Compass
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

View File

@ -1,8 +1,12 @@
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
begin
Sass::Script::String.new "url(#{image_path(path.value)})"
if only_path.to_bool
Sass::Script::String.new image_path(path.value)
else
Sass::Script::String.new "url(#{image_path(path.value)})"
end
ensure
@controller = nil
end

View File

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

View File

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

View File

@ -33,13 +33,14 @@ module Compass
require 'compass/stats'
compiler = new_compiler_instance
sass_files = sorted_sass_files(compiler)
total_label = "Total (#{sass_files.size} files):"
rows = [[ :-, :-, :-, :-, :-, :-, :- ],
[ '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 ]
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|
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
def perform
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?
installer.finalize(:create => is_project_creation?)
installer.finalize(options.merge(:create => is_project_creation?))
end
def is_project_creation?

View File

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

View File

@ -25,7 +25,7 @@ module Compass
extend Compass::Configuration::Paths
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/}
@ -95,6 +95,16 @@ module Compass
super
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?
# the http_images_path is deprecated, but here for backwards compatibility.
relative_assets || http_images_path == :relative

View File

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

View File

@ -56,6 +56,12 @@ module Compass
(required_libraries || []).each do |lib|
contents << %Q{require '#{lib}'\n}
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 << "\n" if (required_libraries || []).any?
ATTRIBUTES.each do |prop|

View File

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

View File

@ -7,9 +7,24 @@ module Compass::Exec::GlobalOptionsParser
opts.on('-r LIBRARY', '--require LIBRARY',
"Require the given ruby LIBRARY before running commands.",
" This is used to access compass plugins without having a",
" project configuration file.") do |library|
::Compass.configuration.require library
end
" project configuration file."
) do |library|
::Compass.configuration.require library
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
self.options[:quiet] = true

View File

@ -3,6 +3,14 @@ module Compass::Exec::ProjectOptionsParser
super
set_project_options(opts)
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)
opts.on('-c', '--config CONFIG_FILE', 'Specify the location of the configuration file explicitly.') do |configuration_file|
self.options[:configuration_file] = configuration_file
@ -13,19 +21,19 @@ module Compass::Exec::ProjectOptionsParser
end
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
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
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
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
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.
# Every installer must conform to the installation strategy of prepare, install, and then finalize.
# A default implementation is provided for each step.
def run(options = {})
prepare
install
finalize(options) unless options[:skip_finalization]
def run(run_options = {})
prepare unless run_options[:skip_preparation]
install unless options[:prepare]
finalize(options.merge(run_options)) unless options[:prepare] || run_options[:skip_finalization]
end
# The default prepare method -- it is a no-op.
@ -116,6 +116,19 @@ module Compass
"#{pattern_name_as_dir}#{to}"
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
def install_html(from, to, options)
if to =~ /\.haml$/

View File

@ -20,7 +20,19 @@ module Compass
parse(manifest_file) if manifest_file
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
def #{t}(from, options = {})
@entries << Entry.new(:#{t}, from, options)
@ -34,12 +46,35 @@ module Compass
END
end
type :stylesheet
type :image
type :javascript
type :font
type :file
type :html
type :stylesheet, :plural => :stylesheets, :extensions => %w(scss sass)
type :image, :plural => :images, :extensions => %w(png gif jpg jpeg tiff gif)
type :javascript, :plural => :javascripts, :extensions => %w(js)
type :font, :plural => :fonts, :extensions => %w(otf woff ttf)
type :html, :plural => :html, :extensions => %w(html haml)
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)
if value
@ -95,13 +130,23 @@ module Compass
@compile_after_generation = false
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
# evaluated in a Manifest instance context
def parse(manifest_file)
open(manifest_file) do |f|
eval(f.read, instance_binding, manifest_file)
with_manifest(manifest_file) do
open(manifest_file) do |f|
eval(f.read, instance_binding, manifest_file)
end
end
end
def instance_binding
binding
end

View File

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

View File

@ -1,7 +1,11 @@
module Compass::SassExtensions::Functions
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}"
end
@ -14,6 +18,8 @@ module Sass::Script::Functions
include Compass::SassExtensions::Functions::ImageSize
include Compass::SassExtensions::Functions::GradientSupport::Functions
include Compass::SassExtensions::Functions::FontFiles
include Compass::SassExtensions::Functions::Constants
include Compass::SassExtensions::Functions::Lists
end
# 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
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.
def grad_color_stops(color_list)
assert_list(color_list)

View File

@ -1,4 +1,3 @@
require 'base64'
module Compass::SassExtensions::Functions::InlineImage
def inline_image(path, mime_type = nil)
@ -10,19 +9,18 @@ module Compass::SassExtensions::Functions::InlineImage
def inline_font_files(*args)
raise Sass::SyntaxError, "An even number of arguments must be passed to font_files()" unless args.size % 2 == 0
path = path.value
files = []
while args.size > 0
path = args.shift.value
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}')"
end
Sass::Script::String.new(files.join(", "))
end
private
def compute_mime_type(path, mime_type)
def compute_mime_type(path, mime_type = nil)
return mime_type if mime_type
case path
when /\.png$/i
@ -48,7 +46,7 @@ private
def data(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
raise Compass::Error, "File not found or cannot be read: #{real_path}"
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
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
# or nil if the http_images_path is not set in the configuration.
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
Compass.configuration.http_stylesheets_path
else
Compass.configuration.http_root_relative(Compass.configuration.css_dir)
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
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.
# 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
# or nil if the http_fonts_path cannot be determined from the configuration.
http_fonts_path = if relative?
compute_relative_path(Compass.configuration.fonts_dir)
compute_relative_path(Compass.configuration.fonts_path)
else
Compass.configuration.http_fonts_path
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
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.
# Short curcuit if they have provided an absolute url.
if absolute_path?(path)
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.
return Sass::Script::String.new("url(#{path})")
end
# 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.
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
Compass.configuration.http_images_path
else
@ -75,16 +90,24 @@ module Compass::SassExtensions::Functions::Urls
# prepend the asset host if there is one.
path = "#{asset_host}#{'/' unless path[0..0] == "/"}#{path}" if asset_host
clean_url(path)
if only_path.to_bool
Sass::Script::String.new(clean_path(path))
else
clean_url(path)
end
end
private
# Emits a url, taking off any leading "./"
def clean_url(url)
# Emits a path, taking off any leading "./"
def clean_path(url)
url = url.to_s
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
def relative?
@ -95,9 +118,8 @@ module Compass::SassExtensions::Functions::Urls
path[0..0] == "/" || path[0..3] == "http"
end
def compute_relative_path(dir)
def compute_relative_path(path)
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
end
end

View File

@ -11,7 +11,7 @@ module Compass
def visit(node)
self.prop_count += 1 if node.is_a?(Sass::Tree::PropNode) && !node.children.any?
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
self.mixin_def_count += 1 if node.is_a?(Sass::Tree::MixinDefNode)
self.mixin_count += 1 if node.is_a?(Sass::Tree::MixinNode)

View File

@ -4,6 +4,6 @@ begin
rescue LoadError
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

View File

@ -200,9 +200,7 @@ caption {
.clearfix {
overflow: hidden;
display: inline-block; }
.clearfix {
display: block; }
*zoom: 1; }
.small {
font-size: 0.8em;
@ -234,9 +232,7 @@ caption {
width: 950px;
margin: 0 auto;
overflow: hidden;
display: inline-block; }
.container {
display: block; }
*zoom: 1; }
.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;
@ -726,7 +722,7 @@ legend {
font-weight: bold;
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;
background-color: white;
padding: 5px; }
@ -746,14 +742,14 @@ select {
fieldset {
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 {
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 {
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; }
textarea {

View File

@ -11,7 +11,7 @@ form.bp fieldset {
form.bp legend {
font-weight: bold;
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;
background-color: white;
padding: 5px; }
@ -27,13 +27,13 @@ form.bp select {
margin: 0.5em 0; }
form.bp fieldset {
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 {
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 {
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; }
form.bp textarea {
width: 390px;

View File

@ -2,9 +2,7 @@
width: 950px;
margin: 0 auto;
overflow: hidden;
display: inline-block; }
.container {
display: block; }
*zoom: 1; }
.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;

View File

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

View File

@ -3,9 +3,7 @@
margin: 0 auto;
direction: rtl;
overflow: hidden;
display: inline-block; }
.container {
display: block; }
*zoom: 1; }
.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;

View File

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

View File

@ -7,3 +7,8 @@ output_style = :nested
# To enable relative image paths using the images_url() function:
# http_images_path = :relative
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 {
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 {
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 {
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 {
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 {
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 {
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 {
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 {
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 {
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 {
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 {
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 {
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 {
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 {
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 {
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 {
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 {
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 {
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 {
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 {
overflow: hidden;
display: inline-block; }
.clearfix {
display: block; }
*zoom: 1; }
.pie-clearfix {
display: inline-block; }
*zoom: 1; }
.pie-clearfix:after {
content: " ";
content: "\0020";
display: block;
height: 0;
clear: both;
overflow: 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,13 +19,18 @@ module Compass
end
else
begin
require 'rails/version'
require 'rails_generator'
require 'rails_generator/scripts/generate'
Rails::Generator::Base.use_application_sources!
capture_output do
Rails::Generator::Base.logger = Rails::Generator::SimpleLogger.new $stdout
Rails::Generator::Scripts::Generate.new.run([name], :generator => 'app')
require 'action_pack/version'
if ActionPack::VERSION::MAJOR >= 3
`rails new #{name}`
else
require 'rails/version'
require 'rails_generator'
require 'rails_generator/scripts/generate'
Rails::Generator::Base.use_application_sources!
capture_output do
Rails::Generator::Base.logger = Rails::Generator::SimpleLogger.new $stdout
Rails::Generator::Scripts::Generate.new.run([name], :generator => 'app')
end
end
rescue LoadError
Kernel.exit!(2)