Sha256: 878a794a5b971e4cf2bfafe3066f8033a79cab96c5f65a6ca46237049bf80494

Contents?: true

Size: 705 Bytes

Versions: 10

Compression:

Stored size: 705 Bytes

Contents

module Csscss
  module Parser
    module Padding
      extend Parser::Base

      class Parser < Parslet::Parser
        include Common

        rule(:padding_side) {
          length | percent | symbol("inherit")
        }

        rule(:padding) {
          (
           symbol("inherit") >> eof | (
             padding_side.maybe.as(:top)    >>
             padding_side.maybe.as(:right)  >>
             padding_side.maybe.as(:bottom) >>
             padding_side.maybe.as(:left)
           )
          ).as(:padding)
        }
        root(:padding)
      end

      class Transformer < Parslet::Transform
        @property = :padding
        extend MultiSideTransformer
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
csscss-1.3.3 lib/csscss/parser/padding.rb
csscss-1.3.2 lib/csscss/parser/padding.rb
csscss-1.3.1 lib/csscss/parser/padding.rb
csscss-1.3.0 lib/csscss/parser/padding.rb
csscss-1.2.0 lib/csscss/parser/padding.rb
csscss-1.1.0 lib/csscss/parser/padding.rb
csscss-1.0.0 lib/csscss/parser/padding.rb
csscss-0.2.1 lib/csscss/parser/padding.rb
csscss-0.2.0 lib/csscss/parser/padding.rb
csscss-0.1.0 lib/csscss/parser/padding.rb