Issue #2329853 by Cottser: Move miscellaneous theme.inc classes from preprocess to templates.

8.0.x
Nathaniel Catchpole 2014-09-24 16:17:15 +01:00
parent 5b11264df6
commit a1a0cc86c0
3 changed files with 8 additions and 3 deletions

View File

@ -1493,7 +1493,6 @@ function template_preprocess_feed_icon(&$variables) {
'#height' => 16,
'#alt' => $text,
);
$variables['attributes']['class'] = array('feed-icon');
// Stripping tags because that's what l() used to do.
$variables['attributes']['title'] = strip_tags($text);
}

View File

@ -15,4 +15,4 @@
* @ingroup themeable
*/
#}
<a href="{{ url }}"{{ attributes }}>{{ icon }}</a>
<a href="{{ url }}"{{ attributes.addClass('feed-icon') }}>{{ icon }}</a>

View File

@ -24,7 +24,13 @@
*/
#}
{% for type, messages in message_list %}
<div class="messages messages--{{ type }}" role="contentinfo" aria-label="{{ status_headings[type] }}">
{%
set classes = [
'messages',
'messages--' ~ type,
]
%}
<div class="{{ attributes.addClass(classes).class }}" role="contentinfo" aria-label="{{ status_headings[type] }}">
{% if type == 'error' %}
<div role="alert">
{% endif %}