Skip to content

Commit

Permalink
[Sass] Support -moz-calc.
Browse files Browse the repository at this point in the history
  • Loading branch information
nex3 committed Jun 11, 2010
1 parent c2be9b3 commit d5804a9
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
13 changes: 12 additions & 1 deletion doc-src/SASS_CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,21 @@ Any of the following conditions will cause a literal CSS `@import`:

The former two conditions always worked, but the latter two are new.

## `-moz-calc` Support

The new [`-moz-calc()` function](http://hacks.mozilla.org/2010/06/css3-calc/) in Firefox 4
will now be properly parsed by Sass.
`calc()` was already supported, but because the parsing rules are different
than for normal CSS functions, this had to be expanded to include `-moz-calc`.

In anticipation of wider browser support, in fact,
*any* function named `-*-calc` (such as `-webkit-calc` or `-ms-calc`)
will be parsed the same as the `calc` function.

## Rails 3 Support

Support for Rails 3 versions prior to beta 4 has been removed.
Upgrade to Rails 3.0.0.beta4 if you haven't already.
Upg rade to Rails 3.0.0.beta4 if you haven't already.

## 3.0.12

Expand Down
2 changes: 1 addition & 1 deletion lib/sass/script/lexer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ def bool
end

def special_fun
return unless str1 = scan(/(calc|expression|progid:[a-z\.]*)\(/i)
return unless str1 = scan(/((-[\w-]+-)?calc|expression|progid:[a-z\.]*)\(/i)
str2, _ = Haml::Shared.balance(@scanner, ?(, ?), 1)
c = str2.count("\n")
old_line = @line
Expand Down
5 changes: 4 additions & 1 deletion test/sass/scss/css_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,10 @@ def test_expression_function
def test_calc_function
assert_parses <<SCSS
foo {
a: 12px calc(100%/3 - 2*1em - 2*1px); }
a: 12px calc(100%/3 - 2*1em - 2*1px);
b: 12px -moz-calc(100%/3 - 2*1em - 2*1px);
b: 12px -webkit-calc(100%/3 - 2*1em - 2*1px);
b: 12px -foobar-calc(100%/3 - 2*1em - 2*1px); }
SCSS
end

Expand Down

0 comments on commit d5804a9

Please sign in to comment.