Sha256: 094d1c2065a19f0447483d99ba9c6c8614baa4da893acedbdd94a917d47c32ed

Contents?: true

Size: 382 Bytes

Versions: 1

Compression:

Stored size: 382 Bytes

Contents

module SCSSLint
  class Linter::ColorKeyword < Linter
    include LinterRegistry

    def visit_script_string(node)
      add_lint(node) if color_keyword?(node.value)
    end

    def description
      'Colors should be specified as hexadecimal values, not names'
    end

  private

    def color_keyword?(string)
      !!Sass::Script::Color::COLOR_NAMES[string]
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
scss-lint-0.10.0 lib/scss_lint/linter/color_keyword.rb