Sha256: 4968b6472573eb4db14c459b62688804bab65cd69c6b7833146d0e5e9ade5302

Contents?: true

Size: 654 Bytes

Versions: 8

Compression:

Stored size: 654 Bytes

Contents

# frozen_string_literal: true

module Kitchen
  module Directions
    module BakeFirstElements
      def self.v1(within:)
        selectors = [
          'div.os-problem-container > div.os-table',
          'div.os-problem-container > span[data-type="media"]',
          'div.os-solution-container > div.os-table',
          'div.os-solution-container > span[data-type="media"]'
        ]
        selectors.each do |selector|
          within.search("#{selector}:first-child").each do |problem|
            problem.add_class('first-element')
            problem.parent.add_class('has-first-element')
          end
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
openstax_kitchen-9.1.0 lib/kitchen/directions/bake_first_elements.rb
openstax_kitchen-9.0.0 lib/kitchen/directions/bake_first_elements.rb
openstax_kitchen-8.0.1 lib/kitchen/directions/bake_first_elements.rb
openstax_kitchen-8.0.0 lib/kitchen/directions/bake_first_elements.rb
openstax_kitchen-7.0.0 lib/kitchen/directions/bake_first_elements.rb
openstax_kitchen-6.1.0 lib/kitchen/directions/bake_first_elements.rb
openstax_kitchen-6.0.0 lib/kitchen/directions/bake_first_elements.rb
openstax_kitchen-5.0.0 lib/kitchen/directions/bake_first_elements.rb