diff --git a/core/includes/theme.inc b/core/includes/theme.inc index b65b71e..e5cc763 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -2222,53 +2222,43 @@ function template_preprocess_item_list(&$variables) { * - items: A list of items to render. Allowed values are strings or * render arrays. Render arrays can specify list item attributes in the * #wrapper_attributes property. - * - title: The title of the list. * - list_type: The type of HTML list (e.g. "ul", "ol"). * - attributes: The attributes applied to the list element. */ function theme_item_list($variables) { $items = $variables['items']; - $title = (string) $variables['title']; $list_type = $variables['list_type']; - $list_attributes = $variables['attributes']; + $attributes = $variables['attributes']; + $attributes['class'][] = 'item-list'; $output = ''; if ($items) { - $output .= '<' . $list_type . new Attribute($list_attributes) . '>'; + $output .= '<' . $list_type . new Attribute($attributes) . '>'; $num_items = count($items); $i = 0; foreach ($items as &$item) { $i++; - $attributes = array(); + $item_attributes = array(); if (is_array($item)) { if (isset($item['#wrapper_attributes'])) { - $attributes = $item['#wrapper_attributes']; + $item_attributes = $item['#wrapper_attributes']; } $item = drupal_render($item); } - $attributes['class'][] = ($i % 2 ? 'odd' : 'even'); + // Add first, last, even & odd classes. + $item_attributes['class'][] = ($i % 2 ? 'odd' : 'even'); if ($i == 1) { - $attributes['class'][] = 'first'; + $item_attributes['class'][] = 'first'; } if ($i == $num_items) { - $attributes['class'][] = 'last'; + $item_attributes['class'][] = 'last'; } - $output .= '' . $item . ''; + $output .= '' . $item . ''; } $output .= ""; } - // Only output the list container and title, if there are any list items. - // Check to see whether the block title exists before adding a header. - // Empty headers are not semantic and present accessibility challenges. - if ($output !== '') { - if ($title !== '') { - $title = '

' . $title . '

'; - } - $output = '
' . $title . $output . '
'; - } - return $output; } diff --git a/core/modules/simpletest/css/simpletest.module.css b/core/modules/simpletest/css/simpletest.module.css index 86bd04b..d3a8afe 100644 --- a/core/modules/simpletest/css/simpletest.module.css +++ b/core/modules/simpletest/css/simpletest.module.css @@ -35,7 +35,7 @@ table#simpletest-form-table tr.simpletest-group label { display: inline; } -div.message > div.item-list { +div.message > ul.item-list { font-weight: normal; } diff --git a/core/modules/system/css/system.theme.css b/core/modules/system/css/system.theme.css index 46feb02..5d4281f 100644 --- a/core/modules/system/css/system.theme.css +++ b/core/modules/system/css/system.theme.css @@ -26,18 +26,15 @@ td.active { /** * Markup generated by theme_item_list(). */ -.item-list .title { - font-weight: bold; -} -.item-list ul { +ul.item-list { margin: 0 0 0.75em 0; padding: 0; } -.item-list ul li { +ul.item-list li { margin: 0 0 0.25em 1.5em; /* LTR */ padding: 0; } -[dir="rtl"] .item-list ul li { +[dir="rtl"] ul.item-list li { margin: 0 1.5em 0.25em 0; } @@ -153,11 +150,11 @@ abbr.form-required, abbr.tabledrag-changed, abbr.ajax-changed { /** * Markup generated by pager.html.twig. */ -.item-list .pager { +ul.pager { clear: both; text-align: center; } -.item-list .pager li { +ul.pager li { background-image: none; display: inline; list-style-type: none; 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 635883c..cf60107 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Theme/FunctionsTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Theme/FunctionsTest.php @@ -93,32 +93,30 @@ function testItemList() { 'f', ); - $inner_b = '
    '; + $inner_b = '
      '; $inner_b .= '
    1. ba
    2. '; $inner_b .= '
    3. bb
    4. '; - $inner_b .= '
'; + $inner_b .= ''; - $inner_cb = '
    '; + $inner_cb = '
      '; $inner_cb .= '
    • cba
    • '; $inner_cb .= '
    • cbb
    • '; - $inner_cb .= '
'; + $inner_cb .= ''; - $inner_c = '
    '; + $inner_c = '
      '; $inner_c .= '
    • ca
    • '; $inner_c .= '
    • cb' . $inner_cb . '
    • '; $inner_c .= '
    • cc
    • '; - $inner_c .= '
'; + $inner_c .= ''; - $expected = '
'; - $expected .= '

Some title

'; - $expected .= '
    '; + $expected = '
      '; $expected .= '
    • a
    • '; $expected .= '
    • b' . $inner_b . '
    • '; $expected .= '
    • c' . $inner_c . '
    • '; $expected .= '
    • d
    • '; $expected .= '
    • '; $expected .= '
    • f
    • '; - $expected .= '
'; + $expected .= ''; $this->assertThemeOutput('item_list', $variables, $expected); } diff --git a/core/modules/views/templates/views-view-summary.html.twig b/core/modules/views/templates/views-view-summary.html.twig index 4d8ed8f..adf6c16 100644 --- a/core/modules/views/templates/views-view-summary.html.twig +++ b/core/modules/views/templates/views-view-summary.html.twig @@ -19,14 +19,12 @@ * @ingroup themeable */ #} -
-
    - {% for row in rows %} -
  • {{ row.link }} - {% if options.count %} - ({{ row.count }}) - {% endif %} -
  • - {% endfor %} -
-
+ 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 bbc7d16..19d47e6 100644 --- a/core/modules/views_ui/css/views_ui.admin.theme.css +++ b/core/modules/views_ui/css/views_ui.admin.theme.css @@ -1065,11 +1065,11 @@ ul#views-display-menu-tabs li.add ul.action-list li{ /* @group HTML list */ -#views-live-preview .view-content > .item-list > ul { +#views-live-preview .view-content > ul.item-list { list-style-position: outside; padding-left: 21px; /* LTR */ } -[dir="rtl"] #views-live-preview .view-content > .item-list > ul { +[dir="rtl"] #views-live-preview .view-content > ul.item-list { padding-left: 0; padding-right: 21px; } diff --git a/core/themes/bartik/css/style.css b/core/themes/bartik/css/style.css index dab43ff..9161714 100644 --- a/core/themes/bartik/css/style.css +++ b/core/themes/bartik/css/style.css @@ -121,7 +121,7 @@ body, ul.contextual-links, ul.links, ul.primary, -.item-list .pager, +.pager, div.field-type-taxonomy-term-reference, div.messages, div.meta, @@ -264,27 +264,27 @@ table ul.links li { font-size: 0.923em; text-shadow: 0 0 0 !important; } -.item-list .pager { +.pager { font-size: 0.929em; } -.item-list .pager li { +.pager li { padding: 0; } -.item-list .pager a { +.pager a { display: inline-block; padding: 10px 15px; } -.item-list .pager .pager-first a { +.pager .pager-first a { padding: 10px 10px 10px 0; } -.item-list .pager .pager-previous a { +.pager .pager-previous a { padding: 10px 0; } -.item-list .pager .pager-current { +.pager .pager-current { padding: 0 10px; } -.item-list .pager .pager-next a, -.item-list .pager .pager-last a { +.pager .pager-next a, +.pager .pager-last a { padding: 10px 0 10px 10px; } ul.menu li { @@ -299,11 +299,11 @@ ul.menu li { [dir="rtl"] .region-content ol { padding: 2.5em 0 0.25em 0; } -.item-list ul li { +ul.item-list li { margin: 0; padding: 0.2em 0.5em 0 0; /* LTR */ } -[dir="rtl"] .item-list ul li { +[dir="rtl"] ul.item-list li { padding: 0.2em 0 0 0.5em; } ul.tips { @@ -459,21 +459,19 @@ h1#site-name { margin: 0; padding: 0; } -.region-header #block-user-login div.item-list, +.region-header #block-user-login ul.item-list, .region-header #block-user-login div.description { font-size: 0.916em; margin: 0; } -.region-header #block-user-login div.item-list { +.region-header #block-user-login ul.item-list { clear: both; + padding: 0; + line-height: 1; } .region-header #block-user-login div.description { display: inline; } -.region-header #block-user-login .item-list ul { - padding: 0; - line-height: 1; -} .region-header #block-user-login .item-list li { list-style: none; float: left; /* LTR */ diff --git a/core/themes/seven/style.css b/core/themes/seven/style.css index 6d794d8..2ca1840 100644 --- a/core/themes/seven/style.css +++ b/core/themes/seven/style.css @@ -105,20 +105,18 @@ abbr, acronym { border-bottom: dotted 1px; } -ul, -.item-list ul { +ul { list-style-type: disc; list-style-image: none; margin: 0.25em 0 0.25em 1.5em; /* LTR */ } -[dir="rtl"] ul, -[dir="rtl"] .item-list ul { +[dir="rtl"] ul { margin: 0.25em 1.5em 0.25em 0; } -.item-list .pager li { +.pager li { padding: 0.5em; } -.item-list ul li, +ul.item-list li, li.leaf, ul.menu li { list-style-type: disc; @@ -134,12 +132,12 @@ ol { [dir="rtl"] ol { margin: 0.25em 2em 0.25em 0; } -.item-list ul li.collapsed, +ul.item-list li.collapsed, ul.menu li.collapsed { list-style-image:url(../../misc/menu-collapsed.png); list-style-type:disc; } -.item-list ul li.expanded, +ul.item-list li.expanded, ul.menu li.expanded { list-style-image:url(../../misc/menu-expanded.png); list-style-type:circle; @@ -1380,7 +1378,7 @@ details.fieldset-no-legend { /* @group Lists */ .views-admin ul.secondary, -.views-admin .item-list ul { +.views-admin ul.item-list { margin: 0; padding: 0; }