Class: Browsable::Analyzers::CSS
- Defined in:
- lib/browsable/analyzers/css.rb
Overview
Audits CSS by shelling out to stylelint with the ‘stylelint-no-unsupported-browser-features` plugin configured for the project’s target. browsable supplies the config; stylelint (and its bundled caniuse data) does the actual compatibility reasoning.
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from Browsable::Analyzers::Base
Instance Method Details
#analyze(files) ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/browsable/analyzers/css.rb', line 15 def analyze(files) return [] if files.empty? argv = ["stylelint", "--config", write_stylelintrc, "--formatter", "json", *files] parse(shell_out(argv, dry_run_key: "BROWSABLE_DRY_RUN_CSS")) end |
#required_tools ⇒ Object
13 |
# File 'lib/browsable/analyzers/css.rb', line 13 def required_tools = ["stylelint"] |