less 1.1.10 → 1.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/less.gemspec +2 -2
- data/lib/less/engine/grammar/entity.tt +1 -10
- data/lib/less/engine/grammar/less.tt +14 -5
- data/lib/less/engine/nodes/selector.rb +11 -6
- data/spec/css/css-3.css +1 -0
- data/spec/css/css.css +5 -1
- data/spec/less/css-3.less +4 -0
- data/spec/less/css.less +6 -1
- data/spec/less/import/import-test-c.less +1 -0
- data/spec/less/whitespace.less +3 -0
- metadata +2 -2
    
        data/VERSION
    CHANGED
    
    | @@ -1 +1 @@ | |
| 1 | 
            -
            1.1. | 
| 1 | 
            +
            1.1.11
         | 
    
        data/less.gemspec
    CHANGED
    
    | @@ -2,11 +2,11 @@ | |
| 2 2 |  | 
| 3 3 | 
             
            Gem::Specification.new do |s|
         | 
| 4 4 | 
             
              s.name = %q{less}
         | 
| 5 | 
            -
              s.version = "1.1. | 
| 5 | 
            +
              s.version = "1.1.11"
         | 
| 6 6 |  | 
| 7 7 | 
             
              s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
         | 
| 8 8 | 
             
              s.authors = ["cloudhead"]
         | 
| 9 | 
            -
              s.date = %q{2009- | 
| 9 | 
            +
              s.date = %q{2009-08-01}
         | 
| 10 10 | 
             
              s.default_executable = %q{lessc}
         | 
| 11 11 | 
             
              s.description = %q{LESS is leaner CSS}
         | 
| 12 12 | 
             
              s.email = %q{self@cloudhead.net}
         | 
| @@ -5,7 +5,7 @@ module Less | |
| 5 5 | 
             
                  # Entity: Any whitespace delimited token
         | 
| 6 6 | 
             
                  #
         | 
| 7 7 | 
             
                  rule entity
         | 
| 8 | 
            -
                    function / fonts / keyword / accessor / variable / literal | 
| 8 | 
            +
                    function / fonts / keyword / accessor / variable / literal
         | 
| 9 9 | 
             
                  end
         | 
| 10 10 |  | 
| 11 11 | 
             
                  rule fonts
         | 
| @@ -51,15 +51,6 @@ module Less | |
| 51 51 | 
             
                    }
         | 
| 52 52 | 
             
                  end
         | 
| 53 53 |  | 
| 54 | 
            -
                  # !important
         | 
| 55 | 
            -
                  rule important
         | 
| 56 | 
            -
                    '!important' {
         | 
| 57 | 
            -
                      def build
         | 
| 58 | 
            -
                        Node::Keyword.new(text_value)
         | 
| 59 | 
            -
                      end
         | 
| 60 | 
            -
                    }
         | 
| 61 | 
            -
                  end
         | 
| 62 | 
            -
             | 
| 63 54 | 
             
                  #
         | 
| 64 55 | 
             
                  # `blue`, `small`, `normal` etc.
         | 
| 65 56 | 
             
                  #
         | 
| @@ -41,9 +41,9 @@ module Less | |
| 41 41 | 
             
                end
         | 
| 42 42 |  | 
| 43 43 | 
             
                rule import
         | 
| 44 | 
            -
                  "@import" S url:(string / url) medias? s ';' ws {
         | 
| 44 | 
            +
                  ws "@import" S url:(string / url) medias? s ';' ws {
         | 
| 45 45 | 
             
                    def build env
         | 
| 46 | 
            -
                      path = File.join(env.root.file, url.value)
         | 
| 46 | 
            +
                      path = File.join(env.root.file || Dir.pwd, url.value)
         | 
| 47 47 | 
             
                      path += '.less' unless path =~ /\.(le|c)ss$/
         | 
| 48 48 | 
             
                      if File.exist? path
         | 
| 49 49 | 
             
                        imported = Less::Engine.new(File.new(path)).to_tree
         | 
| @@ -133,13 +133,13 @@ module Less | |
| 133 133 | 
             
                      [expression] + tail.elements.map {|i| [i.operator, i.expression] }.flatten.compact
         | 
| 134 134 | 
             
                    end
         | 
| 135 135 | 
             
                  # Space-delimited expressions
         | 
| 136 | 
            -
                  } / expression tail:(WS expression)* {
         | 
| 136 | 
            +
                  } / expression tail:(WS expression)* i:important? {
         | 
| 137 137 | 
             
                    def build env
         | 
| 138 138 | 
             
                      all.map {|e| e.build(env) if e.respond_to? :build }.compact
         | 
| 139 139 | 
             
                    end
         | 
| 140 140 |  | 
| 141 141 | 
             
                    def all
         | 
| 142 | 
            -
                      [expression] + tail.elements.map {|f| f.expression }
         | 
| 142 | 
            +
                      [expression] + tail.elements.map {|f| f.expression } + [i]
         | 
| 143 143 | 
             
                    end
         | 
| 144 144 | 
             
                  # Catch-all rule
         | 
| 145 145 | 
             
                  } / [-a-zA-Z0-9_%*/.&=:,#+? \[\]()]+ {
         | 
| @@ -160,6 +160,15 @@ module Less | |
| 160 160 | 
             
                    end
         | 
| 161 161 | 
             
                  }
         | 
| 162 162 | 
             
                end
         | 
| 163 | 
            +
                
         | 
| 164 | 
            +
                # !important
         | 
| 165 | 
            +
                rule important
         | 
| 166 | 
            +
                  s '!' s 'important' {
         | 
| 167 | 
            +
                    def build env
         | 
| 168 | 
            +
                      Node::Keyword.new(text_value.strip)
         | 
| 169 | 
            +
                    end
         | 
| 170 | 
            +
                  }
         | 
| 171 | 
            +
                end
         | 
| 163 172 |  | 
| 164 173 | 
             
                #
         | 
| 165 174 | 
             
                # An identifier
         | 
| @@ -207,7 +216,7 @@ module Less | |
| 207 216 | 
             
                end
         | 
| 208 217 |  | 
| 209 218 | 
             
                rule select
         | 
| 210 | 
            -
                  (s [+>~] s / s ':' / S)?
         | 
| 219 | 
            +
                  (s [+>~] s / '::' / s ':' / S)?
         | 
| 211 220 | 
             
                end
         | 
| 212 221 |  | 
| 213 222 | 
             
                # TODO: Merge this with attribute rule
         | 
| @@ -4,11 +4,12 @@ module Less | |
| 4 4 | 
             
                  include Entity
         | 
| 5 5 |  | 
| 6 6 | 
             
                  Selectors = {
         | 
| 7 | 
            -
                    :Descendant | 
| 8 | 
            -
                    :Child | 
| 9 | 
            -
                    :Adjacent | 
| 10 | 
            -
                    : | 
| 11 | 
            -
                    : | 
| 7 | 
            +
                    :Descendant    => '',
         | 
| 8 | 
            +
                    :Child         => '>',
         | 
| 9 | 
            +
                    :Adjacent      => '+',
         | 
| 10 | 
            +
                    :PseudoClass   => ':',
         | 
| 11 | 
            +
                    :PseudoElement => '::',
         | 
| 12 | 
            +
                    :Sibling       => '~'
         | 
| 12 13 | 
             
                  }
         | 
| 13 14 |  | 
| 14 15 | 
             
                  def initialize
         | 
| @@ -32,7 +33,11 @@ module Less | |
| 32 33 | 
             
                  def to_css; " #{self} " end
         | 
| 33 34 | 
             
                end
         | 
| 34 35 |  | 
| 35 | 
            -
                class  | 
| 36 | 
            +
                class PseudoClass < Selector
         | 
| 37 | 
            +
                  def to_css; self end
         | 
| 38 | 
            +
                end
         | 
| 39 | 
            +
                
         | 
| 40 | 
            +
                class PseudoElement < Selector
         | 
| 36 41 | 
             
                  def to_css; self end
         | 
| 37 42 | 
             
                end
         | 
| 38 43 | 
             
              end
         | 
    
        data/spec/css/css-3.css
    CHANGED
    
    
    
        data/spec/css/css.css
    CHANGED
    
    | @@ -40,7 +40,11 @@ h2[title] { font-size: 100%; } | |
| 40 40 | 
             
              display: -moz-inline-stack;
         | 
| 41 41 | 
             
              width: 0.1em;
         | 
| 42 42 | 
             
              background-color: #009998;
         | 
| 43 | 
            -
              color: red !important;
         | 
| 44 43 | 
             
              background-image: url(images/image.jpg);
         | 
| 45 44 | 
             
              background: -webkit-gradient(linear, left top, left bottom, from(red), to(blue));
         | 
| 46 45 | 
             
            }
         | 
| 46 | 
            +
            #important {
         | 
| 47 | 
            +
              color: red !important;
         | 
| 48 | 
            +
              width: 100% !important;
         | 
| 49 | 
            +
              height: 20px ! important;
         | 
| 50 | 
            +
            }
         | 
    
        data/spec/less/css-3.less
    CHANGED
    
    
    
        data/spec/less/css.less
    CHANGED
    
    | @@ -91,9 +91,14 @@ h2[title] { | |
| 91 91 | 
             
              display: -moz-inline-stack;
         | 
| 92 92 | 
             
              width: .1em;
         | 
| 93 93 | 
             
              background-color: #009998;
         | 
| 94 | 
            -
              color: red !important;
         | 
| 95 94 | 
             
              background-image: url(images/image.jpg);
         | 
| 96 95 | 
             
              background: -webkit-gradient(linear, left top, left bottom, from(red), to(blue));
         | 
| 97 96 | 
             
              margin: ;
         | 
| 98 97 | 
             
            }
         | 
| 99 98 |  | 
| 99 | 
            +
            #important {
         | 
| 100 | 
            +
              color: red !important;
         | 
| 101 | 
            +
              width: 100%!important;
         | 
| 102 | 
            +
              height: 20px ! important;
         | 
| 103 | 
            +
            }
         | 
| 104 | 
            +
             | 
    
        data/spec/less/whitespace.less
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification 
         | 
| 2 2 | 
             
            name: less
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version 
         | 
| 4 | 
            -
              version: 1.1. | 
| 4 | 
            +
              version: 1.1.11
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors: 
         | 
| 7 7 | 
             
            - cloudhead
         | 
| @@ -9,7 +9,7 @@ autorequire: | |
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 11 |  | 
| 12 | 
            -
            date: 2009- | 
| 12 | 
            +
            date: 2009-08-01 00:00:00 +02:00
         | 
| 13 13 | 
             
            default_executable: lessc
         | 
| 14 14 | 
             
            dependencies: []
         | 
| 15 15 |  |