Make WordPress Core


Ignore:
Timestamp:
09/28/2016 07:53:07 PM (8 years ago)
Author:
afercia
Message:

Administration: Improve the usage of the button CSS classes.

Introduces some consistency in the usage of the button CSS classes, fixes the
focus style for accessibility and responsiveness of the buttons.

  • Adds the button class to all primary buttons make them responsive
  • Removes all secondary-button classes and replaces it with button when needed. button-secondary shouldn't be used and exists just for backward compatibility reasons
  • Replaces classes inside submit_button() with a shorthand for some buttons, and use an empty string for the default button class. Passing button is unnecessary
  • Adjusts get_submit_button() to remove empty items

Props iseulde, dimchik, chris_d2d, mhowell, afercia.
Fixes #27314, #37138, #37448.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-theme-install-list-table.php

    r38307 r38672  
    330330            <div class="wp-full-overlay-sidebar">
    331331                <div class="wp-full-overlay-header">
    332                     <a href="#" class="close-full-overlay button-secondary"><?php _e( 'Close' ); ?></a>
     332                    <a href="#" class="close-full-overlay button"><?php _e( 'Close' ); ?></a>
    333333                    <span class="theme-install"></span>
    334334                </div>
     
    337337                </div>
    338338                <div class="wp-full-overlay-footer">
    339                     <button type="button" class="collapse-sidebar button-secondary" aria-expanded="true" aria-label="<?php esc_attr_e( 'Collapse Sidebar' ); ?>">
     339                    <button type="button" class="collapse-sidebar button" aria-expanded="true" aria-label="<?php esc_attr_e( 'Collapse Sidebar' ); ?>">
    340340                        <span class="collapse-sidebar-arrow"></span>
    341341                        <span class="collapse-sidebar-label"><?php _e( 'Collapse' ); ?></span>
     
    399399            switch ( $status ) {
    400400                case 'update_available':
    401                     echo '<a class="theme-install button-primary" href="' . esc_url( wp_nonce_url( $update_url, 'upgrade-theme_' . $theme->slug ) ) . '" title="' . esc_attr( sprintf( __( 'Update to version %s' ), $theme->version ) ) . '">' . __( 'Update' ) . '</a>';
     401                    echo '<a class="theme-install button button-primary" href="' . esc_url( wp_nonce_url( $update_url, 'upgrade-theme_' . $theme->slug ) ) . '" title="' . esc_attr( sprintf( __( 'Update to version %s' ), $theme->version ) ) . '">' . __( 'Update' ) . '</a>';
    402402                    break;
    403403                case 'newer_installed':
     
    407407                case 'install':
    408408                default:
    409                     echo '<a class="theme-install button-primary" href="' . esc_url( wp_nonce_url( $install_url, 'install-theme_' . $theme->slug ) ) . '">' . __( 'Install' ) . '</a>';
     409                    echo '<a class="theme-install button button-primary" href="' . esc_url( wp_nonce_url( $install_url, 'install-theme_' . $theme->slug ) ) . '">' . __( 'Install' ) . '</a>';
    410410                    break;
    411411            } ?>
Note: See TracChangeset for help on using the changeset viewer.