def switch_theme(root_element, theme)
      old_map = @mapping
      new_map = map(theme)

      root_element.each_child do |e|
        old_classes = css_classes_for_map e.class.name, old_map
        new_classes = css_classes_for_map e.class.name, new_map
        update_element_css_classes(e, old_classes, new_classes)

        old_classes = css_classes_for_map e.class.superclass.name, old_map
        new_classes = css_classes_for_map e.class.superclass.name, new_map
        update_element_css_classes(e, old_classes, new_classes)
      end

      @mapping = new_map
    end
def switch_theme(root_element, theme)
      old_map = @mapping
      new_map = map(theme)

      root_element.each_child do |e|
        old_classes = css_classes_for_map e.class.name, old_map
        new_classes = css_classes_for_map e.class.name, new_map
        update_element_css_classes(e, old_classes, new_classes)

        old_classes = css_classes_for_map e.class.superclass.name, old_map
        new_classes = css_classes_for_map e.class.superclass.name, new_map
        update_element_css_classes(e, old_classes, new_classes)
      end

      @mapping = new_map
    end
Internal method to switch to a new theme.