diff --git a/core/includes/theme.inc b/core/includes/theme.inc index 3b156a58880..cfdfa890c14 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -1066,30 +1066,6 @@ function template_preprocess_item_list(&$variables) { } } -/** - * Prepares variables for feed icon templates. - * - * Default template: feed-icon.html.twig. - * - * @param array $variables - * An associative array containing: - * - url: An internal system path or a fully qualified external URL of the - * feed. - * - title: A descriptive title of the feed. - */ -function template_preprocess_feed_icon(&$variables) { - $text = t('Subscribe to !feed-title', array('!feed-title' => $variables['title'])); - $variables['icon'] = array( - '#theme' => 'image__feed_icon', - '#uri' => 'core/misc/feed.png', - '#width' => 16, - '#height' => 16, - '#alt' => $text, - ); - // Stripping tags because that's what l() used to do. - $variables['attributes']['title'] = strip_tags($text); -} - /** * Returns HTML for an indentation div; used for drag and drop tables. * diff --git a/core/modules/system/css/system.theme.css b/core/modules/system/css/system.theme.css index 179628f84ab..3a8bddbf65d 100644 --- a/core/modules/system/css/system.theme.css +++ b/core/modules/system/css/system.theme.css @@ -164,6 +164,19 @@ abbr.ajax-changed { padding: 1px 20px 1px 0; } +/** + * Feed Icon. + * Markup generated by feed-icon.html.twig. + */ +.feed-icon { + background: url(../../../misc/feed.png) no-repeat; + overflow: hidden; + text-indent: -9999px; + display: block; + width: 16px; + height: 16px; +} + /** * Markup generated by pager.html.twig. */ diff --git a/core/modules/system/src/Tests/Common/AddFeedTest.php b/core/modules/system/src/Tests/Common/AddFeedTest.php index 96341639963..a83f41bddc6 100644 --- a/core/modules/system/src/Tests/Common/AddFeedTest.php +++ b/core/modules/system/src/Tests/Common/AddFeedTest.php @@ -91,7 +91,6 @@ class AddFeedTest extends WebTestBase { '#title' => '<>&"\'', ); $text = \Drupal::service('renderer')->renderRoot($variables); - preg_match('/title="(.*?)"/', $text, $matches); - $this->assertEqual($matches[1], 'Subscribe to &"'', 'feed_icon template escapes reserved HTML characters.'); + $this->assertEqual(trim(strip_tags($text)), 'Subscribe to <>&"'', 'feed_icon template escapes reserved HTML characters.'); } } diff --git a/core/modules/system/templates/feed-icon.html.twig b/core/modules/system/templates/feed-icon.html.twig index dab9734b768..9b321e0d675 100644 --- a/core/modules/system/templates/feed-icon.html.twig +++ b/core/modules/system/templates/feed-icon.html.twig @@ -5,14 +5,13 @@ * * Available variables: * - url: An internal system path or a fully qualified external URL of the feed. - * - icon: The rendered HTML ( tag) for the feed icon image. * - attributes: Remaining HTML attributes for the feed link. * - title: A descriptive title of the feed link. * - class: HTML classes to be applied to the feed link. * - * @see template_preprocess_feed_icon() - * * @ingroup themeable */ #} -{{ icon }} + + {{ 'Subscribe to @title'|t({'@title': title}) }} + diff --git a/core/themes/bartik/css/base/elements.css b/core/themes/bartik/css/base/elements.css index 3b848969435..3bf574a6674 100644 --- a/core/themes/bartik/css/base/elements.css +++ b/core/themes/bartik/css/base/elements.css @@ -124,6 +124,10 @@ blockquote:after { blockquote > p:first-child { display: inline; } +.feed-icon { + display: block; + margin: 25px 0 0 0; +} img { max-width: 100%; height: auto; diff --git a/core/themes/classy/templates/misc/feed-icon.html.twig b/core/themes/classy/templates/misc/feed-icon.html.twig deleted file mode 100644 index 19db66acbf6..00000000000 --- a/core/themes/classy/templates/misc/feed-icon.html.twig +++ /dev/null @@ -1,16 +0,0 @@ -{# -/** - * @file - * Theme override for a feed icon. - * - * Available variables: - * - url: An internal system path or a fully qualified external URL of the feed. - * - icon: The rendered HTML ( tag) for the feed icon image. - * - attributes: Remaining HTML attributes for the feed link. - * - title: A descriptive title of the feed link. - * - class: HTML classes to be applied to the feed link. - * - * @see template_preprocess_feed_icon() - */ -#} -{{ icon }}