Menus: Improve the HTML semantics of the "Menu Settings" section.

- removes the previous markup based on a definition list
- groups checkboxes in `fieldset` elements with a `legend`
- simplifies the CSS lowering selectors specificity

Props xavortm.

Fixes #38023.

Built from https://develop.svn.wordpress.org/trunk@38912


git-svn-id: http://core.svn.wordpress.org/trunk@38855 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrea Fercia 2016-10-25 17:29:30 +00:00
parent e8a311ed02
commit 48b12e9dd6
6 changed files with 56 additions and 40 deletions

View File

@ -109,24 +109,28 @@ ul.add-menu-item-tabs li {
margin-top: 2em;
}
.menu-settings dl {
.menu-settings-group {
margin: 0 0 10px;
overflow: hidden;
padding-right: 18%;
padding-right: 20%;
}
.menu-settings dd {
.menu-settings-group:last-of-type {
margin-bottom: 0;
}
.menu-settings-input {
float: right;
margin: 0;
width: 100%;
}
.menu-settings dt {
.menu-settings-group-name {
float: right;
clear: both;
width: 21.951%;
width: 25%;
padding: 3px 0 0;
margin-right: -21.951%;
margin-right: -25%; /* 20 container left padding x ( 100 container % width / 80 this % width ) */
}
.menu-settings label {
@ -869,23 +873,26 @@ body.menu-max-depth-11 { min-width: 1280px !important; }
width: 25px;
}
.menu-settings dl {
.menu-settings-group {
padding-right: 0;
}
.menu-settings dd {
float: none;
width: 100%;
margin-bottom: 15px;
}
.menu-settings dt {
.menu-settings-group-name {
float: none;
width: auto;
margin-right: 0;
margin-bottom: 15px;
}
.menu-settings-input {
float: none;
margin-bottom: 15px;
}
.menu-edit .checkbox-input {
margin-top: 0;
}
.manage-menus select {
margin: 0.5em 0;
}

File diff suppressed because one or more lines are too long

View File

@ -109,24 +109,28 @@ ul.add-menu-item-tabs li {
margin-top: 2em;
}
.menu-settings dl {
.menu-settings-group {
margin: 0 0 10px;
overflow: hidden;
padding-left: 18%;
padding-left: 20%;
}
.menu-settings dd {
.menu-settings-group:last-of-type {
margin-bottom: 0;
}
.menu-settings-input {
float: left;
margin: 0;
width: 100%;
}
.menu-settings dt {
.menu-settings-group-name {
float: left;
clear: both;
width: 21.951%;
width: 25%;
padding: 3px 0 0;
margin-left: -21.951%;
margin-left: -25%; /* 20 container left padding x ( 100 container % width / 80 this % width ) */
}
.menu-settings label {
@ -869,23 +873,26 @@ body.menu-max-depth-11 { min-width: 1280px !important; }
width: 25px;
}
.menu-settings dl {
.menu-settings-group {
padding-left: 0;
}
.menu-settings dd {
float: none;
width: 100%;
margin-bottom: 15px;
}
.menu-settings dt {
.menu-settings-group-name {
float: none;
width: auto;
margin-left: 0;
margin-bottom: 15px;
}
.menu-settings-input {
float: none;
margin-bottom: 15px;
}
.menu-edit .checkbox-input {
margin-top: 0;
}
.manage-menus select {
margin: 0.5em 0;
}

File diff suppressed because one or more lines are too long

View File

@ -798,17 +798,19 @@ require_once( ABSPATH . 'wp-admin/admin-header.php' );
$auto_add = false;
} ?>
<dl class="auto-add-pages">
<dt class="howto"><?php _e( 'Auto add pages' ); ?></dt>
<dd class="checkbox-input"><input type="checkbox"<?php checked( $auto_add ); ?> name="auto-add-pages" id="auto-add-pages" value="1" /> <label for="auto-add-pages"><?php printf( __('Automatically add new top-level pages to this menu' ), esc_url( admin_url( 'edit.php?post_type=page' ) ) ); ?></label></dd>
</dl>
<fieldset class="menu-settings-group auto-add-pages">
<legend class="menu-settings-group-name howto"><?php _e( 'Auto add pages' ); ?></legend>
<div class="menu-settings-input checkbox-input">
<input type="checkbox"<?php checked( $auto_add ); ?> name="auto-add-pages" id="auto-add-pages" value="1" /> <label for="auto-add-pages"><?php printf( __('Automatically add new top-level pages to this menu' ), esc_url( admin_url( 'edit.php?post_type=page' ) ) ); ?></label>
</div>
</fieldset>
<?php if ( current_theme_supports( 'menus' ) ) : ?>
<dl class="menu-theme-locations">
<dt class="howto"><?php _e( 'Theme locations' ); ?></dt>
<fieldset class="menu-settings-group menu-theme-locations">
<legend class="menu-settings-group-name howto"><?php _e( 'Theme locations' ); ?></legend>
<?php foreach ( $locations as $location => $description ) : ?>
<dd class="checkbox-input">
<div class="menu-settings-input checkbox-input">
<input type="checkbox"<?php checked( isset( $menu_locations[ $location ] ) && $menu_locations[ $location ] == $nav_menu_selected_id ); ?> name="menu-locations[<?php echo esc_attr( $location ); ?>]" id="locations-<?php echo esc_attr( $location ); ?>" value="<?php echo esc_attr( $nav_menu_selected_id ); ?>" />
<label for="locations-<?php echo esc_attr( $location ); ?>"><?php echo $description; ?></label>
<?php if ( ! empty( $menu_locations[ $location ] ) && $menu_locations[ $location ] != $nav_menu_selected_id ) : ?>
@ -819,9 +821,9 @@ require_once( ABSPATH . 'wp-admin/admin-header.php' );
);
?></span>
<?php endif; ?>
</dd>
</div>
<?php endforeach; ?>
</dl>
</fieldset>
<?php endif; ?>

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.7-alpha-38911';
$wp_version = '4.7-alpha-38912';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.