core/includes/menu.inc | 8 +--- core/includes/theme.inc | 22 ---------- .../block/lib/Drupal/block/BlockListController.php | 2 +- .../Drupal/block/Tests/Views/DisplayBlockTest.php | 2 +- .../Tests/ContextualDynamicContextTest.php | 4 +- core/modules/field/field.module | 3 +- core/modules/field/templates/field.html.twig | 2 +- core/modules/image/css/image.admin.css | 3 +- .../menu/lib/Drupal/menu/Tests/MenuTest.php | 2 +- core/modules/system/css/system.admin.css | 8 ++-- .../Drupal/system/Tests/Theme/FunctionsTest.php | 42 ++++++++++---------- .../tour/lib/Drupal/tour/Tests/TourTest.php | 4 +- core/modules/views_ui/css/views_ui.admin.theme.css | 6 +-- core/modules/views_ui/js/views-admin.js | 8 +--- .../lib/Drupal/views_ui/Form/Ajax/AddItem.php | 5 +-- .../lib/Drupal/views_ui/Tests/DisplayTest.php | 2 +- core/modules/views_ui/views_ui.theme.inc | 4 -- core/themes/bartik/css/style.css | 18 ++++----- core/themes/seven/vertical-tabs.css | 2 +- 19 files changed, 52 insertions(+), 95 deletions(-) diff --git a/core/includes/menu.inc b/core/includes/menu.inc index 856c424..1d92727 100644 --- a/core/includes/menu.inc +++ b/core/includes/menu.inc @@ -1107,14 +1107,8 @@ function menu_tree_output($tree) { $router_item = menu_get_item(); $num_items = count($items); - foreach ($items as $i => $data) { + foreach ($items as $data) { $class = array(); - if ($i == 0) { - $class[] = 'first'; - } - if ($i == $num_items - 1) { - $class[] = 'last'; - } // Set a class for the
  • -tag. Since $data['below'] may contain local // tasks, only set 'expanded' class if the link also has children within // the current menu. diff --git a/core/includes/theme.inc b/core/includes/theme.inc index 3db84a9..4561e46 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -1229,14 +1229,10 @@ function theme_links($variables) { $output .= ''; - $num_links = count($links); - $i = 0; $active = \Drupal::linkGenerator()->getActive(); $language_url = \Drupal::languageManager()->getLanguage(Language::TYPE_URL); foreach ($links as $key => $link) { - $i++; - $link += array( 'href' => NULL, 'route_name' => NULL, @@ -1247,14 +1243,6 @@ function theme_links($variables) { $class = array(); // Use the array key as class name. $class[] = drupal_html_class($key); - // Add odd/even, first, and last classes. - $class[] = ($i % 2 ? 'odd' : 'even'); - if ($i == 1) { - $class[] = 'first'; - } - if ($i == $num_links) { - $class[] = 'last'; - } $link_element = array( '#type' => 'link', @@ -1803,10 +1791,7 @@ function theme_item_list($variables) { if ($items) { $output .= '<' . $list_type . new Attribute($list_attributes) . '>'; - $num_items = count($items); - $i = 0; foreach ($items as &$item) { - $i++; $attributes = array(); if (is_array($item)) { if (isset($item['#wrapper_attributes'])) { @@ -1814,13 +1799,6 @@ function theme_item_list($variables) { } $item = drupal_render($item); } - $attributes['class'][] = ($i % 2 ? 'odd' : 'even'); - if ($i == 1) { - $attributes['class'][] = 'first'; - } - if ($i == $num_items) { - $attributes['class'][] = 'last'; - } $output .= '' . $item . '
  • '; } $output .= ""; diff --git a/core/modules/block/lib/Drupal/block/BlockListController.php b/core/modules/block/lib/Drupal/block/BlockListController.php index 8547ba4..926558b 100644 --- a/core/modules/block/lib/Drupal/block/BlockListController.php +++ b/core/modules/block/lib/Drupal/block/BlockListController.php @@ -213,7 +213,7 @@ public function buildForm(array $form, array &$form_state) { $form['blocks'][$region] = array( '#attributes' => array( - 'class' => array('region-title', 'region-title-' . $region, 'odd'), + 'class' => array('region-title', 'region-title-' . $region), 'no_striping' => TRUE, ), ); diff --git a/core/modules/block/lib/Drupal/block/Tests/Views/DisplayBlockTest.php b/core/modules/block/lib/Drupal/block/Tests/Views/DisplayBlockTest.php index 1cee4b8..8082932 100644 --- a/core/modules/block/lib/Drupal/block/Tests/Views/DisplayBlockTest.php +++ b/core/modules/block/lib/Drupal/block/Tests/Views/DisplayBlockTest.php @@ -285,7 +285,7 @@ public function testBlockContextualLinks() { $response = $this->drupalPost('contextual/render', 'application/json', $post, array('query' => array('destination' => 'test-page'))); $this->assertResponse(200); $json = drupal_json_decode($response); - $this->assertIdentical($json[$id], ''); + $this->assertIdentical($json[$id], ''); } } diff --git a/core/modules/contextual/lib/Drupal/contextual/Tests/ContextualDynamicContextTest.php b/core/modules/contextual/lib/Drupal/contextual/Tests/ContextualDynamicContextTest.php index de44610..7b79bff 100644 --- a/core/modules/contextual/lib/Drupal/contextual/Tests/ContextualDynamicContextTest.php +++ b/core/modules/contextual/lib/Drupal/contextual/Tests/ContextualDynamicContextTest.php @@ -78,9 +78,9 @@ function testDifferentPermissions() { $response = $this->renderContextualLinks($ids, 'node'); $this->assertResponse(200); $json = drupal_json_decode($response); - $this->assertIdentical($json[$ids[0]], ''); + $this->assertIdentical($json[$ids[0]], ''); $this->assertIdentical($json[$ids[1]], ''); - $this->assertIdentical($json[$ids[2]], ''); + $this->assertIdentical($json[$ids[2]], ''); $this->assertIdentical($json[$ids[3]], ''); // Authenticated user: can access contextual links, cannot edit articles. diff --git a/core/modules/field/field.module b/core/modules/field/field.module index b2e8c76..408d816 100644 --- a/core/modules/field/field.module +++ b/core/modules/field/field.module @@ -677,8 +677,7 @@ function theme_field($variables) { // Render the items. $output .= '
    '; foreach ($variables['items'] as $delta => $item) { - $classes = 'field-item ' . ($delta % 2 ? 'odd' : 'even'); - $output .= '
    ' . drupal_render($item) . '
    '; + $output .= '
    ' . drupal_render($item) . '
    '; } $output .= '
    '; diff --git a/core/modules/field/templates/field.html.twig b/core/modules/field/templates/field.html.twig index 4b13366..d5873f4 100644 --- a/core/modules/field/templates/field.html.twig +++ b/core/modules/field/templates/field.html.twig @@ -42,7 +42,7 @@ HTML comment. {% endif %}
    {% for delta, item in items %} -
    {{ item }}
    +
    {{ item }}
    {% endfor %}
    diff --git a/core/modules/image/css/image.admin.css b/core/modules/image/css/image.admin.css index 8b37456..3e1f901 100644 --- a/core/modules/image/css/image.admin.css +++ b/core/modules/image/css/image.admin.css @@ -70,8 +70,7 @@ .image-anchor { width: auto; } -.image-anchor .even, -.image-anchor .odd { +.image-anchor tr { background: none; } .image-anchor td { diff --git a/core/modules/menu/lib/Drupal/menu/Tests/MenuTest.php b/core/modules/menu/lib/Drupal/menu/Tests/MenuTest.php index f4f9e53..97de9e1 100644 --- a/core/modules/menu/lib/Drupal/menu/Tests/MenuTest.php +++ b/core/modules/menu/lib/Drupal/menu/Tests/MenuTest.php @@ -418,7 +418,7 @@ public function testBlockContextualLinks() { $response = $this->drupalPost('contextual/render', 'application/json', $post, array('query' => array('destination' => 'test-page'))); $this->assertResponse(200); $json = drupal_json_decode($response); - $this->assertIdentical($json[$id], ''); + $this->assertIdentical($json[$id], ''); } /** diff --git a/core/modules/system/css/system.admin.css b/core/modules/system/css/system.admin.css index 203f7d2..ea1afe3 100644 --- a/core/modules/system/css/system.admin.css +++ b/core/modules/system/css/system.admin.css @@ -405,18 +405,18 @@ table.system-status-report .status-title { border-left: 1px solid #cdcdcd; border-right: none; } -.theme-selector .operations li.last { +.theme-selector .operations li:last-child { padding: 0 0 0 0.7em; /* LTR */ border-right: none; /* LTR */ } -[dir="rtl"] .theme-selector .operations li.last { +[dir="rtl"] .theme-selector .operations li:last-child { padding: 0 0.7em 0 0; border-left: none; } -.theme-selector .operations li.first { +.theme-selector .operations li:first-child { padding: 0 0.7em 0 0; /* LTR */ } -[dir="rtl"] .theme-selector .operations li.first { +[dir="rtl"] .theme-selector .operations li:first-child { padding: 0 0 0 0.7em; } #system-themes-admin-form { diff --git a/core/modules/system/lib/Drupal/system/Tests/Theme/FunctionsTest.php b/core/modules/system/lib/Drupal/system/Tests/Theme/FunctionsTest.php index d1930c9..658d9cd 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Theme/FunctionsTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Theme/FunctionsTest.php @@ -116,30 +116,30 @@ function testItemList() { ); $inner_b = '
      '; - $inner_b .= '
    1. ba
    2. '; - $inner_b .= '
    3. bb
    4. '; + $inner_b .= '
    5. ba
    6. '; + $inner_b .= '
    7. bb
    8. '; $inner_b .= '
    '; $inner_cb = '
    '; $inner_c = '
    '; $expected = '
    '; $expected .= '

    Some title

    '; $expected .= '
    '; $this->assertThemeOutput('item_list', $variables, $expected); @@ -189,10 +189,10 @@ function testLinks() { $expected_links = ''; $expected_links .= ''; // Verify that passing a string as heading works. @@ -222,10 +222,10 @@ function testLinks() { ); $expected_links = ''; $expected_links .= ''; $expected = $expected_heading . $expected_links; $this->assertThemeOutput('links', $variables, $expected); diff --git a/core/modules/tour/lib/Drupal/tour/Tests/TourTest.php b/core/modules/tour/lib/Drupal/tour/Tests/TourTest.php index fcae023..75d196c 100644 --- a/core/modules/tour/lib/Drupal/tour/Tests/TourTest.php +++ b/core/modules/tour/lib/Drupal/tour/Tests/TourTest.php @@ -55,7 +55,7 @@ public function testTourFunctionality() { // Navigate to tour-test-1 and verify the tour_test_1 tip is found with appropriate classes. $this->drupalGet('tour-test-1'); $elements = $this->xpath('//li[@data-id=:data_id and @class=:classes and ./h2[contains(., :text)]]', array( - ':classes' => 'tip-module-tour-test tip-type-text tip-tour-test-1 odd first', + ':classes' => 'tip-module-tour-test tip-type-text tip-tour-test-1', ':data_id' => 'tour-test-1', ':text' => 'The first tip', )); @@ -69,7 +69,7 @@ public function testTourFunctionality() { $this->assertTourTips(); $elements = $this->xpath('//li[@data-id=:data_id and @class=:classes and ./p//a[@href=:href and contains(., :text)]]', array( - ':classes' => 'tip-module-tour-test tip-type-text tip-tour-test-1 odd first', + ':classes' => 'tip-module-tour-test tip-type-text tip-tour-test-1', ':data_id' => 'tour-test-1', ':href' => url('', array('absolute' => TRUE)), ':text' => 'Drupal', diff --git a/core/modules/views_ui/css/views_ui.admin.theme.css b/core/modules/views_ui/css/views_ui.admin.theme.css index 9a71196..0a4aa70 100644 --- a/core/modules/views_ui/css/views_ui.admin.theme.css +++ b/core/modules/views_ui/css/views_ui.admin.theme.css @@ -514,7 +514,7 @@ ul#views-display-menu-tabs li.add ul.action-list li{ border-width: 1px 1px 0; } -.views-displays .secondary .action-list li.last { +.views-displays .secondary .action-list li:last-child { border-width: 0 1px 1px; } @@ -707,7 +707,7 @@ ul#views-display-menu-tabs li.add ul.action-list li{ padding-bottom: 2px; } -.views-ui-display-tab-bucket .even { +.views-ui-display-tab-bucket .views-display-setting:nth-of-type(even) { background-color: #f3f5ee; } @@ -784,7 +784,7 @@ ul#views-display-menu-tabs li.add ul.action-list li{ border-top: 1px solid #ccc; } -.views-filterable-options .even .form-type-checkbox { +.views-filterable-options .filterable-option:nth-of-type(even) .form-type-checkbox { background-color: #f3f4ee; } diff --git a/core/modules/views_ui/js/views-admin.js b/core/modules/views_ui/js/views-admin.js index b443227..0f620bf 100644 --- a/core/modules/views_ui/js/views-admin.js +++ b/core/modules/views_ui/js/views-admin.js @@ -353,7 +353,7 @@ $.extend(Drupal.viewsUi.OptionsSearch.prototype, { * Keyup handler for the search box that hides or shows the relevant options. */ handleKeyup: function (event) { - var found, i, j, option, search, words, wordsLength, zebraClass, zebraCounter; + var found, i, j, option, search, words, wordsLength; // Determine the user's search query. The search text has been converted to // lowercase. @@ -361,9 +361,6 @@ $.extend(Drupal.viewsUi.OptionsSearch.prototype, { words = search.split(' '); wordsLength = words.length; - // Start the counter for restriping rows. - zebraCounter = 0; - // Search through the search texts in the form for matching text. var length = this.options.length; for (i = 0; i < length; i++) { @@ -379,11 +376,8 @@ $.extend(Drupal.viewsUi.OptionsSearch.prototype, { } if (found) { // Show the checkbox row, and restripe it. - zebraClass = (zebraCounter % 2) ? 'odd' : 'even'; option.$div.show(); option.$div.removeClass('even odd'); - option.$div.addClass(zebraClass); - zebraCounter++; } else { // The search string wasn't found; hide this item. diff --git a/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/AddItem.php b/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/AddItem.php index b45e113..891f383 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/AddItem.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/AddItem.php @@ -132,15 +132,13 @@ public function buildForm(array $form, array &$form_state) { } foreach ($grouped_options as $group => $group_options) { - $zebra = 0; foreach ($group_options as $key => $option) { - $zebra_class = ($zebra % 2) ? 'odd' : 'even'; $form['options']['name'][$key] = array( '#type' => 'checkbox', '#title' => $this->t('!group: !field', array('!group' => $option['group'], '!field' => $option['title'])), '#description' => $option['help'], '#return_value' => $key, - '#prefix' => "
    ", + '#prefix' => "
    ", '#suffix' => '
    ', '#states' => array( 'visible' => array( @@ -153,7 +151,6 @@ public function buildForm(array $form, array &$form_state) { ) ) ); - $zebra++; } } diff --git a/core/modules/views_ui/lib/Drupal/views_ui/Tests/DisplayTest.php b/core/modules/views_ui/lib/Drupal/views_ui/Tests/DisplayTest.php index 76480e2..ae15d5c 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/Tests/DisplayTest.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/Tests/DisplayTest.php @@ -313,7 +313,7 @@ public function testPageContextualLinks() { $response = $this->drupalPost('contextual/render', 'application/json', $post, array('query' => array('destination' => 'test-display'))); $this->assertResponse(200); $json = drupal_json_decode($response); - $this->assertIdentical($json[$id], ''); + $this->assertIdentical($json[$id], ''); } /** diff --git a/core/modules/views_ui/views_ui.theme.inc b/core/modules/views_ui/views_ui.theme.inc index ae32eaf..db4f3e8 100644 --- a/core/modules/views_ui/views_ui.theme.inc +++ b/core/modules/views_ui/views_ui.theme.inc @@ -24,15 +24,11 @@ * appended to the setting's description. */ function template_preprocess_views_ui_display_tab_setting(&$variables) { - static $zebra = 0; // Add default class attributes. $variables['attributes']['class'][] = 'views-display-setting'; - $variables['attributes']['class'][] = ($zebra % 2 === 0 ? 'odd' : 'even'); $variables['attributes']['class'][] = 'clearfix'; - $zebra++; - // Put the primary link to the left side. array_unshift($variables['settings_links'], $variables['link']); diff --git a/core/themes/bartik/css/style.css b/core/themes/bartik/css/style.css index 6c7a8fc..ab61506 100644 --- a/core/themes/bartik/css/style.css +++ b/core/themes/bartik/css/style.css @@ -446,7 +446,7 @@ h1#site-name { text-decoration: none; background: rgba(255, 255, 255, 0.15); } -.region-header .block-menu li.last a { +.region-header .block-menu li:last-child a { border-bottom: 0; } /* User Login block in the header region */ @@ -481,10 +481,10 @@ h1#site-name { float: left; /* LTR */ padding: 3px 0 1px; } -.region-header #block-user-login .item-list li.last { +.region-header #block-user-login .item-list li:last-child { padding-left: 0.5em; /* LTR */ } -[dir="rtl"] .region-header #block-user-login .item-list li.last { +[dir="rtl"] .region-header #block-user-login .item-list li:last-child { padding-left: 0; padding-right: 0.5em; } @@ -916,7 +916,7 @@ ul.links { border-bottom: 1px solid #dfdfdf; line-height: 1.3; } -#triptych .block.last { +#triptych .block:last-child { border-bottom: none; } #triptych .block ul li, @@ -1072,18 +1072,18 @@ ul.links { border-color: rgba(255, 255, 255, 0.15); border-right: none; } -#footer .menu li.first a { +#footer .menu li:first-child a { padding-left: 0; /* LTR */ } -[dir="rtl"] #footer .menu li.first a { +[dir="rtl"] #footer .menu li:first-child a { padding-right: 0; padding-left: 12px; } -#footer .menu li.last a { +#footer .menu li:last-child a { padding-right: 0; /* LTR */ border-right: none; /* LTR */ } -[dir="rtl"] #footer .menu li.last a { +[dir="rtl"] #footer .menu li:last-child a { padding-left: 0; padding-right: 12px; border-left: none; @@ -1948,7 +1948,7 @@ div.admin-panel .description { * The contents of the popup dialog on the views edit form. */ -.views-filterable-options .even .form-type-checkbox { +.views-filterable-options .filterable-option:nth-of-type(even) .form-type-checkbox { background-color: #F9F9F9; } diff --git a/core/themes/seven/vertical-tabs.css b/core/themes/seven/vertical-tabs.css index 2bc1096..325a3af 100644 --- a/core/themes/seven/vertical-tabs.css +++ b/core/themes/seven/vertical-tabs.css @@ -50,7 +50,7 @@ text-shadow: 0 1px hsla(0, 0%, 100%, 0.6); text-decoration: none; } -.vertical-tab-button.last a { +.vertical-tab-button:last-child a { border-bottom: 0; } .vertical-tab-button.selected a,