Sha256: 3d9d90b8d1fa7d94260331884a4f78c01b0fdb48d11f3dd03db87e091641e9e7

Contents?: true

Size: 517 Bytes

Versions: 25

Compression:

Stored size: 517 Bytes

Contents

# frozen_string_literal: true
module ThemeCheck
  class DeprecateBgsizes < HtmlCheck
    severity :suggestion
    category :html, :performance
    doc docs_url(__FILE__)

    def on_div(node)
      class_list = node.attributes["class"]&.split(" ")
      add_offense("Use the native loading=\"lazy\" attribute instead of lazysizes", node: node) if class_list&.include?("lazyload")
      add_offense("Use the CSS imageset attribute instead of data-bgset", node: node) if node.attributes["data-bgset"]
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
theme-check-1.15.0 lib/theme_check/checks/deprecate_bgsizes.rb
theme-check-1.14.0 lib/theme_check/checks/deprecate_bgsizes.rb
theme-check-1.13.0 lib/theme_check/checks/deprecate_bgsizes.rb
theme-check-1.12.1 lib/theme_check/checks/deprecate_bgsizes.rb
theme-check-1.12.0 lib/theme_check/checks/deprecate_bgsizes.rb
theme-check-1.11.0 lib/theme_check/checks/deprecate_bgsizes.rb
theme-check-1.10.3 lib/theme_check/checks/deprecate_bgsizes.rb
theme-check-1.10.2 lib/theme_check/checks/deprecate_bgsizes.rb
theme-check-1.10.1 lib/theme_check/checks/deprecate_bgsizes.rb
theme-check-1.10.0 lib/theme_check/checks/deprecate_bgsizes.rb
theme-check-1.9.2 lib/theme_check/checks/deprecate_bgsizes.rb
theme-check-1.9.1 lib/theme_check/checks/deprecate_bgsizes.rb
theme-check-1.9.0 lib/theme_check/checks/deprecate_bgsizes.rb
theme-check-1.8.0 lib/theme_check/checks/deprecate_bgsizes.rb
theme-check-1.7.2 lib/theme_check/checks/deprecate_bgsizes.rb
theme-check-1.7.1 lib/theme_check/checks/deprecate_bgsizes.rb
theme-check-1.7.0 lib/theme_check/checks/deprecate_bgsizes.rb
theme-check-1.6.2 lib/theme_check/checks/deprecate_bgsizes.rb
theme-check-1.6.1 lib/theme_check/checks/deprecate_bgsizes.rb
theme-check-1.6.0 lib/theme_check/checks/deprecate_bgsizes.rb