1
0
Fork 0
mirror of https://github.com/haml/haml.git synced 2022-11-09 12:33:31 -05:00

[Sass] Support -moz-calc.

This commit is contained in:
Nathan Weizenbaum 2010-06-10 20:04:05 -07:00
parent c2be9b3df9
commit d5804a90f3
3 changed files with 17 additions and 3 deletions

View file

@ -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

View file

@ -292,7 +292,7 @@ MESSAGE
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

View file

@ -382,7 +382,10 @@ SCSS
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