From 45ca5eb1470088553cea30181ed2a66092593cbd Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Mon, 11 Oct 2010 02:24:45 -0700 Subject: [PATCH 01/36] Fix error in installation instructions on scss-based projects. Closes GH-186. --- lib/compass/app_integration/rails/installer.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/compass/app_integration/rails/installer.rb b/lib/compass/app_integration/rails/installer.rb index e3c7d110..443a2b37 100644 --- a/lib/compass/app_integration/rails/installer.rb +++ b/lib/compass/app_integration/rails/installer.rb @@ -122,7 +122,7 @@ NEXTSTEPS manifest.each_stylesheet do |stylesheet| # Skip partials. next if File.basename(stylesheet.from)[0..0] == "_" - ss_line = " = stylesheet_link_tag '#{stylesheet_prefix}#{stylesheet.to.sub(/\.sass$/,'.css')}'" + ss_line = " = stylesheet_link_tag '#{stylesheet_prefix}#{stylesheet.to.sub(/\.s[ac]ss$/,'.css')}'" if stylesheet.options[:media] ss_line += ", :media => '#{stylesheet.options[:media]}'" end From 37db7f3b8c7e2faeb72463b97059bbca5720c6a7 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Mon, 11 Oct 2010 02:33:35 -0700 Subject: [PATCH 02/36] Add help text for the imports subcommand. Closes GH-182 --- lib/compass/commands/imports.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/compass/commands/imports.rb b/lib/compass/commands/imports.rb index 24505258..43c1e67a 100644 --- a/lib/compass/commands/imports.rb +++ b/lib/compass/commands/imports.rb @@ -16,6 +16,12 @@ module Compass def description(command) "Emit an imports suitable for passing to the sass command-line." end + def usage + "Usage: compass imports\n\n" + + "Prints out the imports known to compass.\n"+ + "Useful for passing imports to the sass command line:\n" + + " sass -r compass `compass imports` a_file_using_compass.sass" + end def parse!(arguments) if arguments.join("").strip.size > 0 raise OptionParser::ParseError, "This command takes no options or arguments." From 00fe77715a70adf480aee45107d28ad9c2f66893 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Mon, 11 Oct 2010 03:10:35 -0700 Subject: [PATCH 03/36] Make this example work right. --- examples/compass/bootstrap.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/compass/bootstrap.rb b/examples/compass/bootstrap.rb index fcc0c7c4..90132470 100644 --- a/examples/compass/bootstrap.rb +++ b/examples/compass/bootstrap.rb @@ -1,3 +1,4 @@ require File.join(File.dirname(__FILE__), '..', 'downloader') -install_from_github('chriseppstein', 'yui-compass-plugin', 'yui') \ No newline at end of file +install_from_github('chriseppstein', 'yui-compass-plugin', 'yui') +install_from_github('chriseppstein', 'Compass-Layouts', 'compass-layouts') \ No newline at end of file From 60fc4b79ce27465c91f052e2a99272eee3d4a07c Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Mon, 11 Oct 2010 03:51:28 -0700 Subject: [PATCH 04/36] Allow users to disable the hacks surrounding IE6&7 by disabling legacy support for IE. --- .../compass/stylesheets/compass/_support.scss | 26 +++++++++++++ .../compass/css3/_inline-block.scss | 8 +++- .../stylesheets/compass/css3/_shared.scss | 11 +----- .../compass/utilities/general/_hacks.scss | 39 ++++++++++++------- 4 files changed, 58 insertions(+), 26 deletions(-) create mode 100644 frameworks/compass/stylesheets/compass/_support.scss diff --git a/frameworks/compass/stylesheets/compass/_support.scss b/frameworks/compass/stylesheets/compass/_support.scss new file mode 100644 index 00000000..d98bd60b --- /dev/null +++ b/frameworks/compass/stylesheets/compass/_support.scss @@ -0,0 +1,26 @@ +// Usually compass hacks apply to both ie6 & 7 -- set this to false to disable support for both. +$legacy-support-for-ie: true !default; + +// Setting this to false will result in smaller output, but no support for ie6 +$legacy-support-for-ie6: $legacy-support-for-ie !default; + +// Setting this to false will result in smaller output, but no support for ie7 +$legacy-support-for-ie7: $legacy-support-for-ie !default; + +// @doc off +// The user can simply set $legacy-support-for-ie and 6 & 7 will be set accordingly, +// But in case the user set either of those explicitly, we need to sync the value of +// this combined variable. +$legacy-support-for-ie: $legacy-support-for-ie6 or $legacy-support-for-ie7; +// @doc on + +// Support for mozilla in experimental css3 properties. +$experimental-support-for-mozilla : true !default; +// Support for webkit in experimental css3 properties. +$experimental-support-for-webkit : true !default; +// Support for opera in experimental css3 properties. +$experimental-support-for-opera : true !default; +// Support for microsoft in experimental css3 properties. +$experimental-support-for-microsoft : true !default; +// Support for khtml in experimental css3 properties. +$experimental-support-for-khtml : true !default; diff --git a/frameworks/compass/stylesheets/compass/css3/_inline-block.scss b/frameworks/compass/stylesheets/compass/css3/_inline-block.scss index f50293ad..32984c1d 100644 --- a/frameworks/compass/stylesheets/compass/css3/_inline-block.scss +++ b/frameworks/compass/stylesheets/compass/css3/_inline-block.scss @@ -3,10 +3,14 @@ // Provides a cross-browser method to implement `display: inline-block;` @mixin inline-block { + @if $legacy-support-for-ie { + & { *display: inline; } + } display: -moz-inline-box; -moz-box-orient: vertical; display: inline-block; vertical-align: middle; - *display: inline; - *vertical-align: auto; + @if $legacy-support-for-ie { + *vertical-align: auto; + } } diff --git a/frameworks/compass/stylesheets/compass/css3/_shared.scss b/frameworks/compass/stylesheets/compass/css3/_shared.scss index 87cbf431..e0860673 100644 --- a/frameworks/compass/stylesheets/compass/css3/_shared.scss +++ b/frameworks/compass/stylesheets/compass/css3/_shared.scss @@ -1,13 +1,4 @@ -// Support for mozilla in experimental css3 properties. -$experimental-support-for-mozilla : true !default; -// Support for webkit in experimental css3 properties. -$experimental-support-for-webkit : true !default; -// Support for opera in experimental css3 properties. -$experimental-support-for-opera : true !default; -// Support for microsoft in experimental css3 properties. -$experimental-support-for-microsoft : true !default; -// Support for khtml in experimental css3 properties. -$experimental-support-for-khtml : true !default; +@import "compass/support"; // This mixin provides basic support for CSS3 properties and // their corresponding experimental CSS2 properties when diff --git a/frameworks/compass/stylesheets/compass/utilities/general/_hacks.scss b/frameworks/compass/stylesheets/compass/utilities/general/_hacks.scss index 4f6ec87d..748666ca 100644 --- a/frameworks/compass/stylesheets/compass/utilities/general/_hacks.scss +++ b/frameworks/compass/stylesheets/compass/utilities/general/_hacks.scss @@ -1,3 +1,5 @@ +@import "compass/support"; + // 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. @@ -7,29 +9,38 @@ $default-has-layout-approach: zoom !default; // to gain the "hasLayout" property in internet explorer. // More information on [hasLayout](http://reference.sitepoint.com/css/haslayout). @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; + @if $legacy-support-for-ie { + @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; + @if $legacy-support-for-ie { + *zoom: 1; + } } @mixin has-layout-block { - // This makes ie6 get layout - display: inline-block; - // and this puts it back to block - & { display: block; } + @if $legacy-support-for-ie { + // This makes ie6 get layout + display: inline-block; + // and this puts it back to 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). @mixin bang-hack($property, $value, $ie6-value) { - #{$property}: #{$value} !important; - #{$property}: #{$ie6-value}; } + @if $legacy-support-for-ie6 { + #{$property}: #{$value} !important; + #{$property}: #{$ie6-value}; + } +} From 069f3285627d6592ffda59b01857936b51d4e0b3 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Mon, 11 Oct 2010 04:24:03 -0700 Subject: [PATCH 05/36] Document the browser support variables --- doc-src/content/CHANGELOG.markdown | 2 ++ doc-src/content/reference/compass/support.haml | 17 +++++++++++++++++ doc-src/content/stylesheets/screen.sass | 4 +++- doc-src/layouts/simple_core.scss | 7 +++++++ doc-src/lib/stylesheets.rb | 2 +- .../compass/stylesheets/compass/_support.scss | 3 +-- 6 files changed, 31 insertions(+), 4 deletions(-) create mode 100644 doc-src/content/reference/compass/support.haml create mode 100644 doc-src/layouts/simple_core.scss diff --git a/doc-src/content/CHANGELOG.markdown b/doc-src/content/CHANGELOG.markdown index 8a1d9eff..1b831e8a 100644 --- a/doc-src/content/CHANGELOG.markdown +++ b/doc-src/content/CHANGELOG.markdown @@ -15,6 +15,8 @@ COMPASS CHANGELOG * Make it easier to disable the asset cache buster: `asset_cache_buster :none` * Can now set `$padding` to `false` to make the `horizontal-list` mixin skip the padding properties. +* It is now possible to disable support for legacy IE browsers. + See [the docs](/docs/reference/compass/support/) for more information. 0.10.5 (08/29/2010) ------------------- diff --git a/doc-src/content/reference/compass/support.haml b/doc-src/content/reference/compass/support.haml new file mode 100644 index 00000000..f224af13 --- /dev/null +++ b/doc-src/content/reference/compass/support.haml @@ -0,0 +1,17 @@ +--- +title: Compass Cross-Browser Support Configuration +crumb: Browser Support +framework: compass +stylesheet: compass/_support.scss +classnames: + - reference + - core + - support +meta_description: Provides configuration options for the Compass Browser Support Matrix. +layout: core +nav_stylesheet: _compass.scss +--- +- render 'reference' do + %p + You can configure the compass default browser support matrix by + setting these variables as needed. diff --git a/doc-src/content/stylesheets/screen.sass b/doc-src/content/stylesheets/screen.sass index 7c0b13ed..e6b43054 100644 --- a/doc-src/content/stylesheets/screen.sass +++ b/doc-src/content/stylesheets/screen.sass @@ -1,7 +1,7 @@ /* Welcome to Susy. Use this file to define screen styles. * Import this file using the following HTML or equivalent: * - +@charset "UTF-8" @import defaults @import slideshow @import shared @@ -213,6 +213,8 @@ aside[role="sidebar"] + article margin-right: 1.5em &:first-child +alpha + a.selected:before + content: "▸" + #page +leader(1.5) diff --git a/doc-src/layouts/simple_core.scss b/doc-src/layouts/simple_core.scss new file mode 100644 index 00000000..cca0d610 --- /dev/null +++ b/doc-src/layouts/simple_core.scss @@ -0,0 +1,7 @@ +- render 'main' do + - content_for :module_nav do + %ul= item_tree(reference_item(:stylesheet => "compass.scss"), :depth => 1, :omit_self => true, :headings => false) + %aside(role="sidebar") + %nav#local-nav + = item_tree(reference_item(:stylesheet => (@item[:nav_stylesheet] || @default_stylesheet)), :depth => 2, :omit_self => get_var(:omit_self){false}, :heading_level => get_var(:heading_level){1}) + %article= yield \ No newline at end of file diff --git a/doc-src/lib/stylesheets.rb b/doc-src/lib/stylesheets.rb index 69348aa6..113baa20 100644 --- a/doc-src/lib/stylesheets.rb +++ b/doc-src/lib/stylesheets.rb @@ -136,7 +136,7 @@ def constants(item) comment = nil end end - constants + constants.reject{|c| c.comment =~ /@private/} end def all_constants diff --git a/frameworks/compass/stylesheets/compass/_support.scss b/frameworks/compass/stylesheets/compass/_support.scss index d98bd60b..ec87aeaf 100644 --- a/frameworks/compass/stylesheets/compass/_support.scss +++ b/frameworks/compass/stylesheets/compass/_support.scss @@ -7,12 +7,11 @@ $legacy-support-for-ie6: $legacy-support-for-ie !default; // Setting this to false will result in smaller output, but no support for ie7 $legacy-support-for-ie7: $legacy-support-for-ie !default; -// @doc off +// @private // The user can simply set $legacy-support-for-ie and 6 & 7 will be set accordingly, // But in case the user set either of those explicitly, we need to sync the value of // this combined variable. $legacy-support-for-ie: $legacy-support-for-ie6 or $legacy-support-for-ie7; -// @doc on // Support for mozilla in experimental css3 properties. $experimental-support-for-mozilla : true !default; From 3501a376088202672d45dd5fc680493a7ec6f2e9 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Mon, 11 Oct 2010 04:28:08 -0700 Subject: [PATCH 06/36] version bump --- VERSION.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION.yml b/VERSION.yml index 64fb2b97..3ec55edd 100644 --- a/VERSION.yml +++ b/VERSION.yml @@ -1,5 +1,5 @@ --- :major: 0 :minor: 10 -:patch: 5 -#:build: pre.1 +:patch: 6 +:build: pre.1 From 67da3ee8090ddb258f7bd7afc3a55c2fc3a0d785 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Tue, 12 Oct 2010 02:30:55 -0700 Subject: [PATCH 07/36] Start documentation on how to contribute to compass. --- doc-src/content/CONTRIBUTING.markdown | 159 ++++++++++++++++++++++++++ 1 file changed, 159 insertions(+) create mode 100644 doc-src/content/CONTRIBUTING.markdown diff --git a/doc-src/content/CONTRIBUTING.markdown b/doc-src/content/CONTRIBUTING.markdown new file mode 100644 index 00000000..a3ecbda9 --- /dev/null +++ b/doc-src/content/CONTRIBUTING.markdown @@ -0,0 +1,159 @@ +Contributing to Compass +======================= + +Thank you for your interest in contributing to Compass. Our goal is to make it as easy +as we can for you to contribute changes to compass -- So if there's something here that +seems harder than it aught to be, please let us know. + +Step 1: If you do not have a github account, create one. +Step 2: Fork Compass to your account. + +Now we're at a decision point. What kind of change do you intend to make? + +* [Fix a typo (or some other trivial change)](#trivial-changes) +* [Documentation Changes](#documentation-changes) +* [Stylesheet Changes](#stylesheet-changes) +* [Ruby Changes](#ruby-changes) + +Here's some general information about the project you might find useful along the way: + +* [Submitting Patches](#patches) +* [Project Structure](#project-structure) +* [Project Architecture](#project-architecture) + * [Command Line](#cli-architecture) + * [Extensions](#extensions-architecture) + * [Configuration](#configuration-architecture) +* [General Philosophy](#project-philosophy) +* [Stylesheet Conventions](#api-conventions) +* [In Case of Emergency](#faq) + +

Making Trivial Changes

+ +Thanks to Github, making small changes is super easy. After forking the project navigate +to the file you want to change and click the edit link. Change the file, write a commit +message, and click the `Commit` button. Now you need to get your change [accepted](#patches). + +

Making Documentation Changes

+ +The compass documentation is stored in two places. First, the doc-src directory is +where the documentation lives -- however much of the documentation is generated +from comments in the Sass files themselves. More information on [changing +documentation][documentation]. Once your changes are pushed, you can +[submit them](#patches). + +

Making Stylesheet Changes

+ +TODO + +

Making Ruby Changes

+ +TODO + +

Submitting Patches

+ +It is a good idea to discuss new features ideas with the compass users and developers +before building something. Please don't by shy; send an email to the [compass mailing +list](http://groups.google.com/group/compass-users). + +If you are submitting features that have more than one changeset, please create a topic +branch to hold the changes while they are pending merge and also to track iterations to +the original submission. To create a topic branch: + + $ git checkout -b new_branch_name + ... make more commits if needed ... + $ git push origin new_branch_name + +You can now see these changes online at a url like: + + http://github.com/your_user_name/compass/commits/new_branch_name + +If you have single-commit patches, it is fine to keep them on master. But do keep in +mind that these changesets might be +[cherry-picked](#recovering-from-rebased-or-cherry-picked-changesets). + +Once your changeset(s) are on github, select the appropriate branch containing your +changes and send a pull request. Most of the description of your changes should be +in the commit messages -- so no need to write a whole lot in the pull request message. +However, the pull request message is a good place to provide a rationale or use case +for the change if you think one is needed. More info on [pull requests][pulls]. + +Pull requests are then managed like an issue from the [compass issues page][issues]. +A code review will be performed by a compass core team member, and one of three outcomes +will result: + +1. The change is rejected -- Not all changes are right for [compass's + philosophy](#project-philosophy). If your change is rejected it might be better + suited for a plugin, at least until it matures and/or proves itself with the users. +2. The change is rejected, unless -- Sometimes, there are missing pieces, or + other changes that need to be made before the change can be accepted. Comments + will be left on the commits indicating what issues need to be addressed. +3. The change is accepted -- The change is merged into compass, sometimes minor + changes are then applied by the committer after the merge. + +

Project Structure

+ +TODO + +

Project Architecture

+ +TODO + +

Command Line

+ +TODO + +

Extensions

+ +TODO + +

Configuration

+ +TODO + +

General Philosophy

+ +TODO + +

Stylesheet Conventions

+ +TODO + +

Common Problems/Misc

+ +

Setting up Git

+ +Please follow [these instructions](http://help.github.com/git-email-settings/) +to set up your email address and attribution information. + +Download your git repo: + + git clone git@github.com:your_username/compass.git + +Set up a remote to the main repo: + + cd compass + git remote add chriseppstein git://github.com/chriseppstein/compass.git + +Getting recent changes from the main repo: + + git fetch chriseppstein + +

You cherry-picked/rebased +my changes. What should I do?

+Depending on any number of reasons, including but not limited to the alignment of the stars, +Your changes might not be merged into compass using a simple merge. For instance, we might +decide to place a change against master into stable instead, or we might squish all your +changes together into a single commit at the time of merge, or we might want a change you've +submitted but not a change that it was placed onto top of. In these cases, there are +a couple of ways you can react: + +1. If you have some changes on a branch that were not yet accepted, but other changes on that + branch were accepted then you should run the following command (make sure to fetch first): + `git checkout branch_name; git rebase chriseppstein/master` (assuming the change was applied + to the master branch) +2. If all your changes on the topic branch were accepted or you don't care to keep it around + anymore: `git checkout master; git branch -D branch_name; git push origin :branch_name` + +[pulls]: http://help.github.com/pull-requests/ +[issues]: http://github.com/chriseppstein/compass/issues +[documentation]: http://github.com/chriseppstein/compass/blob/stable/doc-src/README.markdown \ No newline at end of file From fab2436c1e59d61b41f1641af12d73cffbb1b2d9 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Wed, 13 Oct 2010 23:15:16 -0700 Subject: [PATCH 08/36] update contribution howto --- doc-src/content/CONTRIBUTING.markdown | 147 +++++++++++++++++++++++--- 1 file changed, 131 insertions(+), 16 deletions(-) diff --git a/doc-src/content/CONTRIBUTING.markdown b/doc-src/content/CONTRIBUTING.markdown index a3ecbda9..fc2c203d 100644 --- a/doc-src/content/CONTRIBUTING.markdown +++ b/doc-src/content/CONTRIBUTING.markdown @@ -6,13 +6,16 @@ as we can for you to contribute changes to compass -- So if there's something he seems harder than it aught to be, please let us know. Step 1: If you do not have a github account, create one. -Step 2: Fork Compass to your account. + +Step 2: Fork Compass to your account. Go to the [main repo](http://github.com/chriseppstein/compass) +and click the fork button. Now we're at a decision point. What kind of change do you intend to make? * [Fix a typo (or some other trivial change)](#trivial-changes) * [Documentation Changes](#documentation-changes) -* [Stylesheet Changes](#stylesheet-changes) +* [Fixing Stylesheet Bugs](#stylesheet-bugs) +* [New Stylesheet Features](#stylesheet-changes) * [Ruby Changes](#ruby-changes) Here's some general information about the project you might find useful along the way: @@ -25,7 +28,11 @@ Here's some general information about the project you might find useful along th * [Configuration](#configuration-architecture) * [General Philosophy](#project-philosophy) * [Stylesheet Conventions](#api-conventions) -* [In Case of Emergency](#faq) +* [Miscellaneous Stuff](#faq) + * [Setting up Git](#setting-up-git) + * [Using Compass while Under Development](#running-local-code) + * [Running Tests](#running-tests) + * [Recovering from a cherry-pick or a rebase](#recovering-from-rebased-or-cherry-picked-changesets)

Making Trivial Changes

@@ -35,15 +42,43 @@ message, and click the `Commit` button. Now you need to get your change [accepte

Making Documentation Changes

-The compass documentation is stored in two places. First, the doc-src directory is +The compass documentation is stored in two places. First, the `doc-src` directory is where the documentation lives -- however much of the documentation is generated from comments in the Sass files themselves. More information on [changing -documentation][documentation]. Once your changes are pushed, you can +documentation][documentation]. Once your changes are pushed, please [submit them](#patches). +

Fixing Stylesheet Bugs

+ +Step 3: If this is a bug you discovered. Please [report it][issues] before working on a fix. +This helps us better understand the patch. + +Step 4: Get [the code](#setting-up-git) if you haven't yet done so. + +Step 5: Fix the bug. + +Step 6: Verify the fix in as many browsers as you can as well as against your own +project. How to [use compass while changing it](#running-local-code). + +Step 7: Make sure the tests pass. More info on [running tests](#running-tests) +If the tests fail, fix the tests or the stylesheets accordingly. If the tests, don't +fail, that means this aspect was not well enough tested. Please [add or augment +a test](#writing-tests). + +You're done. Please [submit your changes](#patches) +

Making Stylesheet Changes

-TODO +Step 3: Get [the code](#setting-up-git) if you haven't yet done so. + +Step 4: Add the feature -- contact the mailing list if you have any questions. + +Step 5: Add a test case. More info on [writing tests for compass](#writing-tests). + +Step 6: Documentation - Add or update the reference documentation. Add +an example of using the feature. See the [doc readme for details][documentation]. + +You're done. Please [submit your changes](#patches)

Making Ruby Changes

@@ -55,9 +90,9 @@ It is a good idea to discuss new features ideas with the compass users and devel before building something. Please don't by shy; send an email to the [compass mailing list](http://groups.google.com/group/compass-users). -If you are submitting features that have more than one changeset, please create a topic -branch to hold the changes while they are pending merge and also to track iterations to -the original submission. To create a topic branch: +If you are submitting features that have more than one changeset, please create a +topic branch to hold the changes while they are pending merge and also to track +iterations to the original submission. To create a topic branch: $ git checkout -b new_branch_name ... make more commits if needed ... @@ -72,10 +107,12 @@ mind that these changesets might be [cherry-picked](#recovering-from-rebased-or-cherry-picked-changesets). Once your changeset(s) are on github, select the appropriate branch containing your -changes and send a pull request. Most of the description of your changes should be -in the commit messages -- so no need to write a whole lot in the pull request message. -However, the pull request message is a good place to provide a rationale or use case -for the change if you think one is needed. More info on [pull requests][pulls]. +changes and send a pull request. Make sure to choose the same upstream branch that +you developed against (probably stable or master). Most of the description of your +changes should be in the commit messages -- so no need to write a whole lot in the +pull request message. However, the pull request message is a good place to provide a +rationale or use case for the change if you think one is needed. More info on [pull +requests][pulls]. Pull requests are then managed like an issue from the [compass issues page][issues]. A code review will be performed by a compass core team member, and one of three outcomes @@ -92,7 +129,33 @@ will result:

Project Structure

-TODO + compass/ + bin/ + compass - CLI executable + devbin/ - development scripts after installing the bundle + doc-src/ - source for documentation + docs/ - generated documentation + examples/ - fully working compass projects that you can explore + features/ - tests for compass + frameworks/ - All frameworks in this directory are loaded automatically + compass/ - The compass framework + stylesheets/ - The compass libraries + templates/ - The compass project templates and patterns + blueprint/ + stylesheets/ - The blueprint libraries + templates/ - The blueprint project templates and patterns + lib/ + compass.rb - The main compass ruby library + compass/ + app_integration/ - integration with app frameworks + commands/ - UI agnostic support for the CLI + configuration/ - support for project configuration + exec/ - UI code for the CLI + installers/ - support for installing templates + sass_extensions/ - enhancements to Sass + functions/ - Sass functions exposed by compass + monkey_patches/ - Changes to sass itself + test/ - unit tests

Project Architecture

@@ -112,7 +175,14 @@ TODO

General Philosophy

-TODO +1. Users specify their own selectors. Compass never forces a user + to use a presentational class name. +2. Compass frameworks are not special. If compass can do it, so should an extension + be able. +3. Sass is awesome -- Compass should make sass more accessible and + demonstrate how to use Sass to it's fullest potential. +4. Developing across browsers is hard and will always be hard. It takes + a community to get it right.

Stylesheet Conventions

@@ -138,6 +208,50 @@ Getting recent changes from the main repo: git fetch chriseppstein +

Using Compass while Under Development

+ +1. Use the bin script. `$PROJECT_ROOT/bin/compass` is a version of the compass + command line that uses the local changes you have made. You can add `$PROJECT_ROOT/bin` + to your `$PATH`, or refer to it directly. +2. Build and install a gem: + 1. Edit VERSION.yml and add a build indicator like so (**Do not commit this change**): + + --- + :major: 0 + :minor: 10 + :patch: 6 + :build: something-uniq-to-me.1 + + + 2. `gem build compass.gemspec` + 3. `gem install compass-0.10.6.something-uniq-to-me.1.gem` -- If installing to your + system gems, you'll probably need to add `sudo` to the front. If you don't know + what that means, you probably need to add `sudo` to the front. +3. In a [bundled][bundler] environment, you can configure your gem to use compass + while you work on it like so: + + gem 'compass', :path => "/Users/myusername/some/path/to/compass" + + Bundler will perform some sort of charm on ruby to make it work. +4. Configuring ruby directly. If you're a ruby pro, you probably don't need to be + told that you can set compass on the load path like so: + + export RUBYLIB=/Users/myusername/some/path/to/compass/lib + +

Running Tests

+ +1. Install development dependencies: + + bundle install --binstubs devbin + +2. Running core library and stylesheet tests: + + rake run_tests + +3. Running behavior tests + + ./devbin/cucumber +

You cherry-picked/rebased my changes. What should I do?

Depending on any number of reasons, including but not limited to the alignment of the stars, @@ -156,4 +270,5 @@ a couple of ways you can react: [pulls]: http://help.github.com/pull-requests/ [issues]: http://github.com/chriseppstein/compass/issues -[documentation]: http://github.com/chriseppstein/compass/blob/stable/doc-src/README.markdown \ No newline at end of file +[documentation]: http://github.com/chriseppstein/compass/blob/stable/doc-src/README.markdown +[bundler]: http://gembundler.com/ \ No newline at end of file From 1cd73f4132e247d2f2fc5b6eecfd6cd8985b4097 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Thu, 14 Oct 2010 18:04:13 -0700 Subject: [PATCH 09/36] more contribution updates. --- doc-src/content/CONTRIBUTING.markdown | 92 ++++++++++++++++++--------- 1 file changed, 63 insertions(+), 29 deletions(-) diff --git a/doc-src/content/CONTRIBUTING.markdown b/doc-src/content/CONTRIBUTING.markdown index fc2c203d..7727d24a 100644 --- a/doc-src/content/CONTRIBUTING.markdown +++ b/doc-src/content/CONTRIBUTING.markdown @@ -5,9 +5,12 @@ Thank you for your interest in contributing to Compass. Our goal is to make it a as we can for you to contribute changes to compass -- So if there's something here that seems harder than it aught to be, please let us know. -Step 1: If you do not have a github account, create one. +If you find a bug **in this document**, you are bound to contribute a fix. Stop reading now +if you do not wish to abide by this rool. -Step 2: Fork Compass to your account. Go to the [main repo](http://github.com/chriseppstein/compass) +**Step 1**: If you do not have a github account, create one. + +**Step 2**: Fork Compass to your account. Go to the [main repo](http://github.com/chriseppstein/compass) and click the fork button. Now we're at a decision point. What kind of change do you intend to make? @@ -27,7 +30,7 @@ Here's some general information about the project you might find useful along th * [Extensions](#extensions-architecture) * [Configuration](#configuration-architecture) * [General Philosophy](#project-philosophy) -* [Stylesheet Conventions](#api-conventions) +* [Stylesheet Conventions](#stylesheet-conventions) * [Miscellaneous Stuff](#faq) * [Setting up Git](#setting-up-git) * [Using Compass while Under Development](#running-local-code) @@ -50,17 +53,22 @@ documentation][documentation]. Once your changes are pushed, please

Fixing Stylesheet Bugs

-Step 3: If this is a bug you discovered. Please [report it][issues] before working on a fix. +**Step 3**: If this is a bug you discovered. Please [report it][issues] before working on a fix. This helps us better understand the patch. -Step 4: Get [the code](#setting-up-git) if you haven't yet done so. +**Step 4**: Get [the code](#setting-up-git) if you haven't yet done so. -Step 5: Fix the bug. +**Step 5**: Fix the bug and commit the changes. Please make sure to mention the bug +id in your commit message like so: -Step 6: Verify the fix in as many browsers as you can as well as against your own + Fixed the display of the fizzlebuzz in IE6. + + Closes GH-123. + +**Step 6**: Verify the fix in as many browsers as you can as well as against your own project. How to [use compass while changing it](#running-local-code). -Step 7: Make sure the tests pass. More info on [running tests](#running-tests) +**Step 7**: Make sure the tests pass. More info on [running tests](#running-tests) If the tests fail, fix the tests or the stylesheets accordingly. If the tests, don't fail, that means this aspect was not well enough tested. Please [add or augment a test](#writing-tests). @@ -69,13 +77,23 @@ You're done. Please [submit your changes](#patches)

Making Stylesheet Changes

-Step 3: Get [the code](#setting-up-git) if you haven't yet done so. +It is a good idea to discuss new features ideas with the compass users and developers +before building something. Please don't by shy; send an email to the [compass mailing +list](http://groups.google.com/group/compass-users). -Step 4: Add the feature -- contact the mailing list if you have any questions. +Many feature ideas are good but not obviously a good fit for the compass core library. +In these cases, you can and should create a [compass extension][extensions]. Sometimes +this is because the concept does not align with the [compass philosophy](#project-philosophy). +But sometimes it's just because we think the idea needs time to bake. [Documentation on +making extensions.][extensions] -Step 5: Add a test case. More info on [writing tests for compass](#writing-tests). +**Step 3**: Get [the code](#setting-up-git) if you haven't yet done so. -Step 6: Documentation - Add or update the reference documentation. Add +**Step 4**: Add the feature -- contact the mailing list if you have any questions. + +**Step 5**: Add a test case. More info on [writing tests for compass](#writing-tests). + +**Step 6**: Documentation - Add or update the reference documentation. Add an example of using the feature. See the [doc readme for details][documentation]. You're done. Please [submit your changes](#patches) @@ -86,10 +104,6 @@ TODO

Submitting Patches

-It is a good idea to discuss new features ideas with the compass users and developers -before building something. Please don't by shy; send an email to the [compass mailing -list](http://groups.google.com/group/compass-users). - If you are submitting features that have more than one changeset, please create a topic branch to hold the changes while they are pending merge and also to track iterations to the original submission. To create a topic branch: @@ -121,7 +135,7 @@ will result: 1. The change is rejected -- Not all changes are right for [compass's philosophy](#project-philosophy). If your change is rejected it might be better suited for a plugin, at least until it matures and/or proves itself with the users. -2. The change is rejected, unless -- Sometimes, there are missing pieces, or +2. The change is rejected, *unless* -- Sometimes, there are missing pieces, or other changes that need to be made before the change can be accepted. Comments will be left on the commits indicating what issues need to be addressed. 3. The change is accepted -- The change is merged into compass, sometimes minor @@ -177,18 +191,39 @@ TODO 1. Users specify their own selectors. Compass never forces a user to use a presentational class name. -2. Compass frameworks are not special. If compass can do it, so should an extension +2. Compass does not require javascript. It is a CSS framework. +3. Compass core is "design agnostic". This is why compass core has no + grid framework -- grids are not design agnostic. +4. Compass frameworks are not special. If compass can do it, so should an extension be able. -3. Sass is awesome -- Compass should make sass more accessible and +5. Sass is awesome -- Compass should make sass more accessible and demonstrate how to use Sass to it's fullest potential. -4. Developing across browsers is hard and will always be hard. It takes +6. Developing across browsers is hard and will always be hard. It takes a community to get it right. +7. By default, Compass supports as many browsers as it can. Where it can't + it progressively enhances. Where it degrades, the documentation should + make a note. Deviation from this requires an excellent reason. +8. Compass is a proving ground for Sass features. The watcher and color + functions are examples of features that started in Compass and got + moved to Sass. -

Stylesheet Conventions

+

Stylesheet Conventions

-TODO +1. All framework stylesheets are partials. Their filename begin with an underscore. + Otherwise, Sass will create stylesheets directly into the user's CSS directory. +2. Compass imports do not emit styles. There are a few limited exceptions to this like + the resets and base classes for inheritance. +3. Mixins with two-level defaults. Mixins often provide two levels of default + values. The first is a global default that can be overridden once. The second + is a default that can be overridden when the mixin is included. +4. Mixin argument names are part of the public API, make sure they are understandable and not + needlessly truncated or terse. +5. If adding a new folder of stylesheets, add a single stylesheet with the same name that + imports all of the stylesheets in the folder. +6. Try to avoid passing selectors as arguments. This is what mixins are for. -

Common Problems/Misc

+ +

Common Problems & Miscellaneous Info

Setting up Git

@@ -210,19 +245,17 @@ Getting recent changes from the main repo:

Using Compass while Under Development

-1. Use the bin script. `$PROJECT_ROOT/bin/compass` is a version of the compass - command line that uses the local changes you have made. You can add `$PROJECT_ROOT/bin` +1. Use the bin script. `/path/to/compass/bin/compass` is a version of the compass + command line that uses the local changes you have made. You can add `/path/to/compass/bin` to your `$PATH`, or refer to it directly. 2. Build and install a gem: 1. Edit VERSION.yml and add a build indicator like so (**Do not commit this change**): - --- + --- :major: 0 :minor: 10 :patch: 6 :build: something-uniq-to-me.1 - - 2. `gem build compass.gemspec` 3. `gem install compass-0.10.6.something-uniq-to-me.1.gem` -- If installing to your system gems, you'll probably need to add `sudo` to the front. If you don't know @@ -271,4 +304,5 @@ a couple of ways you can react: [pulls]: http://help.github.com/pull-requests/ [issues]: http://github.com/chriseppstein/compass/issues [documentation]: http://github.com/chriseppstein/compass/blob/stable/doc-src/README.markdown -[bundler]: http://gembundler.com/ \ No newline at end of file +[bundler]: http://gembundler.com/ +[extensions]: /docs/tutorials/extensions/ \ No newline at end of file From f274ec9f1ed22bfca036bb81ee4c9f061e2c2226 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Thu, 14 Oct 2010 21:28:51 -0700 Subject: [PATCH 10/36] fix failing test --- .../stylesheets/blueprint/css/single-imports/buttons.css | 6 ++++-- test/fixtures/stylesheets/compass/css/lists.css | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/test/fixtures/stylesheets/blueprint/css/single-imports/buttons.css b/test/fixtures/stylesheets/blueprint/css/single-imports/buttons.css index 353d3b5d..5a9ceacd 100644 --- a/test/fixtures/stylesheets/blueprint/css/single-imports/buttons.css +++ b/test/fixtures/stylesheets/blueprint/css/single-imports/buttons.css @@ -3,7 +3,6 @@ a { -moz-box-orient: vertical; display: inline-block; vertical-align: middle; - *display: inline; *vertical-align: auto; margin: 0.7em 0.5em 0.7em 0; border-width: 1px; @@ -15,6 +14,8 @@ a { text-decoration: none; cursor: pointer; padding: 5px 10px 5px 7px; } + a { + *display: inline; } a img { margin: 0 3px -3px 0 !important; padding: 0; @@ -28,7 +29,6 @@ button { -moz-box-orient: vertical; display: inline-block; vertical-align: middle; - *display: inline; *vertical-align: auto; margin: 0.7em 0.5em 0.7em 0; border-width: 1px; @@ -42,6 +42,8 @@ button { width: auto; overflow: visible; padding: 4px 10px 3px 7px; } + button { + *display: inline; } button img { margin: 0 3px -3px 0 !important; padding: 0; diff --git a/test/fixtures/stylesheets/compass/css/lists.css b/test/fixtures/stylesheets/compass/css/lists.css index 21f53633..1d629b6b 100644 --- a/test/fixtures/stylesheets/compass/css/lists.css +++ b/test/fixtures/stylesheets/compass/css/lists.css @@ -91,9 +91,10 @@ ul.inline-block { -moz-box-orient: vertical; display: inline-block; vertical-align: middle; - *display: inline; *vertical-align: auto; white-space: nowrap; } + ul.inline-block li { + *display: inline; } ul.wide-inline-block { margin: 0; @@ -110,11 +111,12 @@ ul.wide-inline-block { -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.wide-inline-block li { + *display: inline; } ul.inline { list-style-type: none; } From a42ccfb16c46f6897598db37b5bb926e9754e461 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Thu, 14 Oct 2010 21:30:24 -0700 Subject: [PATCH 11/36] info on writing tests and some images. --- doc-src/content/CONTRIBUTING.markdown | 59 ++++++++++++++++++--------- 1 file changed, 40 insertions(+), 19 deletions(-) diff --git a/doc-src/content/CONTRIBUTING.markdown b/doc-src/content/CONTRIBUTING.markdown index 7727d24a..36ecbdfc 100644 --- a/doc-src/content/CONTRIBUTING.markdown +++ b/doc-src/content/CONTRIBUTING.markdown @@ -13,6 +13,8 @@ if you do not wish to abide by this rool. **Step 2**: Fork Compass to your account. Go to the [main repo](http://github.com/chriseppstein/compass) and click the fork button. +![Fork Me](http://img.skitch.com/20101015-n4ssnfyj16e555cnn7wp2pg717.png) + Now we're at a decision point. What kind of change do you intend to make? * [Fix a typo (or some other trivial change)](#trivial-changes) @@ -40,8 +42,15 @@ Here's some general information about the project you might find useful along th

Making Trivial Changes

Thanks to Github, making small changes is super easy. After forking the project navigate -to the file you want to change and click the edit link. Change the file, write a commit -message, and click the `Commit` button. Now you need to get your change [accepted](#patches). +to the file you want to change and click the edit link. + +![Edit Me](http://img.skitch.com/20101015-n2x2iaric7wkey2x7u4fa2m1hj.png) + +Change the file, write a commit message, and click the `Commit` button. + +![Commit Me](http://img.skitch.com/20101015-br74tfwtd1ur428mq4ejt12kfc.png) +Now you need to get your change [accepted](#patches). +

Making Documentation Changes

@@ -100,7 +109,10 @@ You're done. Please [submit your changes](#patches)

Making Ruby Changes

-TODO +At this time, if you're a rubyist who's planning on working on the ruby-side of +things, it's assumed you know how to read code and use standard ruby tools like +rake, gem, bundler, test/unit, cucumber, rspec, etc. If you have any questions, +please ask. No changes will be accepted without accompanying tests.

Submitting Patches

@@ -128,6 +140,8 @@ pull request message. However, the pull request message is a good place to provi rationale or use case for the change if you think one is needed. More info on [pull requests][pulls]. +![Pull Request Example](http://img.skitch.com/20101015-rgfh43yhk7e61fchj9wccne9cq.png) + Pull requests are then managed like an issue from the [compass issues page][issues]. A code review will be performed by a compass core team member, and one of three outcomes will result: @@ -171,22 +185,6 @@ will result: monkey_patches/ - Changes to sass itself test/ - unit tests -

Project Architecture

- -TODO - -

Command Line

- -TODO - -

Extensions

- -TODO - -

Configuration

- -TODO -

General Philosophy

1. Users specify their own selectors. Compass never forces a user @@ -285,6 +283,29 @@ Getting recent changes from the main repo: ./devbin/cucumber +If stylesheet tests fail, the output of the test project is captured in +`test/fixtures/stylesheets//saved/` and the error message will report where +the error was. Here's an example: + +![Stylesheet Test Failure](http://img.skitch.com/20101015-k4t11k8n7xs2r53ftjhrji629d.png) + +

Writing Stylesheet Tests

+ +Compass has stylesheet tests to ensure that each stylesheet compiles, can be imported directly +without any other dependencies and that refactorings that should not affect the output, don't. + +At some point, it would be great to have a test system that verifies that the stylesheets +*work correctly* in various browsers. If you have ideas for how to accomplish this in a sane +way, please let us know. + +In the `test/fixtures/stylesheets` directory, there are a number of compass projects. +The tests work by adding or updating the sass files, running the tests to make sure they fail, +and then changing the expected css output to make the test pass. It is rudimentary, but as +a safety net, it has caught a number of problems that might have been missed otherwise. +If you add a new stylesheet to compass, please make sure to add a new test stylesheet +that only imports the newly added stylesheet and add rules that use the new features in that +stylesheet. +

You cherry-picked/rebased my changes. What should I do?

Depending on any number of reasons, including but not limited to the alignment of the stars, From 92afc6d4261b56336098baf24d7332f75769c3b1 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Wed, 27 Oct 2010 07:59:28 -0700 Subject: [PATCH 12/36] Bump version for release --- VERSION.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION.yml b/VERSION.yml index 3ec55edd..2839e139 100644 --- a/VERSION.yml +++ b/VERSION.yml @@ -2,4 +2,4 @@ :major: 0 :minor: 10 :patch: 6 -:build: pre.1 +#:build: pre.1 From fcef174285560eafbec27cacbec0f370bca96301 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Sat, 30 Oct 2010 09:19:21 -0700 Subject: [PATCH 13/36] update ignores --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index efbcad5a..97d5eb8f 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,5 @@ coverage* docs doc-src/tmp doc-src/.bundle +.bundle +devbin From 81e2836f37de8eaf899993867080732a82a3bf4b Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Sat, 30 Oct 2010 15:37:02 -0700 Subject: [PATCH 14/36] fix some test failures --- features/command_line.feature | 5 ++--- features/step_definitions/command_line_steps.rb | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/features/command_line.feature b/features/command_line.feature index 2aa40397..dbf3db33 100644 --- a/features/command_line.feature +++ b/features/command_line.feature @@ -79,7 +79,6 @@ Feature: Command Line When I initialize a project using: compass init rails --sass-dir app/stylesheets --css-dir public/stylesheets/compiled Then a config file config/compass.rb is reported created Then a config file config/compass.rb is created - And a sass file config/initializers/compass.rb is created And a sass file app/stylesheets/screen.scss is created And a sass file app/stylesheets/print.scss is created And a sass file app/stylesheets/ie.scss is created @@ -268,12 +267,12 @@ Feature: Command Line | 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/lists.scss | 10 | 0 | 0 | 10 | 39 | 123 | | 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 | + | Total.* | 62 | 12 | 0 | 61 | 348 | 987 | @listframeworks Scenario: List frameworks registered with compass diff --git a/features/step_definitions/command_line_steps.rb b/features/step_definitions/command_line_steps.rb index e9209f1f..7da0e42f 100644 --- a/features/step_definitions/command_line_steps.rb +++ b/features/step_definitions/command_line_steps.rb @@ -1,4 +1,3 @@ -require 'spec/expectations' $:.unshift(File.expand_path(File.join(File.dirname(__FILE__), '../../test'))) require 'test_helper' From 03e01c4eb228bdb745a62d117388b37838904bda Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Sat, 30 Oct 2010 15:37:50 -0700 Subject: [PATCH 15/36] Add the ability to print out compass configuration values --- doc-src/content/CHANGELOG.markdown | 5 +++++ features/command_line.feature | 18 ++++++++++++++++++ .../step_definitions/command_line_steps.rb | 7 +++++++ lib/compass/commands/write_configuration.rb | 11 ++++++++++- 4 files changed, 40 insertions(+), 1 deletion(-) diff --git a/doc-src/content/CHANGELOG.markdown b/doc-src/content/CHANGELOG.markdown index 1b831e8a..c9424b74 100644 --- a/doc-src/content/CHANGELOG.markdown +++ b/doc-src/content/CHANGELOG.markdown @@ -7,6 +7,11 @@ layout: article COMPASS CHANGELOG ================= +0.10.7 (UNRELEASED) +------------------- +* compass config -p -- will now print out the configuration value + for that property for the current project + 0.10.6 (10/11/2010) ------------------- diff --git a/features/command_line.feature b/features/command_line.feature index dbf3db33..110b7700 100644 --- a/features/command_line.feature +++ b/features/command_line.feature @@ -247,6 +247,24 @@ Feature: Command Line | sass_dir | sass | | css_dir | assets/css | + @now + Scenario Outline: Print out a configuration value + Given I am using the existing project in test/fixtures/stylesheets/compass + When I run: compass config -p + Then I should see the following output: + And the command exits + + Examples: + | property | value | exit | + | extensions_dir | extensions | normally | + | extensions_path | $PROJECT_PATH/extensions | normally | + | css_dir | tmp | normally | + | css_path | $PROJECT_PATH/tmp | normally | + | sass_dir | sass | normally | + | sass_path | $PROJECT_PATH/sass | normally | + | foobar | ERROR: configuration property 'foobar' does not exist | with a non-zero error code | + + @validator @ignore Scenario: Validate the generated CSS Given I am using the existing project in test/fixtures/stylesheets/compass When I run: compass validate diff --git a/features/step_definitions/command_line_steps.rb b/features/step_definitions/command_line_steps.rb index 7da0e42f..cc0f8e94 100644 --- a/features/step_definitions/command_line_steps.rb +++ b/features/step_definitions/command_line_steps.rb @@ -154,6 +154,9 @@ Then /^the command exits with a non\-zero error code$/ do @last_exit_code.should_not == 0 end +Then /^the command exits normally$/ do + @last_exit_code.should_not =~ 0 +end Then /^I am congratulated$/ do @last_result.should =~ /Congratulations!/ @@ -234,3 +237,7 @@ end Then /^I should see the following lines of output:$/ do |table| table.diff!([['blueprint'],['compass']]) end + +Then /^I should see the following output: (.*)$/ do |output| + (@last_result + @last_error).strip.should == output.gsub(/\$PROJECT_PATH/,Dir.pwd).strip +end diff --git a/lib/compass/commands/write_configuration.rb b/lib/compass/commands/write_configuration.rb index bc7d6988..83035aed 100644 --- a/lib/compass/commands/write_configuration.rb +++ b/lib/compass/commands/write_configuration.rb @@ -20,6 +20,9 @@ module Compass opts.on("--debug [PROPERTY]", "Debug your configuration by printing out details.") do |prop| self.options[:debug] = prop.nil? ? true : prop.to_sym end + opts.on("-p PROPERTY", "--property PROPERTY", "Print out the value of a particular configuration property") do |prop| + self.options[:display] = prop.to_sym + end super end @@ -40,7 +43,13 @@ module Compass end def perform - if options[:debug] + if options[:display] + if Compass.configuration.respond_to?(options[:display]) + puts Compass.configuration.send(options[:display]) + else + raise Compass::Error, "ERROR: configuration property '#{options[:display]}' does not exist" + end + elsif options[:debug] puts "Configuration sources:" c = Compass.configuration while c From a40fce8af1920959a8d7e95d5e5ce7088b2558e9 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Sat, 30 Oct 2010 16:45:25 -0700 Subject: [PATCH 16/36] Bug fix: In webkit, when the last gradient color stop was a percent less than 100%, the intermediate values were being scaled to that value. Closes GH-118. --- doc-src/content/CHANGELOG.markdown | 2 ++ .../sass_extensions/functions/gradient_support.rb | 2 +- test/fixtures/stylesheets/compass/css/gradients.css | 13 +++++++++---- .../stylesheets/compass/sass/gradients.sass | 3 +++ 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/doc-src/content/CHANGELOG.markdown b/doc-src/content/CHANGELOG.markdown index c9424b74..b6b42ae1 100644 --- a/doc-src/content/CHANGELOG.markdown +++ b/doc-src/content/CHANGELOG.markdown @@ -11,6 +11,8 @@ COMPASS CHANGELOG ------------------- * compass config -p -- will now print out the configuration value for that property for the current project +* Bug fix: In webkit, when the last gradient color stop was a percent less than 100%, the + intermediate values were being scaled to that value. 0.10.6 (10/11/2010) ------------------- diff --git a/lib/compass/sass_extensions/functions/gradient_support.rb b/lib/compass/sass_extensions/functions/gradient_support.rb index 90112c04..8f4a4289 100644 --- a/lib/compass/sass_extensions/functions/gradient_support.rb +++ b/lib/compass/sass_extensions/functions/gradient_support.rb @@ -45,7 +45,7 @@ module Compass::SassExtensions::Functions::GradientSupport color_stops = color_list.values.map do |pos| # have to convert absolute units to percentages for use in color stop functions. stop = pos.stop - stop = stop.div(max).times(Sass::Script::Number.new(100,["%"])) if stop.numerator_units == max.numerator_units + stop = stop.div(max).times(Sass::Script::Number.new(100,["%"])) if stop.numerator_units == max.numerator_units && max.numerator_units != ["%"] # Make sure the color stops are specified in the right order. if last_value && last_value.value > stop.value raise Sass::SyntaxError.new("Color stops must be specified in increasing order") diff --git a/test/fixtures/stylesheets/compass/css/gradients.css b/test/fixtures/stylesheets/compass/css/gradients.css index 763fb7fa..7dd758aa 100644 --- a/test/fixtures/stylesheets/compass/css/gradients.css +++ b/test/fixtures/stylesheets/compass/css/gradients.css @@ -40,20 +40,25 @@ 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: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(0%, #dddddd), color-stop(20%, #aaaaaa)); 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: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(40%, #dddddd), color-stop(50%, #aaaaaa)); 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: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(40%, #dddddd), color-stop(45%, #000000), color-stop(50%, #aaaaaa)); background-image: -moz-linear-gradient(top, #dddddd 40%, #000000 45%, #aaaaaa 50%); background-image: linear-gradient(top, #dddddd 40%, #000000 45%, #aaaaaa 50%); } +.linear-12 { + background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(0%, #ffffff), color-stop(33%, #0000ff), color-stop(67%, #000000)); + background-image: -moz-linear-gradient(top, #ffffff 0%, #0000ff 33%, #000000 67%); + background-image: linear-gradient(top, #ffffff 0%, #0000ff 33%, #000000 67%); } + .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%); @@ -90,6 +95,6 @@ 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: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(40%, rgba(255, 255, 255, 0)), color-stop(45%, rgba(255, 127, 127, 0.5)), color-stop(50%, #ffffff)); 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%); } diff --git a/test/fixtures/stylesheets/compass/sass/gradients.sass b/test/fixtures/stylesheets/compass/sass/gradients.sass index 3690c481..9ae631e6 100644 --- a/test/fixtures/stylesheets/compass/sass/gradients.sass +++ b/test/fixtures/stylesheets/compass/sass/gradients.sass @@ -33,6 +33,9 @@ .linear-11 +linear-gradient(color_stops(#dddddd 40%, black, #aaaaaa 50%)) +.linear-12 + +linear-gradient(color-stops(white, blue 33%, black 67%)) + .radial-1 // A default radial gradient: A centered gradient having the shape of the container (aka ellipse) From 4ba6e57106d90de257c2319a7e6461a66ae97135 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Sat, 30 Oct 2010 16:52:11 -0700 Subject: [PATCH 17/36] Change the default Sass directory in standalone projects from src to sass. Closes GH-203 --- doc-src/content/index.haml | 2 +- .../app_integration/stand_alone/configuration_defaults.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc-src/content/index.haml b/doc-src/content/index.haml index 39a201a4..264997e1 100644 --- a/doc-src/content/index.haml +++ b/doc-src/content/index.haml @@ -35,7 +35,7 @@ body_id: home compass watch myproject If you don't have TextMate, substitute the `mate myproject` part with the text - editor of your choice. Edit the `*.scss` files in the `src` directory. + editor of your choice. Edit the `*.scss` files in the `sass` directory. These files are yours and you can change them as you see fit, delete them, make new ones, etc. Compass will automatically compile them into css in the `stylesheets` directory whenever they change. diff --git a/lib/compass/app_integration/stand_alone/configuration_defaults.rb b/lib/compass/app_integration/stand_alone/configuration_defaults.rb index 230aeea1..c55ce77f 100644 --- a/lib/compass/app_integration/stand_alone/configuration_defaults.rb +++ b/lib/compass/app_integration/stand_alone/configuration_defaults.rb @@ -7,7 +7,7 @@ module Compass end def sass_dir_without_default - "src" + "sass" end def javascripts_dir_without_default From a154d2e5cf9a67f8c256748c39e0aa64893ae0f7 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Sat, 30 Oct 2010 17:51:00 -0700 Subject: [PATCH 18/36] A little less noise during installation. --- lib/compass/actions.rb | 2 +- lib/compass/compiler.rb | 1 - lib/compass/installers/base.rb | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/compass/actions.rb b/lib/compass/actions.rb index 878ff68f..93d7a8d5 100644 --- a/lib/compass/actions.rb +++ b/lib/compass/actions.rb @@ -18,7 +18,7 @@ module Compass def directory(dir, options = nil) options ||= self.options if self.respond_to?(:options) if File.exists?(dir) && File.directory?(dir) - logger.record :exists, basename(dir) unless options[:quiet] + # logger.record :exists, basename(dir) unless options[:quiet] elsif File.exists?(dir) msg = "#{basename(dir)} already exists and is not a directory." raise Compass::FilesystemConflict.new(msg) diff --git a/lib/compass/compiler.rb b/lib/compass/compiler.rb index 8971d461..e68610a4 100644 --- a/lib/compass/compiler.rb +++ b/lib/compass/compiler.rb @@ -98,7 +98,6 @@ module Compass # Compile one Sass file def compile(sass_filename, css_filename) - logger.record :compile, basename(sass_filename) unless options[:quiet] css_content = logger.red do engine(sass_filename, css_filename).render end diff --git a/lib/compass/installers/base.rb b/lib/compass/installers/base.rb index 36c23d6d..3bc8d827 100644 --- a/lib/compass/installers/base.rb +++ b/lib/compass/installers/base.rb @@ -84,7 +84,7 @@ module Compass to = targetize(install_location_for_stylesheet(to, options)) contents = File.new(from).read if preferred_syntax.to_s != from[-4..-1] - logger.record :convert, basename(from) + # logger.record :convert, basename(from) tree = Sass::Engine.new(contents, Compass.sass_engine_options.merge(:syntax => from[-4..-1].intern)).to_tree contents = tree.send("to_#{preferred_syntax}") to[-4..-1] = preferred_syntax.to_s From b601fb8d04bceb5e6cec8ee330b3bb70d431a5a8 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Sat, 30 Oct 2010 17:55:30 -0700 Subject: [PATCH 19/36] Pass --no-line-comments to disable line comments. --- doc-src/content/CHANGELOG.markdown | 1 + lib/compass/exec/project_options_parser.rb | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/doc-src/content/CHANGELOG.markdown b/doc-src/content/CHANGELOG.markdown index b6b42ae1..176fb745 100644 --- a/doc-src/content/CHANGELOG.markdown +++ b/doc-src/content/CHANGELOG.markdown @@ -13,6 +13,7 @@ COMPASS CHANGELOG for that property for the current project * Bug fix: In webkit, when the last gradient color stop was a percent less than 100%, the intermediate values were being scaled to that value. +* You can now pass --no-line-comments to the Compass command line to disable line comments. 0.10.6 (10/11/2010) ------------------- diff --git a/lib/compass/exec/project_options_parser.rb b/lib/compass/exec/project_options_parser.rb index 571e200e..e7fbfc54 100644 --- a/lib/compass/exec/project_options_parser.rb +++ b/lib/compass/exec/project_options_parser.rb @@ -49,6 +49,10 @@ module Compass::Exec::ProjectOptionsParser opts.on('--relative-assets', :NONE, 'Make compass asset helpers generate relative urls to assets.') do self.options[:relative_assets] = true end + + opts.on('--no-line-comments', :NONE, 'Disable line comments.') do + self.options[:line_comments] = false + end end end From a03ee6cb8f62e293e8f2577c770b6b158a693901 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Sat, 30 Oct 2010 17:59:08 -0700 Subject: [PATCH 20/36] Make the compass configuration file more self documenting by adding comments for preferred_syntax, output_style, and line_comments. --- doc-src/content/CHANGELOG.markdown | 2 ++ lib/compass/configuration/comments.rb | 35 ++++++++++++++++++++++++++- 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/doc-src/content/CHANGELOG.markdown b/doc-src/content/CHANGELOG.markdown index 176fb745..25793da7 100644 --- a/doc-src/content/CHANGELOG.markdown +++ b/doc-src/content/CHANGELOG.markdown @@ -14,6 +14,8 @@ COMPASS CHANGELOG * Bug fix: In webkit, when the last gradient color stop was a percent less than 100%, the intermediate values were being scaled to that value. * You can now pass --no-line-comments to the Compass command line to disable line comments. +* Make the compass configuration file more self documenting by adding comments for + `preferred_syntax`, `output_style`, and `line_comments`. 0.10.6 (10/11/2010) ------------------- diff --git a/lib/compass/configuration/comments.rb b/lib/compass/configuration/comments.rb index b62f6a92..b48dd900 100644 --- a/lib/compass/configuration/comments.rb +++ b/lib/compass/configuration/comments.rb @@ -8,7 +8,7 @@ module Compass end def comment_for_relative_assets - unless relative_assets + unless top_level.relative_assets %q{# To enable relative paths to assets via compass helper functions. Uncomment: # relative_assets = true } @@ -17,6 +17,39 @@ module Compass end end + def comment_for_line_comments + if top_level.line_comments + %q{# To disable debugging comments that display the original location of your selectors. Uncomment: +# line_comments = false +} + else + "" + end + end + + def comment_for_output_style + unless top_level.output_style_without_default + %Q{# You can select your preferred output style here (can be overridden via the command line): +# output_style = :expanded or :nested or :compact or :compressed +} + else + "" + end + end + + def comment_for_preferred_syntax + if top_level.preferred_syntax == :scss + %Q{ +# If you prefer the indented syntax, you might want to regenerate this +# project again passing --syntax sass, or you can uncomment this: +# preferred_syntax = :sass +# and then run: +# sass-convert -R --from scss --to sass #{top_level.sass_dir} scss && rm -rf sass && mv scss sass +} + else + "" + end + end end end end From 762c6a0b188efda2d4a8575fed64988d97bc6045 Mon Sep 17 00:00:00 2001 From: Jeff Siegel Date: Fri, 29 Oct 2010 02:06:18 -0600 Subject: [PATCH 21/36] IE8 compat for :last-child selector --- doc-src/content/CHANGELOG.markdown | 1 + .../compass/utilities/lists/_horizontal-list.scss | 6 +++++- .../stylesheets/compass/utilities/lists/_inline-list.scss | 8 +++++++- .../stylesheets/compass/utilities/tables/_borders.scss | 8 +++++++- 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/doc-src/content/CHANGELOG.markdown b/doc-src/content/CHANGELOG.markdown index 25793da7..ac55fb8e 100644 --- a/doc-src/content/CHANGELOG.markdown +++ b/doc-src/content/CHANGELOG.markdown @@ -16,6 +16,7 @@ COMPASS CHANGELOG * You can now pass --no-line-comments to the Compass command line to disable line comments. * Make the compass configuration file more self documenting by adding comments for `preferred_syntax`, `output_style`, and `line_comments`. +* Work around IE compatibility issues with the :last-child selector. [Commit](http://github.com/jdsiegel/compass/commit/c1fb764dba9c54cc5d02f2f7de213fb21ac6ca09). 0.10.6 (10/11/2010) ------------------- diff --git a/frameworks/compass/stylesheets/compass/utilities/lists/_horizontal-list.scss b/frameworks/compass/stylesheets/compass/utilities/lists/_horizontal-list.scss index 297e895a..159b6599 100644 --- a/frameworks/compass/stylesheets/compass/utilities/lists/_horizontal-list.scss +++ b/frameworks/compass/stylesheets/compass/utilities/lists/_horizontal-list.scss @@ -31,6 +31,9 @@ // // :last-child is not fully supported // see http://www.quirksmode.org/css/contents.html#t29 for the support matrix +// +// IE8 ignores rules that are included on the same line as :last-child +// see http://www.richardscarrott.co.uk/posts/view/ie8-last-child-bug for details // // Setting `$padding` to `false` disables the padding between list elements @mixin horizontal-list-item($padding: 4px, $direction: left) { @@ -43,7 +46,8 @@ right: $padding; } &:first-child, &.first { padding-#{$direction}: 0; } - &:last-child, &.last { padding-#{opposite-position($direction)}: 0; } + &:last-child { padding-#{opposite-position($direction)}: 0; } + &.last { padding-#{opposite-position($direction)}: 0; } } } diff --git a/frameworks/compass/stylesheets/compass/utilities/lists/_inline-list.scss b/frameworks/compass/stylesheets/compass/utilities/lists/_inline-list.scss index 6a26f1b4..29bc74fc 100644 --- a/frameworks/compass/stylesheets/compass/utilities/lists/_inline-list.scss +++ b/frameworks/compass/stylesheets/compass/utilities/lists/_inline-list.scss @@ -17,12 +17,18 @@ // // `:last-child` is not fully supported. // see quirksmode for the [support matrix](http://www.quirksmode.org/css/contents.html#t29). +// +// IE8 ignores rules that are included on the same line as :last-child +// see http://www.richardscarrott.co.uk/posts/view/ie8-last-child-bug for details @mixin comma-delimited-list { @include inline-list; li { &:after { content: ", "; } - &:last-child, &.last { + &:last-child { + &:after { content: ""; } + } + &.last { &:after { content: ""; } } } diff --git a/frameworks/compass/stylesheets/compass/utilities/tables/_borders.scss b/frameworks/compass/stylesheets/compass/utilities/tables/_borders.scss index 81434d9f..120896dc 100644 --- a/frameworks/compass/stylesheets/compass/utilities/tables/_borders.scss +++ b/frameworks/compass/stylesheets/compass/utilities/tables/_borders.scss @@ -20,8 +20,14 @@ &:last-child, &.last { border-right-width: 0px; } } + +// IE8 ignores rules that are included on the same line as :last-child +// see http://www.richardscarrott.co.uk/posts/view/ie8-last-child-bug for details + tbody, tfoot { - tr:last-child, + tr:last-child { + th, td { + border-bottom-width: 0px; } } tr.last { th, td { border-bottom-width: 0px; } } } } From 3a6481d2d505d83ca5dafdbb71cfab334e5216ca Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Sat, 30 Oct 2010 18:34:49 -0700 Subject: [PATCH 22/36] Support true in addition to the inset keyword for the box-shadow mixin. Closes GH-206 --- examples/css3/src/main.scss | 4 ++++ frameworks/compass/stylesheets/compass/css3/_box-shadow.scss | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/examples/css3/src/main.scss b/examples/css3/src/main.scss index 31acb2cd..5396a0c1 100644 --- a/examples/css3/src/main.scss +++ b/examples/css3/src/main.scss @@ -32,6 +32,10 @@ h1 { margin: 0.5em 0 1em; text-align: center; } } +.inset { + @include box-shadow(darken($border_color, 40), 5px, 5px, 2px, 3px, inset); +} + .gutter { display: block; float: left; diff --git a/frameworks/compass/stylesheets/compass/css3/_box-shadow.scss b/frameworks/compass/stylesheets/compass/css3/_box-shadow.scss index 76b78b91..6d7dcd29 100644 --- a/frameworks/compass/stylesheets/compass/css3/_box-shadow.scss +++ b/frameworks/compass/stylesheets/compass/css3/_box-shadow.scss @@ -36,7 +36,10 @@ $default-box-shadow-inset : false !default; ) { $full : $color $hoff $voff $blur $spread; @if $inset { - $full: $full $inset; + @if not ($inset == true or $inset == inset) { + @warn "$inset expected to be true or the inset keyword. Got #{$inset} instead. The box shadow will be inset." + } + $full: $full inset; } @if $color == none { @include experimental(box-shadow, none, From f3fb895a32fe3b794922cae2b39aab5134248293 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Sat, 30 Oct 2010 21:59:38 -0700 Subject: [PATCH 23/36] Fix broken test cases. --- lib/compass/configuration/comments.rb | 2 +- test/command_line_test.rb | 13 +++++------- test/configuration_test.rb | 20 +++++++++++++++++++ .../stylesheets/compass/css/lists.css | 16 +++++++++++---- 4 files changed, 38 insertions(+), 13 deletions(-) diff --git a/lib/compass/configuration/comments.rb b/lib/compass/configuration/comments.rb index b48dd900..2fede24d 100644 --- a/lib/compass/configuration/comments.rb +++ b/lib/compass/configuration/comments.rb @@ -38,7 +38,7 @@ module Compass end def comment_for_preferred_syntax - if top_level.preferred_syntax == :scss + if top_level.preferred_syntax == :scss && top_level.sass_dir %Q{ # If you prefer the indented syntax, you might want to regenerate this # project again passing --syntax sass, or you can uncomment this: diff --git a/test/command_line_test.rb b/test/command_line_test.rb index a6b9f59e..f71f5700 100644 --- a/test/command_line_test.rb +++ b/test/command_line_test.rb @@ -21,11 +21,10 @@ class CommandLineTest < Test::Unit::TestCase def test_basic_install within_tmp_directory do compass "--boring", "basic" - assert File.exists?("basic/src/screen.scss") + assert File.exists?("basic/sass/screen.scss") assert File.exists?("basic/stylesheets/screen.css") assert_action_performed :directory, "basic/" - assert_action_performed :create, "basic/src/screen.scss" - assert_action_performed :compile, "basic/src/screen.scss" + assert_action_performed :create, "basic/sass/screen.scss" assert_action_performed :create, "basic/stylesheets/screen.css" end end @@ -35,11 +34,10 @@ class CommandLineTest < Test::Unit::TestCase define_method "test_#{framework.name}_installation" do within_tmp_directory do compass *%W(--boring --framework #{framework.name} #{framework.name}_project) - assert File.exists?("#{framework.name}_project/src/screen.scss"), "src/screen.scss is missing. Found: #{Dir.glob("#{framework.name}_project/**/*").join(", ")}" + assert File.exists?("#{framework.name}_project/sass/screen.scss"), "sass/screen.scss is missing. Found: #{Dir.glob("#{framework.name}_project/**/*").join(", ")}" assert File.exists?("#{framework.name}_project/stylesheets/screen.css") assert_action_performed :directory, "#{framework.name}_project/" - assert_action_performed :create, "#{framework.name}_project/src/screen.scss" - assert_action_performed :compile, "#{framework.name}_project/src/screen.scss" + assert_action_performed :create, "#{framework.name}_project/sass/screen.scss" assert_action_performed :create, "#{framework.name}_project/stylesheets/screen.css" end end @@ -51,10 +49,9 @@ class CommandLineTest < Test::Unit::TestCase Dir.chdir "basic" do # basic update with timestamp caching compass "--boring" - assert_action_performed :unchanged, "src/screen.scss" + assert_action_performed :unchanged, "sass/screen.scss" # basic update with force option set compass "--force", "--boring" - assert_action_performed :compile, "src/screen.scss" assert_action_performed :identical, "stylesheets/screen.css" end end diff --git a/test/configuration_test.rb b/test/configuration_test.rb index f8feab4b..4d605089 100644 --- a/test/configuration_test.rb +++ b/test/configuration_test.rb @@ -24,6 +24,14 @@ class ConfigurationTest < Test::Unit::TestCase output_style = :nested # To enable relative paths to assets via compass helper functions. Uncomment: # relative_assets = true + # To disable debugging comments that display the original location of your selectors. Uncomment: + # line_comments = false + + # If you prefer the indented syntax, you might want to regenerate this + # project again passing --syntax sass, or you can uncomment this: + # preferred_syntax = :sass + # and then run: + # sass-convert -R --from scss --to sass sass scss && rm -rf sass && mv scss sass CONFIG Compass.add_configuration(contents, "test_parse") @@ -90,9 +98,13 @@ project_path = "/home/chris/my_compass_project" # Set this to the root of your project when deployed: http_path = "/" css_dir = "css" +# You can select your preferred output style here (can be overridden via the command line): +# output_style = :expanded or :nested or :compact or :compressed # To enable relative paths to assets via compass helper functions. Uncomment: # relative_assets = true additional_import_paths = ["../foo", "/path/to/my/framework"] +# To disable debugging comments that display the original location of your selectors. Uncomment: +# line_comments = false EXPECTED assert_equal "/", Compass.configuration.http_path assert_equal expected_serialization.split("\n"), Compass.configuration.serialize.split("\n") @@ -120,9 +132,13 @@ project_path = "/home/chris/my_compass_project" # Set this to the root of your project when deployed: http_path = "/" css_dir = "css" +# You can select your preferred output style here (can be overridden via the command line): +# output_style = :expanded or :nested or :compact or :compressed # To enable relative paths to assets via compass helper functions. Uncomment: # relative_assets = true additional_import_paths = ["../foo", "/path/to/my/framework"] +# To disable debugging comments that display the original location of your selectors. Uncomment: +# line_comments = false EXPECTED assert_equal "/", Compass.configuration.http_path assert_equal expected_serialization.split("\n"), Compass.configuration.serialize.split("\n") @@ -142,9 +158,13 @@ EXPECTED # Require any additional compass plugins here. # Set this to the root of your project when deployed: http_path = "/" +# You can select your preferred output style here (can be overridden via the command line): +# output_style = :expanded or :nested or :compact or :compressed # To enable relative paths to assets via compass helper functions. Uncomment: # relative_assets = true sass_options = {:foo=>"bar"} +# To disable debugging comments that display the original location of your selectors. Uncomment: +# line_comments = false EXPECTED assert_equal expected_serialization, Compass.configuration.serialize diff --git a/test/fixtures/stylesheets/compass/css/lists.css b/test/fixtures/stylesheets/compass/css/lists.css index 1d629b6b..c31c4732 100644 --- a/test/fixtures/stylesheets/compass/css/lists.css +++ b/test/fixtures/stylesheets/compass/css/lists.css @@ -16,7 +16,9 @@ ul.horizontal { padding-right: 4px; } ul.horizontal li:first-child, ul.horizontal li.first { padding-left: 0; } - ul.horizontal li:last-child, ul.horizontal li.last { + ul.horizontal li:last-child { + padding-right: 0; } + ul.horizontal li.last { padding-right: 0; } ul.wide-horizontal { @@ -37,7 +39,9 @@ ul.wide-horizontal { padding-right: 10px; } ul.wide-horizontal li:first-child, ul.wide-horizontal li.first { padding-left: 0; } - ul.wide-horizontal li:last-child, ul.wide-horizontal li.last { + ul.wide-horizontal li:last-child { + padding-right: 0; } + ul.wide-horizontal li.last { padding-right: 0; } ul.right-horizontal { @@ -58,7 +62,9 @@ ul.right-horizontal { padding-right: 4px; } ul.right-horizontal li:first-child, ul.right-horizontal li.first { padding-right: 0; } - ul.right-horizontal li:last-child, ul.right-horizontal li.last { + ul.right-horizontal li:last-child { + padding-left: 0; } + ul.right-horizontal li.last { padding-left: 0; } ul.no-padding { @@ -133,7 +139,9 @@ ul.comma { display: inline; } ul.comma li:after { content: ", "; } - ul.comma li:last-child:after, ul.comma li.last:after { + ul.comma li:last-child:after { + content: ""; } + ul.comma li.last:after { content: ""; } ul.no-bullets { From c39808c5c910af31cf95f0a3e7751a17b011c7b5 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Sun, 31 Oct 2010 00:29:26 -0700 Subject: [PATCH 24/36] Update to use the new compass validator during development. --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 51a54aea..ca660ecd 100644 --- a/Gemfile +++ b/Gemfile @@ -4,6 +4,6 @@ gem "compass", :path => "." gem "cucumber" gem "rspec" gem "rails", "~>3.0.0.rc" -gem "compass-validator", "1.0.0" +gem "compass-validator", "3.0.0" gem "css_parser" gem "rcov" From 6486693b80a2c5d42cceade9a210dbeb610eadbf Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Sun, 31 Oct 2010 00:32:45 -0700 Subject: [PATCH 25/36] Only colorize the action when logging results. --- lib/compass/logger.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/compass/logger.rb b/lib/compass/logger.rb index 5d77295d..e1be0f55 100644 --- a/lib/compass/logger.rb +++ b/lib/compass/logger.rb @@ -16,7 +16,8 @@ module Compass :exists => :green, :directory => :green, :identical => :green, - :convert => :green + :convert => :green, + :unchanged => :yellow } @@ -32,8 +33,9 @@ module Compass def record(action, *arguments) msg = "" msg << color(ACTION_COLORS[action]) if Compass.configuration.color_output - msg << "#{action_padding(action)}#{action} #{arguments.join(' ')}" + msg << "#{action_padding(action)}#{action}" msg << color(:clear) if Compass.configuration.color_output + msg << " #{arguments.join(' ')}" log msg end From 6c89c5c287e03fc414b3633efcc486c8a739957a Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Sun, 31 Oct 2010 00:36:56 -0700 Subject: [PATCH 26/36] Add a note about the compass validator --- doc-src/content/CHANGELOG.markdown | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc-src/content/CHANGELOG.markdown b/doc-src/content/CHANGELOG.markdown index ac55fb8e..30e0f301 100644 --- a/doc-src/content/CHANGELOG.markdown +++ b/doc-src/content/CHANGELOG.markdown @@ -17,6 +17,9 @@ COMPASS CHANGELOG * Make the compass configuration file more self documenting by adding comments for `preferred_syntax`, `output_style`, and `line_comments`. * Work around IE compatibility issues with the :last-child selector. [Commit](http://github.com/jdsiegel/compass/commit/c1fb764dba9c54cc5d02f2f7de213fb21ac6ca09). +* Compass Validator has been upgraded and fine-tuned. It is now using the "css3" profile + to validate and provides a more consistent UI with other compass commands. To upgrade: + `gem install compass-validator` 0.10.6 (10/11/2010) ------------------- From 55a649fbc5560fa0db65225a9d613d348f16a422 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Sun, 31 Oct 2010 00:37:40 -0700 Subject: [PATCH 27/36] Add a note about the colorization change. --- doc-src/content/CHANGELOG.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/doc-src/content/CHANGELOG.markdown b/doc-src/content/CHANGELOG.markdown index 30e0f301..b43a1e56 100644 --- a/doc-src/content/CHANGELOG.markdown +++ b/doc-src/content/CHANGELOG.markdown @@ -17,6 +17,7 @@ COMPASS CHANGELOG * Make the compass configuration file more self documenting by adding comments for `preferred_syntax`, `output_style`, and `line_comments`. * Work around IE compatibility issues with the :last-child selector. [Commit](http://github.com/jdsiegel/compass/commit/c1fb764dba9c54cc5d02f2f7de213fb21ac6ca09). +* Only the action is colorized in command line output now. * Compass Validator has been upgraded and fine-tuned. It is now using the "css3" profile to validate and provides a more consistent UI with other compass commands. To upgrade: `gem install compass-validator` From 5dea2be6ac53ea77bfc7d458aac2d40afba06fe9 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Sun, 31 Oct 2010 00:55:34 -0700 Subject: [PATCH 28/36] Don't set the display in the box-flex mixin. This makes nested flex boxes annoying. Closes GH-207 --- .../compass/stylesheets/compass/css3/_box.scss | 1 - test/fixtures/stylesheets/compass/css/box.css | 18 ++++++------------ 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/frameworks/compass/stylesheets/compass/css3/_box.scss b/frameworks/compass/stylesheets/compass/css3/_box.scss index 09e14a01..c7c881d1 100644 --- a/frameworks/compass/stylesheets/compass/css3/_box.scss +++ b/frameworks/compass/stylesheets/compass/css3/_box.scss @@ -45,7 +45,6 @@ $default-box-flex: 0 !default; @include experimental(box-flex, $flex, -moz, -webkit, not -o, not -ms, not -khtml, official ); - display: block; } // Default flex group diff --git a/test/fixtures/stylesheets/compass/css/box.css b/test/fixtures/stylesheets/compass/css/box.css index cd8ee5e1..04e234b0 100644 --- a/test/fixtures/stylesheets/compass/css/box.css +++ b/test/fixtures/stylesheets/compass/css/box.css @@ -12,8 +12,7 @@ .hbox > * { -moz-box-flex: 0; -webkit-box-flex: 0; - box-flex: 0; - display: block; } + box-flex: 0; } .vbox { display: -moz-box; @@ -28,14 +27,12 @@ .vbox > * { -moz-box-flex: 0; -webkit-box-flex: 0; - box-flex: 0; - display: block; } + box-flex: 0; } .spacer { -moz-box-flex: 1; -webkit-box-flex: 1; - box-flex: 1; - display: block; } + box-flex: 1; } .reverse { -moz-box-direction: reverse; @@ -45,20 +42,17 @@ .box-flex-0 { -moz-box-flex: 0; -webkit-box-flex: 0; - box-flex: 0; - display: block; } + box-flex: 0; } .box-flex-1 { -moz-box-flex: 1; -webkit-box-flex: 1; - box-flex: 1; - display: block; } + box-flex: 1; } .box-flex-2 { -moz-box-flex: 2; -webkit-box-flex: 2; - box-flex: 2; - display: block; } + box-flex: 2; } .box-flex-group-0 { -moz-box-flex-group: 0; From deef53f4375fab901f3f39fe913861b3713eb335 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Sun, 31 Oct 2010 23:51:17 -0700 Subject: [PATCH 29/36] Move the tutorials to the main nav... I don't think most people see it. --- doc-src/content/stylesheets/screen.sass | 5 ++--- doc-src/content/tutorials/best_practices.markdown | 2 ++ doc-src/layouts/main.haml | 10 ++-------- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/doc-src/content/stylesheets/screen.sass b/doc-src/content/stylesheets/screen.sass index e6b43054..af3e09e3 100644 --- a/doc-src/content/stylesheets/screen.sass +++ b/doc-src/content/stylesheets/screen.sass @@ -57,9 +57,6 @@ footer[role="contentinfo"] background: #cccccc cursor: default -+active-compass-nav("#home,.reference", "/docs/") -+active-compass-nav(".tutorial", "/docs/tutorials/") - #docs-nav +pie-clearfix +leading-border(1px, 0.25) @@ -108,6 +105,8 @@ footer[role="contentinfo"] +active-docs("#home", "/docs/") +active-docs(".core", "/docs/reference/compass/") +active-docs(".blueprint", "/docs/reference/blueprint/") ++active-docs(".tutorial", "/docs/tutorials/") + #version +adjust-font-size-to(14px) diff --git a/doc-src/content/tutorials/best_practices.markdown b/doc-src/content/tutorials/best_practices.markdown index 3b3cbb0e..fb93d4b4 100644 --- a/doc-src/content/tutorials/best_practices.markdown +++ b/doc-src/content/tutorials/best_practices.markdown @@ -2,6 +2,8 @@ title: Best practices crumb: Best practices layout: tutorial +classnames: + - tutorial --- ### Use a Base stylesheet file diff --git a/doc-src/layouts/main.haml b/doc-src/layouts/main.haml index 48ff057d..3de241e0 100644 --- a/doc-src/layouts/main.haml +++ b/doc-src/layouts/main.haml @@ -6,14 +6,6 @@ %div %h1.vcard %a.fn.org.url.uid{:href => "/", :rel => "home"} Compass - %nav#compass-nav - %ul - %li - %a{:href => "/", :rel => "home"} compass - %li - %a{:href => "/docs/"} reference - %li - %a{:href => "/docs/tutorials/"} tutorials %nav#docs-nav{:role => "navigation"} .container %ul @@ -23,6 +15,8 @@ %a{:href => "/docs/reference/compass/"} core %li %a{:href => "/docs/reference/blueprint/"} blueprint + %li + %a{:href => "/docs/tutorials/"} tutorials / %li %a{:href => "/docs/plugins/"} plugins From 99a95e25e028f5ba28f567944266e7b139976c93 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Mon, 1 Nov 2010 00:43:21 -0700 Subject: [PATCH 30/36] Better docs on the grid image command. Closes GH-213. --- doc-src/content/tutorials/command-line.markdown | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/doc-src/content/tutorials/command-line.markdown b/doc-src/content/tutorials/command-line.markdown index 9aa61aaf..76cc5805 100644 --- a/doc-src/content/tutorials/command-line.markdown +++ b/doc-src/content/tutorials/command-line.markdown @@ -76,6 +76,21 @@ Misc commands compass grid-img W+GxH [path/to/grid.png] +Where: +
+
W =
Width of 1 column in pixels.
+
G =
Width of 1 gutter in pixels.
+
H =
Height of the typographic baseline in pixels.
+
+Examples: + + # 40px column, 10px gutter, 20px height at /grid.png + compass grid-img 40+10 + # 40px column, 20px gutter, 28px height at /grid.png + compass grid-img 40+20x28 + # 60px column, 20px gutter, 28px height at images/wide_grid.png + compass grid-img 60+20x28 images/wide_grid.png + ### Enter into a console for testing SassScript in a compass environment. compass interactive From b5943dd45009681de4af383e5490573d66df1e77 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Mon, 1 Nov 2010 00:44:45 -0700 Subject: [PATCH 31/36] add on-page anchors to the command line reference page. --- .../content/tutorials/command-line.markdown | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/doc-src/content/tutorials/command-line.markdown b/doc-src/content/tutorials/command-line.markdown index 76cc5805..f2d7fa42 100644 --- a/doc-src/content/tutorials/command-line.markdown +++ b/doc-src/content/tutorials/command-line.markdown @@ -39,32 +39,37 @@ Extensions Commands Project Commands ---------------- - + ### Create a new compass project compass create path/to/project [--using blueprint] [--sass-dir=sass ...] [--project-type=rails] - + ### Initialize an existing project to work with compass compass init rails path/to/project [--using blueprint] + ### Install a pattern from an extension into a project compass install blueprint/buttons [path/to/project] + ### Compile the project's sass files into css compass compile [path/to/project] + ### Watch the project for changes and compile whenever it does compass watch [path/to/project] + ### Emit a configuration file at the location specified. compass config [path/to/config] [--sass-dir=sass --css-dir=css ...] + ### Validate the generated CSS. compass validate [path/to/project] @@ -72,6 +77,7 @@ Project Commands Misc commands ------------- + ### Generate a background image that can be used to verify grid alignment compass grid-img W+GxH [path/to/grid.png] @@ -91,18 +97,22 @@ Examples: # 60px column, 20px gutter, 28px height at images/wide_grid.png compass grid-img 60+20x28 images/wide_grid.png + ### Enter into a console for testing SassScript in a compass environment. compass interactive + ### Print out statistics about your stylesheets compass stats + ### Emit the version of compass compass version + ### Unpack a framework or extension into your project compass unpack @@ -110,18 +120,22 @@ Examples: Get Help on the Command Line ---------------------------- + ### Get help on compass compass help + ### Get help on an extension compass help extension_name + ### Get help about an extension pattern compass help extension_name/pattern_name + ### Get help about a particular sub command compass help command_name From 45d4a8837bafd17377dbc4dec76c2be742794a78 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Mon, 1 Nov 2010 00:45:45 -0700 Subject: [PATCH 32/36] Move the contributing guide to the tutorials section. --- .../contributing.markdown} | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) rename doc-src/content/{CONTRIBUTING.markdown => tutorials/contributing.markdown} (98%) diff --git a/doc-src/content/CONTRIBUTING.markdown b/doc-src/content/tutorials/contributing.markdown similarity index 98% rename from doc-src/content/CONTRIBUTING.markdown rename to doc-src/content/tutorials/contributing.markdown index 36ecbdfc..f2d75a71 100644 --- a/doc-src/content/CONTRIBUTING.markdown +++ b/doc-src/content/tutorials/contributing.markdown @@ -1,5 +1,12 @@ -Contributing to Compass -======================= +--- +title: Contributing Stylesheets +crumb: Contributing +layout: tutorial +classnames: + - tutorial +--- +Contributing Stylesheets to Compass +=================================== Thank you for your interest in contributing to Compass. Our goal is to make it as easy as we can for you to contribute changes to compass -- So if there's something here that From 46454f8d5af1fb45e38ca68529092d1474b1491e Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Mon, 1 Nov 2010 00:47:06 -0700 Subject: [PATCH 33/36] some todos --- TODO.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/TODO.md b/TODO.md index 14c37fdc..1780590e 100644 --- a/TODO.md +++ b/TODO.md @@ -1,7 +1,9 @@ MUST: * A proper welcome page for blueprint projects (or delete it) +* Rails Integration NICE: * some extension commands * Better help for commands and patterns +* Color Palette extraction and management commands From 66dd1ebfb3dea02b71ca443fb5e7d4b89053b5ce Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Mon, 1 Nov 2010 00:47:21 -0700 Subject: [PATCH 34/36] update the lockfile --- doc-src/Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc-src/Gemfile.lock b/doc-src/Gemfile.lock index d964f896..f61fce41 100644 --- a/doc-src/Gemfile.lock +++ b/doc-src/Gemfile.lock @@ -9,7 +9,7 @@ GIT PATH remote: /Users/chris/Projects/compass specs: - compass (0.10.5) + compass (0.10.6) haml (>= 3.0.4) GEM From 0374d8e2304deca7a10157a2361f2c9ef37d31f3 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Mon, 1 Nov 2010 09:22:09 -0700 Subject: [PATCH 35/36] [CSS3] The box-shadow $spread value now defaults to using the browser default instead of 0. Since the browser default is 0, you shouldn't see any visible change. Set $default-box-shadow-spread to 0 if you prefer the older behavior. --- doc-src/content/CHANGELOG.markdown | 3 +++ frameworks/compass/stylesheets/compass/css3/_box-shadow.scss | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/doc-src/content/CHANGELOG.markdown b/doc-src/content/CHANGELOG.markdown index b43a1e56..e4b3099e 100644 --- a/doc-src/content/CHANGELOG.markdown +++ b/doc-src/content/CHANGELOG.markdown @@ -21,6 +21,9 @@ COMPASS CHANGELOG * Compass Validator has been upgraded and fine-tuned. It is now using the "css3" profile to validate and provides a more consistent UI with other compass commands. To upgrade: `gem install compass-validator` +* [CSS3] The box-shadow `$spread` value now defaults to using the browser default instead of 0. + Set $default-box-shadow-spread to 0 if you prefer the older behavior. Since the browser is supposed + to default to 0, you should see no change except less CSS output. 0.10.6 (10/11/2010) ------------------- diff --git a/frameworks/compass/stylesheets/compass/css3/_box-shadow.scss b/frameworks/compass/stylesheets/compass/css3/_box-shadow.scss index 6d7dcd29..cf111806 100644 --- a/frameworks/compass/stylesheets/compass/css3/_box-shadow.scss +++ b/frameworks/compass/stylesheets/compass/css3/_box-shadow.scss @@ -18,7 +18,7 @@ $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 : false !default; // The default shadow instet: inset or false (for standard shadow). $default-box-shadow-inset : false !default; From af850cae977a3da40c8b74da3d1533bac3797ef3 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Mon, 1 Nov 2010 10:45:19 -0700 Subject: [PATCH 36/36] Tweak the changelog. --- doc-src/content/CHANGELOG.markdown | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/doc-src/content/CHANGELOG.markdown b/doc-src/content/CHANGELOG.markdown index e4b3099e..8eb61f0c 100644 --- a/doc-src/content/CHANGELOG.markdown +++ b/doc-src/content/CHANGELOG.markdown @@ -9,21 +9,25 @@ COMPASS CHANGELOG 0.10.7 (UNRELEASED) ------------------- -* compass config -p -- will now print out the configuration value +* [Command Line] compass config -p -- will now print out the configuration value for that property for the current project -* Bug fix: In webkit, when the last gradient color stop was a percent less than 100%, the - intermediate values were being scaled to that value. -* You can now pass --no-line-comments to the Compass command line to disable line comments. -* Make the compass configuration file more self documenting by adding comments for - `preferred_syntax`, `output_style`, and `line_comments`. -* Work around IE compatibility issues with the :last-child selector. [Commit](http://github.com/jdsiegel/compass/commit/c1fb764dba9c54cc5d02f2f7de213fb21ac6ca09). -* Only the action is colorized in command line output now. -* Compass Validator has been upgraded and fine-tuned. It is now using the "css3" profile - to validate and provides a more consistent UI with other compass commands. To upgrade: - `gem install compass-validator` +* [CSS3] Bug fix: In webkit, when the last gradient color stop was a percent less than 100%, + the intermediate values were being scaled to that value. +* [Command Line] You can now pass --no-line-comments to the Compass command line to disable + line comments. +* [Configuration] Make the compass configuration file more self documenting by adding comments + for `preferred_syntax`, `output_style`, and `line_comments`. +* Work around IE compatibility issues with the :last-child selector. + [Commit](http://github.com/jdsiegel/compass/commit/c1fb764dba9c54cc5d02f2f7de213fb21ac6ca09). +* [Command Line] Only the action is colorized in command line output now. +* [Command Line] Compass Validator has been upgraded and fine-tuned. It is now using the + "css3" profile to validate and provides a more consistent UI with other compass commands. + To upgrade: `gem install compass-validator` * [CSS3] The box-shadow `$spread` value now defaults to using the browser default instead of 0. Set $default-box-shadow-spread to 0 if you prefer the older behavior. Since the browser is supposed to default to 0, you should see no change except less CSS output. +* [CSS3] The output order of the `box-shadow` mixin now matches the W3C specification. + The color and inset values used to be swapped. 0.10.6 (10/11/2010) -------------------