sass 3.4.9 → 3.4.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 586156255d3623fed22e16cc8ddf44c6f50931af
4
- data.tar.gz: 4660667253de7af141d348bb68e400801a8c167a
3
+ metadata.gz: 858f856d5dae7313a376b36544bd8362b7c35a1e
4
+ data.tar.gz: 5b3ba1f7bea6c1c1cbb4be0edf313089013ffdf5
5
5
  SHA512:
6
- metadata.gz: b23a97f2c8142ddd09e624e8363fb69901a92e092ca1c645768b407c0be27e6fa74ed4d47a1b175fedcda42fed3e7ea0f15c54161b9e737f2bb39b1d4e71cc77
7
- data.tar.gz: c2b58e2b9be2c58d95310a960d4d27d4834fe2d18f33eebbdafae9e348c35e6550dce359f4d608b571861b0ef0bba827b0017406fb79935e224b5be6d0c03b88
6
+ metadata.gz: cac4a3b38ad8bfc7eb89c2f8c31e3dc48004a9758efdca37166e9b38368eb44e84f9427812934dc92d40b53e163163d40821495b2607e915f46b583b8e79fb57
7
+ data.tar.gz: 41314e4a85cff7ce94850c0644cfde46eafa329042803fb5e5c4c9b042adf5f06bdbb0597a4406bcd0f2eac398610dfa57af9ad1818482aea8add131ff471704
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.4.9
1
+ 3.4.10
@@ -1 +1 @@
1
- 25 November 2014 01:40:45 UTC
1
+ 17 January 2015 03:54:27 UTC
@@ -1397,11 +1397,16 @@ module Sass::Script
1397
1397
  # @return [Sass::Script::Value::String]
1398
1398
  # @raise [ArgumentError] if `$string` isn't a string
1399
1399
  def unquote(string)
1400
- if string.is_a?(Sass::Script::Value::String) && string.type != :identifier
1401
- identifier(string.value)
1402
- else
1403
- string
1400
+ unless string.is_a?(Sass::Script::Value::String)
1401
+ Sass::Util.sass_warn(<<MESSAGE)
1402
+ DEPRECATION WARNING: Passing #{string.to_sass}, a non-string value, to unquote()
1403
+ will be an error in future versions of Sass.
1404
+ MESSAGE
1405
+ return string
1404
1406
  end
1407
+
1408
+ return string if string.type == :identifier
1409
+ identifier(string.value)
1405
1410
  end
1406
1411
  declare :unquote, [:string]
1407
1412
 
@@ -2310,7 +2315,7 @@ module Sass::Script
2310
2315
  # Return a decimal between 0 and 1, inclusive of 0 but not 1.
2311
2316
  # @return [Sass::Script::Value::Number] A decimal value.
2312
2317
  # @overload random($limit)
2313
- # Return an integer between 1 and `$limit`, inclusive of 1 but not `$limit`.
2318
+ # Return an integer between 1 and `$limit`, inclusive of both 1 and `$limit`.
2314
2319
  # @param $limit [Sass::Script::Value::Number] The maximum of the random integer to be
2315
2320
  # returned, a positive integer.
2316
2321
  # @return [Sass::Script::Value::Number] An integer.
@@ -204,7 +204,7 @@ module Sass::Script::Value
204
204
  #
205
205
  # @overload initialize(attrs)
206
206
  # The attributes are specified as a hash. This hash must contain either
207
- # `:hue`, `:saturation`, and `:value` keys, or `:red`, `:green`, and
207
+ # `:hue`, `:saturation`, and `:lightness` keys, or `:red`, `:green`, and
208
208
  # `:blue` keys. It cannot contain both HSL and RGB keys. It may also
209
209
  # optionally contain an `:alpha` key, and a `:representation` key
210
210
  # indicating the original representation of the color that the user wrote
@@ -56,7 +56,7 @@ module Sass::Script::Value
56
56
  return "()" if value.empty?
57
57
 
58
58
  to_sass = lambda do |value|
59
- if value.is_a?(Map) || (value.is_a?(List) && value.separator == :comma)
59
+ if value.is_a?(List) && value.separator == :comma
60
60
  "(#{value.to_sass(opts)})"
61
61
  else
62
62
  value.to_sass(opts)
@@ -20,6 +20,12 @@ module Sass
20
20
  # @return [Script::Tree::Node?]
21
21
  attr_accessor :splat
22
22
 
23
+ # Strips out any vendor prefixes.
24
+ # @return [String] The normalized name of the directive.
25
+ def normalized_name
26
+ @normalized_name ||= name.gsub(/^(?:-[a-zA-Z0-9]+-)?/, '\1')
27
+ end
28
+
23
29
  # @param name [String] The function name
24
30
  # @param args [Array<(Script::Tree::Node, Script::Tree::Node)>]
25
31
  # The arguments for the function.
@@ -275,6 +275,16 @@ class Sass::Tree::Visitors::Perform < Sass::Tree::Visitors::Base
275
275
  # Loads the function into the environment.
276
276
  def visit_function(node)
277
277
  env = Sass::Environment.new(@environment, node.options)
278
+
279
+ if node.normalized_name == 'calc' || node.normalized_name == 'element' ||
280
+ node.name == 'expression' || node.name == 'url'
281
+ Sass::Util.sass_warn <<WARNING
282
+ DEPRECATION WARNING on line #{node.line}#{" of #{node.filename}" if node.filename}:
283
+ Naming a function "#{node.name}" is disallowed and will be an error in future versions of Sass.
284
+ This name conflicts with an existing CSS function with special parse rules.
285
+ WARNING
286
+ end
287
+
278
288
  @environment.set_local_function(node.name,
279
289
  Sass::Callable.new(node.name, node.args, node.splat, env,
280
290
  node.children, !:has_content, "function"))
@@ -885,6 +885,12 @@ WARNING
885
885
  assert_equal('foo', evaluate('unquote("foo")'))
886
886
  assert_equal('foo', evaluate('unquote(foo)'))
887
887
  assert_equal('foo', evaluate('unquote($string: foo)'))
888
+ assert_warning <<MESSAGE do
889
+ DEPRECATION WARNING: Passing blue, a non-string value, to unquote()
890
+ will be an error in future versions of Sass.
891
+ MESSAGE
892
+ assert_equal('blue', evaluate('unquote(blue)'))
893
+ end
888
894
  end
889
895
 
890
896
  def test_quote
@@ -1621,6 +1627,9 @@ SCSS
1621
1627
  assert_equal "null", evaluate("inspect(null)")
1622
1628
  assert_equal "1px null 3px", evaluate("inspect(1px null 3px)")
1623
1629
  assert_equal "(a: 1, b: 2)", evaluate("inspect((a: 1, b: 2))")
1630
+ assert_equal "(a: 1, b: (c: 2))", evaluate("inspect((a: 1, b: (c: 2)))")
1631
+ assert_equal "(a: 1, b: (2, 3))", evaluate("inspect((a: 1, b: (2, 3)))")
1632
+ assert_equal "(a: 1, b: 2 3)", evaluate("inspect((a: 1, b: 2 3))")
1624
1633
  end
1625
1634
 
1626
1635
  def test_random
@@ -1005,6 +1005,76 @@ bar {
1005
1005
  SASS
1006
1006
  end
1007
1007
 
1008
+ def test_disallowed_function_names
1009
+ assert_warning(<<WARNING) {render(<<SCSS)}
1010
+ DEPRECATION WARNING on line 1 of test_disallowed_function_names_inline.scss:
1011
+ Naming a function "calc" is disallowed and will be an error in future versions of Sass.
1012
+ This name conflicts with an existing CSS function with special parse rules.
1013
+ WARNING
1014
+ @function calc() {}
1015
+ SCSS
1016
+
1017
+ assert_warning(<<WARNING) {render(<<SCSS)}
1018
+ DEPRECATION WARNING on line 1 of test_disallowed_function_names_inline.scss:
1019
+ Naming a function "-my-calc" is disallowed and will be an error in future versions of Sass.
1020
+ This name conflicts with an existing CSS function with special parse rules.
1021
+ WARNING
1022
+ @function -my-calc() {}
1023
+ SCSS
1024
+
1025
+ assert_warning(<<WARNING) {render(<<SCSS)}
1026
+ DEPRECATION WARNING on line 1 of test_disallowed_function_names_inline.scss:
1027
+ Naming a function "element" is disallowed and will be an error in future versions of Sass.
1028
+ This name conflicts with an existing CSS function with special parse rules.
1029
+ WARNING
1030
+ @function element() {}
1031
+ SCSS
1032
+
1033
+ assert_warning(<<WARNING) {render(<<SCSS)}
1034
+ DEPRECATION WARNING on line 1 of test_disallowed_function_names_inline.scss:
1035
+ Naming a function "-my-element" is disallowed and will be an error in future versions of Sass.
1036
+ This name conflicts with an existing CSS function with special parse rules.
1037
+ WARNING
1038
+ @function -my-element() {}
1039
+ SCSS
1040
+
1041
+ assert_warning(<<WARNING) {render(<<SCSS)}
1042
+ DEPRECATION WARNING on line 1 of test_disallowed_function_names_inline.scss:
1043
+ Naming a function "expression" is disallowed and will be an error in future versions of Sass.
1044
+ This name conflicts with an existing CSS function with special parse rules.
1045
+ WARNING
1046
+ @function expression() {}
1047
+ SCSS
1048
+
1049
+ assert_warning(<<WARNING) {render(<<SCSS)}
1050
+ DEPRECATION WARNING on line 1 of test_disallowed_function_names_inline.scss:
1051
+ Naming a function "url" is disallowed and will be an error in future versions of Sass.
1052
+ This name conflicts with an existing CSS function with special parse rules.
1053
+ WARNING
1054
+ @function url() {}
1055
+ SCSS
1056
+ end
1057
+
1058
+ def test_allowed_function_names
1059
+ assert_no_warning {assert_equal(<<CSS, render(<<SCSS))}
1060
+ .a {
1061
+ b: c; }
1062
+ CSS
1063
+ @function -my-expression() {@return c}
1064
+
1065
+ .a {b: -my-expression()}
1066
+ SCSS
1067
+
1068
+ assert_no_warning {assert_equal(<<CSS, render(<<SCSS))}
1069
+ .a {
1070
+ b: c; }
1071
+ CSS
1072
+ @function -my-url() {@return c}
1073
+
1074
+ .a {b: -my-url()}
1075
+ SCSS
1076
+ end
1077
+
1008
1078
  ## Var Args
1009
1079
 
1010
1080
  def test_mixin_var_args
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sass
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.4.9
4
+ version: 3.4.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Natalie Weizenbaum
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-11-25 00:00:00.000000000 Z
13
+ date: 2015-01-17 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: yard