Issue #2031641 by aburrows, lauriii, nlisgo, Pol, redsquid, tuutti, LewisNyman, akalata, agviu, kallehauge, _nolocation, rpayanm, saki007ster, mdrummond, RavindraSingh, brahmjeet789: Change active class to is-active

8.0.x
Alex Pott 2015-04-16 16:25:55 +02:00
parent 0abd1bb287
commit b676df9303
41 changed files with 141 additions and 139 deletions

View File

@ -34,7 +34,7 @@ function template_preprocess_menu_local_task(&$variables) {
$link_text = $link['title'];
if (!empty($variables['element']['#active'])) {
$variables['attributes']['class'] = array('active');
$variables['attributes']['class'] = array('is-active');
// Add text to indicate active tab for non-visual users.
$active = SafeMarkup::format('<span class="visually-hidden">@label</span>', array('@label' => t('(active tab)')));

View File

@ -48,7 +48,7 @@ function tablesort_header(&$cell_content, array &$cell_attributes, array $header
// http://www.w3.org/TR/wai-aria/states_and_properties#aria-sort
$cell_attributes['aria-sort'] = ($ts['sort'] == 'asc') ? 'ascending' : 'descending';
$ts['sort'] = (($ts['sort'] == 'asc') ? 'desc' : 'asc');
$cell_attributes['class'][] = 'active';
$cell_attributes['class'][] = 'is-active';
$tablesort_indicator = array(
'#theme' => 'tablesort_indicator',
'#style' => $ts['sort'],

View File

@ -549,7 +549,7 @@ function template_preprocess_datetime_wrapper(&$variables) {
* list items differently when the link is active, since CSS does not yet allow
* one to style list items only if it contains a certain element with a certain
* class. I.e. we cannot yet convert this jQuery selector to a CSS selector:
* jQuery('li:has("a.active")')
* jQuery('li:has("a.is-active")')
*
* @see \Drupal\Core\Utility\LinkGenerator
* @see \Drupal\Core\Utility\LinkGenerator::generate()
@ -1143,7 +1143,7 @@ function template_preprocess_maintenance_task_list(&$variables) {
$variables['tasks'][$k]['item'] = $item;
$variables['tasks'][$k]['attributes'] = new Attribute();
if ($active == $k) {
$variables['tasks'][$k]['attributes']->addClass('active');
$variables['tasks'][$k]['attributes']->addClass('is-active');
$variables['tasks'][$k]['status'] = t('active');
$done = FALSE;
}

View File

@ -113,8 +113,8 @@ class LocalTaskDefault extends PluginBase implements LocalTaskInterface {
public function getOptions(RouteMatchInterface $route_match) {
$options = $this->pluginDefinition['options'];
if ($this->active) {
if (empty($options['attributes']['class']) || !in_array('active', $options['attributes']['class'])) {
$options['attributes']['class'][] = 'active';
if (empty($options['attributes']['class']) || !in_array('is-active', $options['attributes']['class'])) {
$options['attributes']['class'][] = 'is-active';
}
}
return (array) $options;

View File

@ -8,7 +8,7 @@
"use strict";
/**
* Append active class.
* Append is-active class.
*
* The link is only active if its path corresponds to the current path, the
* language of the linked path is equal to the current language, and if the
@ -16,8 +16,8 @@
* same request with different query parameters may yield a different page
* (e.g. pagers, exposed View filters).
*
* Does not discriminate based on element type, so allows you to set the active
* class on any element: a, li
* Does not discriminate based on element type, so allows you to set the
* is-active class on any element: a, li
*/
Drupal.behaviors.activeLinks = {
attach: function (context) {
@ -47,14 +47,14 @@
// Query the DOM.
var activeLinks = context.querySelectorAll(selectors.join(','));
for (var i = 0, il = activeLinks.length; i < il; i += 1) {
activeLinks[i].classList.add('active');
activeLinks[i].classList.add('is-active');
}
},
detach: function (context, settings, trigger) {
if (trigger === 'unload') {
var activeLinks = context.querySelectorAll('[data-drupal-link-system-path].active');
var activeLinks = context.querySelectorAll('[data-drupal-link-system-path].is-active');
for (var i = 0, il = activeLinks.length; i < il; i += 1) {
activeLinks[i].classList.remove('active');
activeLinks[i].classList.remove('is-active');
}
}
}

View File

@ -10,7 +10,7 @@
background-image: url(../../../misc/icons/bebebe/pencil.svg);
}
.toolbar-bar .toolbar-icon-edit:active:before,
.toolbar-bar .toolbar-icon-edit.active:before {
.toolbar-bar .toolbar-icon-edit.is-active:before {
background-image: url(../../../misc/icons/ffffff/pencil.svg);
}

View File

@ -19,7 +19,7 @@
[dir="rtl"] .toolbar .toolbar-bar .contextual-toolbar-tab .toolbar-item {
padding-right: 1.3333em;
}
.toolbar .toolbar-bar .contextual-toolbar-tab .toolbar-item.active {
.toolbar .toolbar-bar .contextual-toolbar-tab .toolbar-item.is-active {
background-image:-webkit-linear-gradient(rgb(78,159,234) 0%, rgb(69,132,221) 100%);
background-image:linear-gradient(rgb(78,159,234) 0%,rgb(69,132,221) 100%);
}

View File

@ -44,7 +44,7 @@
// Render the visibility.
this.$el.toggleClass('hidden', !this.model.get('isVisible'));
// Render the state.
this.$el.find('button').toggleClass('active', !this.model.get('isViewing'));
this.$el.find('button').toggleClass('is-active', !this.model.get('isViewing'));
return this;
},

View File

@ -140,14 +140,14 @@ class LanguageSwitchingTest extends WebTestBase {
foreach ($language_switcher->ul->li as $link) {
$classes = explode(" ", (string) $link['class']);
list($langcode) = array_intersect($classes, array('en', 'fr'));
if (in_array('active', $classes)) {
if (in_array('is-active', $classes)) {
$links['active'][] = $langcode;
}
else {
$links['inactive'][] = $langcode;
}
$anchor_classes = explode(" ", (string) $link->a['class']);
if (in_array('active', $anchor_classes)) {
if (in_array('is-active', $anchor_classes)) {
$anchors['active'][] = $langcode;
}
else {
@ -359,17 +359,17 @@ class LanguageSwitchingTest extends WebTestBase {
// Language code 'none' link should be active.
$langcode = 'none';
$links = $this->xpath('//a[@id = :id and contains(@class, :class)]', array(':id' => 'no_lang_link', ':class' => 'active'));
$links = $this->xpath('//a[@id = :id and contains(@class, :class)]', array(':id' => 'no_lang_link', ':class' => 'is-active'));
$this->assertTrue(isset($links[0]), t('A link generated by :function to the current :language page with langcode :langcode is marked active.', array(':function' => $function_name, ':language' => $current_language, ':langcode' => $langcode)));
// Language code 'en' link should be active.
$langcode = 'en';
$links = $this->xpath('//a[@id = :id and contains(@class, :class)]', array(':id' => 'en_link', ':class' => 'active'));
$links = $this->xpath('//a[@id = :id and contains(@class, :class)]', array(':id' => 'en_link', ':class' => 'is-active'));
$this->assertTrue(isset($links[0]), t('A link generated by :function to the current :language page with langcode :langcode is marked active.', array(':function' => $function_name, ':language' => $current_language, ':langcode' => $langcode)));
// Language code 'fr' link should not be active.
$langcode = 'fr';
$links = $this->xpath('//a[@id = :id and not(contains(@class, :class))]', array(':id' => 'fr_link', ':class' => 'active'));
$links = $this->xpath('//a[@id = :id and not(contains(@class, :class))]', array(':id' => 'fr_link', ':class' => 'is-active'));
$this->assertTrue(isset($links[0]), t('A link generated by :function to the current :language page with langcode :langcode is NOT marked active.', array(':function' => $function_name, ':language' => $current_language, ':langcode' => $langcode)));
// Test links generated by _l() on a French page.
@ -378,17 +378,17 @@ class LanguageSwitchingTest extends WebTestBase {
// Language code 'none' link should be active.
$langcode = 'none';
$links = $this->xpath('//a[@id = :id and contains(@class, :class)]', array(':id' => 'no_lang_link', ':class' => 'active'));
$links = $this->xpath('//a[@id = :id and contains(@class, :class)]', array(':id' => 'no_lang_link', ':class' => 'is-active'));
$this->assertTrue(isset($links[0]), t('A link generated by :function to the current :language page with langcode :langcode is marked active.', array(':function' => $function_name, ':language' => $current_language, ':langcode' => $langcode)));
// Language code 'en' link should not be active.
$langcode = 'en';
$links = $this->xpath('//a[@id = :id and not(contains(@class, :class))]', array(':id' => 'en_link', ':class' => 'active'));
$links = $this->xpath('//a[@id = :id and not(contains(@class, :class))]', array(':id' => 'en_link', ':class' => 'is-active'));
$this->assertTrue(isset($links[0]), t('A link generated by :function to the current :language page with langcode :langcode is NOT marked active.', array(':function' => $function_name, ':language' => $current_language, ':langcode' => $langcode)));
// Language code 'fr' link should be active.
$langcode = 'fr';
$links = $this->xpath('//a[@id = :id and contains(@class, :class)]', array(':id' => 'fr_link', ':class' => 'active'));
$links = $this->xpath('//a[@id = :id and contains(@class, :class)]', array(':id' => 'fr_link', ':class' => 'is-active'));
$this->assertTrue(isset($links[0]), t('A link generated by :function to the current :language page with langcode :langcode is marked active.', array(':function' => $function_name, ':language' => $current_language, ':langcode' => $langcode)));
}

View File

@ -402,7 +402,7 @@ class LanguageUILanguageNegotiationTest extends WebTestBase {
// Check that the language switcher active link matches the given browser
// language.
$args = array(':id' => 'block-test-language-block', ':url' => \Drupal::url('<front>') . $langcode_browser_fallback);
$fields = $this->xpath('//div[@id=:id]//a[@class="language-link active" and starts-with(@href, :url)]', $args);
$fields = $this->xpath('//div[@id=:id]//a[@class="language-link is-active" and starts-with(@href, :url)]', $args);
$this->assertTrue($fields[0] == $languages[$langcode_browser_fallback]->getName(), 'The browser language is the URL active language');
// Check that URLs are rewritten using the given browser language.

View File

@ -10,7 +10,7 @@
background-image: url(../../../misc/icons/bebebe/star.svg);
}
.toolbar-bar .toolbar-icon-shortcut:active:before,
.toolbar-bar .toolbar-icon-shortcut.active:before {
.toolbar-bar .toolbar-icon-shortcut.is-active:before {
background-image: url(../../../misc/icons/ffffff/star.svg);
}

View File

@ -13,10 +13,10 @@
/**
* Markup generated by tablesort-indicator.html.twig.
*/
th.active img {
th.is-active img {
display: inline;
}
td.active {
td.is-active {
background-color: #ddd;
}
@ -361,7 +361,7 @@ ul.menu {
padding-top: 0.2em;
margin: 0;
}
ul.menu a.active {
ul.menu a.is-active {
color: #000;
}
@ -378,7 +378,7 @@ ul.inline li {
list-style-type: none;
padding: 0 0.5em;
}
ul.links a.active {
ul.links a.is-active {
color: #000;
}
@ -434,7 +434,7 @@ ul.tabs {
padding: 0.2em 1em;
text-decoration: none;
}
.tabs a.active {
.tabs a.is-active {
background-color: #eee;
}
.tabs a:focus,

View File

@ -329,7 +329,7 @@ class SystemController extends ControllerBase {
}
/**
* #post_render_cache callback; sets the "active" class on relevant links.
* #post_render_cache callback; sets the "is-active" class on relevant links.
*
* This is a PHP implementation of the drupal.active-link JavaScript library.
*
@ -405,7 +405,7 @@ class SystemController extends ControllerBase {
// Ensure we don't set the "active" class twice on the same element.
$class = $node->getAttribute('class');
$add_active = !in_array('active', explode(' ', $class));
$add_active = !in_array('is-active', explode(' ', $class));
// The language of an active link is equal to the current language.
if ($add_active && $context['language']) {
@ -429,12 +429,12 @@ class SystemController extends ControllerBase {
}
// Only if the path, the language and the query match, we set the
// "active" class.
// "is-active" class.
if ($add_active) {
if (strlen($class) > 0) {
$class .= ' ';
}
$class .= 'active';
$class .= 'is-active';
$node->setAttribute('class', $class);
// Get the updated tag.

View File

@ -87,20 +87,20 @@ class UrlTest extends WebTestBase {
$path = 'common-test/type-link-active-class';
$this->drupalGet($path, $options_no_query);
$links = $this->xpath('//a[@href = :href and contains(@class, :class)]', array(':href' => Url::fromRoute('common_test.l_active_class', [], $options_no_query)->toString(), ':class' => 'active'));
$links = $this->xpath('//a[@href = :href and contains(@class, :class)]', array(':href' => Url::fromRoute('common_test.l_active_class', [], $options_no_query)->toString(), ':class' => 'is-active'));
$this->assertTrue(isset($links[0]), 'A link generated by _l() to the current page is marked active.');
$links = $this->xpath('//a[@href = :href and not(contains(@class, :class))]', array(':href' => Url::fromRoute('common_test.l_active_class', [], $options_query)->toString(), ':class' => 'active'));
$links = $this->xpath('//a[@href = :href and not(contains(@class, :class))]', array(':href' => Url::fromRoute('common_test.l_active_class', [], $options_query)->toString(), ':class' => 'is-active'));
$this->assertTrue(isset($links[0]), 'A link generated by _l() to the current page with a query string when the current page has no query string is not marked active.');
$this->drupalGet($path, $options_query);
$links = $this->xpath('//a[@href = :href and contains(@class, :class)]', array(':href' => Url::fromRoute('common_test.l_active_class', [], $options_query)->toString(), ':class' => 'active'));
$links = $this->xpath('//a[@href = :href and contains(@class, :class)]', array(':href' => Url::fromRoute('common_test.l_active_class', [], $options_query)->toString(), ':class' => 'is-active'));
$this->assertTrue(isset($links[0]), 'A link generated by _l() to the current page with a query string that matches the current query string is marked active.');
$links = $this->xpath('//a[@href = :href and contains(@class, :class)]', array(':href' => Url::fromRoute('common_test.l_active_class', [], $options_query_reverse)->toString(), ':class' => 'active'));
$links = $this->xpath('//a[@href = :href and contains(@class, :class)]', array(':href' => Url::fromRoute('common_test.l_active_class', [], $options_query_reverse)->toString(), ':class' => 'is-active'));
$this->assertTrue(isset($links[0]), 'A link generated by _l() to the current page with a query string that has matching parameters to the current query string but in a different order is marked active.');
$links = $this->xpath('//a[@href = :href and not(contains(@class, :class))]', array(':href' => Url::fromRoute('common_test.l_active_class', [], $options_no_query)->toString(), ':class' => 'active'));
$links = $this->xpath('//a[@href = :href and not(contains(@class, :class))]', array(':href' => Url::fromRoute('common_test.l_active_class', [], $options_no_query)->toString(), ':class' => 'is-active'));
$this->assertTrue(isset($links[0]), 'A link generated by _l() to the current page without a query string when the current page has a query string is not marked active.');
// Test adding a custom class in links produced by _l() and #type 'link'.

View File

@ -56,7 +56,7 @@ trait AssertMenuActiveTrailTrait {
$xpath .= 'li[contains(@class, :class-trail)]/a[contains(@href, :href) ' . $xpath_last_active . 'and contains(text(), :title)]';
$args = array(
':class-trail' => 'menu-item--active-trail',
':class-active' => 'active',
':class-active' => 'is-active',
':href' => Url::fromUri('base:' . $active_link_path)->toString(),
':title' => $active_link_title,
);

View File

@ -25,10 +25,10 @@ class SystemControllerTest extends UnitTestCase {
* @see \Drupal\system\Controller\SystemController::setLinkActiveClass()
*/
public function providerTestSetLinkActiveClass() {
// Define all the variations that *don't* affect whether or not an "active"
// class is set, but that should remain unchanged:
// Define all the variations that *don't* affect whether or not an
// "is-active" class is set, but that should remain unchanged:
// - surrounding HTML
// - tags for which to test the setting of the "active" class
// - tags for which to test the setting of the "is-active" class
// - content of said tags
$edge_case_html5 = '<audio src="foo.ogg">
<track kind="captions" src="foo.en.vtt" srclang="en" label="English">
@ -40,7 +40,7 @@ class SystemControllerTest extends UnitTestCase {
// Tricky HTML5 example that's unsupported by PHP <=5.4's DOMDocument:
// https://drupal.org/comment/7938201#comment-7938201.
1 => array('prefix' => '<div><p>', 'suffix' => '</p>' . $edge_case_html5 . '</div>'),
// Multi-byte content *before* the HTML that needs the "active" class.
// Multi-byte content *before* the HTML that needs the "is-active" class.
2 => array('prefix' => '<div><p>αβγδεζηθικλμνξοσὠ</p><p>', 'suffix' => '</p></div>'),
);
$tags = array(
@ -63,8 +63,8 @@ class SystemControllerTest extends UnitTestCase {
'data-drupal-link-system-path=&quot;&lt;front&gt;&quot;',
);
// Define all variations that *do* affect whether or not an "active" class
// is set: all possible situations that can be encountered.
// Define all variations that *do* affect whether or not an "is-active"
// class is set: all possible situations that can be encountered.
$situations = array();
// Situations with context: front page, English, no query.
@ -275,10 +275,10 @@ class SystemControllerTest extends UnitTestCase {
// Build the source markup.
$source_markup = $create_markup(new Attribute($situation['attributes']));
// Build the target markup. If no "active" class should be set, the
// resulting HTML should be identical. Otherwise, it should get an
// "active" class, either by extending an existing "class" attribute
// or by adding a "class" attribute.
// Build the target markup. If no "is-active" class should be set,
// the resulting HTML should be identical. Otherwise, it should get
// an "is-active" class, either by extending an existing "class"
// attribute or by adding a "class" attribute.
$target_markup = NULL;
if (!$situation['is active']) {
$target_markup = $source_markup;
@ -288,7 +288,7 @@ class SystemControllerTest extends UnitTestCase {
if (!isset($active_attributes['class'])) {
$active_attributes['class'] = array();
}
$active_attributes['class'][] = 'active';
$active_attributes['class'][] = 'is-active';
$target_markup = $create_markup(new Attribute($active_attributes));
}
@ -298,21 +298,23 @@ class SystemControllerTest extends UnitTestCase {
}
}
// Test case to verify that the 'active' class is not added multiple times.
// Test case to verify that the 'is-active' class is not added multiple
// times.
$data[] = [
0 => ['#markup' => '<a data-drupal-link-system-path="&lt;front&gt;">Once</a> <a data-drupal-link-system-path="&lt;front&gt;">Twice</a>'],
1 => ['path' => '', 'front' => TRUE, 'language' => 'en', 'query' => []],
2 => ['#markup' => '<a data-drupal-link-system-path="&lt;front&gt;" class="active">Once</a> <a data-drupal-link-system-path="&lt;front&gt;" class="active">Twice</a>'],
2 => ['#markup' => '<a data-drupal-link-system-path="&lt;front&gt;" class="is-active">Once</a> <a data-drupal-link-system-path="&lt;front&gt;" class="is-active">Twice</a>'],
];
// Test cases to verify that the 'active' class is added when on the front
// page, and there are two different kinds of matching links on the page:
// Test cases to verify that the 'is-active' class is added when on the
// front page, and there are two different kinds of matching links on the
// page:
// - the matching path (the resolved front page path)
// - the special matching path ('<front>')
$front_special_link = '<a data-drupal-link-system-path="&lt;front&gt;">Front</a>';
$front_special_link_active = '<a data-drupal-link-system-path="&lt;front&gt;" class="active">Front</a>';
$front_special_link_active = '<a data-drupal-link-system-path="&lt;front&gt;" class="is-active">Front</a>';
$front_path_link = '<a data-drupal-link-system-path="myfrontpage">Front Path</a>';
$front_path_link_active = '<a data-drupal-link-system-path="myfrontpage" class="active">Front Path</a>';
$front_path_link_active = '<a data-drupal-link-system-path="myfrontpage" class="is-active">Front Path</a>';
$data[] = [
0 => ['#markup' => $front_path_link . ' ' . $front_special_link],
1 => ['path' => 'myfrontpage', 'front' => TRUE, 'language' => 'en', 'query' => []],

View File

@ -75,14 +75,14 @@
background-image: url(../../../misc/icons/bebebe/hamburger.svg);
}
.toolbar-bar .toolbar-icon-menu:active:before,
.toolbar-bar .toolbar-icon-menu.active:before {
.toolbar-bar .toolbar-icon-menu.is-active:before {
background-image: url(../../../misc/icons/ffffff/hamburger.svg);
}
.toolbar-bar .toolbar-icon-help:before {
background-image: url(../../../misc/icons/bebebe/questionmark-disc.svg);
}
.toolbar-bar .toolbar-icon-help:active:before,
.toolbar-bar .toolbar-icon-help.active:before {
.toolbar-bar .toolbar-icon-help.is-active:before {
background-image: url(../../../misc/icons/ffffff/questionmark-disc.svg);
}
@ -93,56 +93,56 @@
background-image: url(../../../misc/icons/787878/file.svg);
}
.toolbar-icon-system-admin-content:active:before,
.toolbar-icon-system-admin-content.active:before {
.toolbar-icon-system-admin-content.is-active:before {
background-image: url(../../../misc/icons/000000/file.svg);
}
.toolbar-icon-system-admin-structure:before {
background-image: url(../../../misc/icons/787878/orgchart.svg);
}
.toolbar-icon-system-admin-structure:active:before,
.toolbar-icon-system-admin-structure.active:before {
.toolbar-icon-system-admin-structure.is-active:before {
background-image: url(../../../misc/icons/000000/orgchart.svg);
}
.toolbar-icon-system-themes-page:before {
background-image: url(../../../misc/icons/787878/paintbrush.svg);
}
.toolbar-icon-system-themes-page:active:before,
.toolbar-icon-system-themes-page.active:before {
.toolbar-icon-system-themes-page.is-active:before {
background-image: url(../../../misc/icons/000000/paintbrush.svg);
}
.toolbar-icon-entity-user-collection:before {
background-image: url(../../../misc/icons/787878/people.svg);
}
.toolbar-icon-entity-user-collection:active:before,
.toolbar-icon-entity-user-collection.active:before {
.toolbar-icon-entity-user-collection.is-active:before {
background-image: url(../../../misc/icons/000000/people.svg);
}
.toolbar-icon-system-modules-list:before {
background-image: url(../../../misc/icons/787878/puzzlepiece.svg);
}
.toolbar-icon-system-modules-list:active:before,
.toolbar-icon-system-modules-list.active:before {
.toolbar-icon-system-modules-list.is-active:before {
background-image: url(../../../misc/icons/000000/puzzlepiece.svg);
}
.toolbar-icon-system-admin-config:before {
background-image: url(../../../misc/icons/787878/wrench.svg);
}
.toolbar-icon-system-admin-config:active:before,
.toolbar-icon-system-admin-config.active:before {
.toolbar-icon-system-admin-config.is-active:before {
background-image: url(../../../misc/icons/000000/wrench.svg);
}
.toolbar-icon-system-admin-reports:before {
background-image: url(../../../misc/icons/787878/barchart.svg);
}
.toolbar-icon-system-admin-reports:active:before,
.toolbar-icon-system-admin-reports.active:before {
.toolbar-icon-system-admin-reports.is-active:before {
background-image: url(../../../misc/icons/000000/barchart.svg);
}
.toolbar-icon-help-main:before {
background-image: url(../../../misc/icons/787878/questionmark-disc.svg);
}
.toolbar-icon-help-main:active:before,
.toolbar-icon-help-main.active:before {
.toolbar-icon-help-main.is-active:before {
background-image: url(../../../misc/icons/000000/questionmark-disc.svg);
}
.toolbar .toolbar-bar .toolbar-icon:before {

View File

@ -29,14 +29,14 @@
margin-right: 0;
}
.toolbar .toolbar-tray .menu-item--active-trail > .toolbar-box a,
.toolbar .toolbar-tray a.active {
.toolbar .toolbar-tray a.is-active {
color: #000;
font-weight: bold;
}
/* ----- Toolbar menu tray for viewports less than 320px ------ */
@media screen and (max-width: 319px) {
.toolbar .toolbar-tray-vertical.active {
.toolbar .toolbar-tray-vertical.is-active {
width: 100%;
}
}

View File

@ -183,21 +183,21 @@ body.toolbar-fixed .toolbar .toolbar-tray-horizontal {
/* When the configured standard breakpoint is active and the tray is in a
* vertical position, the tray does not scroll with the page. The contents of
* the tray scroll within the confines of the viewport. */
.toolbar .toolbar-tray-vertical.active,
.toolbar .toolbar-tray-vertical.is-active,
body.toolbar-fixed .toolbar .toolbar-tray-vertical {
height: 100%;
overflow-x: hidden;
overflow-y: auto;
position: fixed;
}
.toolbar .toolbar-tray.active {
.toolbar .toolbar-tray.is-active {
display: block;
}
/* Bring the tray into the viewport. By default it is just off-screen. */
.toolbar-oriented .toolbar-tray-vertical.active {
.toolbar-oriented .toolbar-tray-vertical.is-active {
left: 0; /* LTR */
}
[dir="rtl"] .toolbar-oriented .toolbar-tray-vertical.active {
[dir="rtl"] .toolbar-oriented .toolbar-tray-vertical.is-active {
left: auto;
right: 0;
}

View File

@ -47,7 +47,7 @@
background-image: linear-gradient(rgba(255, 255, 255, 0.125) 20%, transparent 200%);
text-decoration: none;
}
.toolbar .toolbar-bar .toolbar-tab > .toolbar-item.active {
.toolbar .toolbar-bar .toolbar-tab > .toolbar-item.is-active {
background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.25) 20%, transparent 200%);
background-image: linear-gradient(rgba(255, 255, 255, 0.25) 20%, transparent 200%);
}
@ -94,7 +94,7 @@
.toolbar-tray a:hover,
.toolbar-tray a:active,
.toolbar-tray a:focus,
.toolbar-tray a.active
.toolbar-tray a.is-active
{
color: #000;
text-decoration: underline;

View File

@ -135,16 +135,16 @@
var $tab = $(this.model.get('activeTab'));
// Deactivate the previous tab.
$(this.model.previous('activeTab'))
.removeClass('active')
.removeClass('is-active')
.prop('aria-pressed', false);
// Deactivate the previous tray.
$(this.model.previous('activeTray'))
.removeClass('active');
.removeClass('is-active');
// Activate the selected tab.
if ($tab.length > 0) {
$tab
.addClass('active')
.addClass('is-active')
// Mark the tab as pressed.
.prop('aria-pressed', true);
var name = $tab.attr('data-toolbar-tray');
@ -156,7 +156,7 @@
// Activate the associated tray.
var $tray = this.$el.find('[data-toolbar-tray="' + name + '"].toolbar-tray');
if ($tray.length) {
$tray.addClass('active');
$tray.addClass('is-active');
this.model.set('activeTray', $tray.get(0));
}
else {
@ -218,9 +218,9 @@
// Remove data-offset attributes from the trays so they can be refreshed.
$trays.removeAttr('data-offset-left data-offset-right data-offset-top');
// If an active vertical tray exists, mark it as an offset element.
$trays.filter('.toolbar-tray-vertical.active').attr('data-offset-' + edge, '');
$trays.filter('.toolbar-tray-vertical.is-active').attr('data-offset-' + edge, '');
// If an active horizontal tray exists, mark it as an offset element.
$trays.filter('.toolbar-tray-horizontal.active').attr('data-offset-top', '');
$trays.filter('.toolbar-tray-horizontal.is-active').attr('data-offset-top', '');
},
/**

View File

@ -16,7 +16,7 @@
color: #fff;
font-weight: bold;
}
.toolbar .tour-toolbar-tab button.active {
.toolbar .tour-toolbar-tab button.is-active {
background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.25) 20%, transparent 200%);
background-image: linear-gradient(rgba(255, 255, 255, 0.25) 20%, transparent 200%);
}

View File

@ -86,7 +86,7 @@
// Render the state.
var isActive = this.model.get('isActive');
this.$el.find('button')
.toggleClass('active', isActive)
.toggleClass('is-active', isActive)
.prop('aria-pressed', isActive);
return this;
},

View File

@ -10,6 +10,6 @@
background-image: url(../../../misc/icons/bebebe/person.svg);
}
.toolbar-bar .toolbar-icon-user:active:before,
.toolbar-bar .toolbar-icon-user.active:before {
.toolbar-bar .toolbar-icon-user.is-active:before {
background-image: url(../../../misc/icons/ffffff/person.svg);
}

View File

@ -87,7 +87,7 @@ class DisplayPageWebTest extends PluginTestBase {
$this->assertResponse(200);
$element = $this->xpath('//ul[contains(@class, :ul_class)]//a[contains(@class, :a_class)]', array(
':ul_class' => 'tabs primary',
':a_class' => 'active',
':a_class' => 'is-active',
));
$this->assertEqual((string) $element[0], t('Test default tab'));
$this->assertTitle(t('Test default page | Drupal'));
@ -99,7 +99,7 @@ class DisplayPageWebTest extends PluginTestBase {
$this->assertResponse(200);
$element = $this->xpath('//ul[contains(@class, :ul_class)]//a[contains(@class, :a_class)]', array(
':ul_class' => 'tabs primary',
':a_class' => 'active',
':a_class' => 'is-active',
));
$this->assertEqual((string) $element[0], t('Test local tab'));
$this->assertTitle(t('Test local page | Drupal'));

View File

@ -25,7 +25,7 @@
{% if row.separator -%}
{{ row.separator }}
{%- endif %}
<a href="{{ row.url }}"{{ row.attributes.addClass(row.active ? 'active') }}>{{ row.link }}</a>
<a href="{{ row.url }}"{{ row.attributes.addClass(row.active ? 'is-active') }}>{{ row.link }}</a>
{% if options.count %}
({{ row.count }})
{% endif %}

View File

@ -23,7 +23,7 @@
<div class="item-list">
<ul class="views-summary">
{% for row in rows %}
<li><a href="{{ row.url }}"{{ row.attributes.addClass(row.active ? 'active') }}>{{ row.link }}</a>
<li><a href="{{ row.url }}"{{ row.attributes.addClass(row.active ? 'is-active') }}>{{ row.link }}</a>
{% if options.count %}
({{ row.count }})
{% endif %}

2
core/modules/views/views.theme.inc Executable file → Normal file
View File

@ -462,7 +462,7 @@ function template_preprocess_views_view_table(&$variables) {
// what the CSS classes should be.
$variables['fields'][$field] = Html::cleanCssIdentifier($field);
if ($active == $field) {
$variables['fields'][$field] .= ' active';
$variables['fields'][$field] .= ' is-active';
}
// Render the header labels.

View File

@ -479,7 +479,7 @@ td.group-title {
}
.views-displays .tabs.secondary li,
.views-displays .tabs.secondary li.active {
.views-displays .tabs.secondary li.is-active {
background: transparent;
margin-bottom: 5px;
border: 0;
@ -524,7 +524,7 @@ td.group-title {
/**
* Display a red border if the display doesn't validate.
*/
.views-displays .tabs.secondary li.active a.active.error,
.views-displays .tabs.secondary li.is-active a.is-active.error,
.views-displays .tabs.secondary a.error {
border: 2px solid #ed541d;
padding: 1px 6px;
@ -539,8 +539,8 @@ td.group-title {
}
.views-displays .tabs.secondary li a:hover,
.views-displays .tabs.secondary li.active a,
.views-displays .tabs.secondary li.active a.active {
.views-displays .tabs.secondary li.is-active a,
.views-displays .tabs.secondary li.is-active a.is-active {
background-color: #555;
color: #fff;
}

View File

@ -295,7 +295,7 @@ class LocalTaskDefaultTest extends UnitTestCase {
'attributes' => array(
'class' => array(
'example',
'active'
'is-active'
)
)
), $this->localTaskBase->getOptions($route_match));

View File

@ -61,7 +61,7 @@
text-decoration: none;
cursor: pointer;
}
#preview-main-menu-links li a.active {
#preview-main-menu-links li a.is-active {
background: #fff;
border-bottom: none;
}

View File

@ -6,14 +6,14 @@ body {
}
#page,
#main-wrapper,
.region-primary-menu .menu-item a.active,
.region-primary-menu .menu-item a.is-active,
.region-primary-menu .menu-item .menu-item--active-trail a {
background: #ffffff;
}
.tabs ul.primary li a.active {
.tabs ul.primary li a.is-active {
background-color: #ffffff;
}
.tabs ul.primary li.active a {
.tabs ul.primary li.is-active a {
background-color: #ffffff;
border-bottom-color: #ffffff;
}
@ -45,7 +45,7 @@ a:active,
}
.region-header,
.region-header a,
.region-header li a.active,
.region-header li a.is-active,
#name-and-slogan,
.site-branding-block,
#name-and-slogan a,

View File

@ -44,7 +44,7 @@
background: #b3b3b3;
background: rgba(255, 255, 255, 1);
}
.region-primary-menu .menu-item a.active {
.region-primary-menu .menu-item a.is-active {
border-bottom: none;
}
@ -182,7 +182,7 @@ body:not(:target) .region-primary-menu .menu-toggle-target-show:target ~ .menu .
padding: 0.7em 0.8em;
}
.featured .region-primary-menu .menu-item a:active,
.featured .region-primary-menu .menu-item a.active {
.featured .region-primary-menu .menu-item a.is-active {
background: #f0f0f0;
background: rgba(240, 240, 240, 1.0);
}

View File

@ -57,7 +57,7 @@
padding-left: 0;
}
.site-footer .content a,
.site-footer .content a.active {
.site-footer .content a.is-active {
color: #fcfcfc;
color: rgba(255, 255, 255, 0.8);
}

View File

@ -21,7 +21,7 @@ div.tabs {
margin: 0;
text-shadow: 0 1px 0 #fff;
}
.tabs ul.primary li.active a {
.tabs ul.primary li.is-active a {
background-color: #ffffff;
border: 1px solid #bbb;
}
@ -36,7 +36,7 @@ div.tabs {
.tabs ul.primary li a {
padding: 5px 10px;
}
.tabs ul.primary li.active a {
.tabs ul.primary li.is-active a {
border-bottom: none;
}
}
@ -67,7 +67,7 @@ div.tabs {
border-top-left-radius: 6px;
border-top-right-radius: 6px;
}
.tabs ul.primary li.active a {
.tabs ul.primary li.is-active a {
border-bottom: 1px solid #fff;
}
}
@ -106,7 +106,7 @@ div.tabs {
padding: 0.25em 0.5em;
text-decoration: none;
}
.tabs ul.secondary li a.active {
.tabs ul.secondary li a.is-active {
background: #f2f2f2;
border-bottom: none;
border-radius: 5px;

View File

@ -62,7 +62,7 @@
{% for cell in header %}
{%
set cell_classes = [
cell.active_table_sort ? 'active',
cell.active_table_sort ? 'is-active',
]
%}
<{{ cell.tag }}{{ cell.attributes.addClass(cell_classes) }}>

View File

@ -77,38 +77,38 @@ th > a:after {
-webkit-transition: all 0.1s;
transition: all 0.1s;
}
th.active > a {
th.is-active > a {
color: #004875;
}
th.active img {
th.is-active img {
position: absolute;
right: 0; /* LTR */
top: 50%;
}
[dir="rtl"] th.active img {
[dir="rtl"] th.is-active img {
right: auto;
left: 0;
}
th.active > a:after {
th.is-active > a:after {
border-bottom-color: #004875;
}
th > a:hover,
th > a:focus,
th.active > a:hover,
th.active > a:focus {
th.is-active > a:hover,
th.is-active > a:focus {
color: #008ee6;
text-decoration: none;
}
th > a:hover:after,
th > a:focus:after,
th.active > a:hover:after,
th.active > a:focus:after {
th.is-active > a:hover:after,
th.is-active > a:focus:after {
border-bottom-color: #008ee6;
}
td .item-list ul {
margin: 0;
}
td.active {
td.is-active {
background: none;
}

View File

@ -81,14 +81,14 @@ li.tabs__tab a {
margin: 16px 0 0;
margin: 1rem 0 0;
}
.tabs.primary .tabs__tab.active {
.tabs.primary .tabs__tab.is-active {
z-index: 15;
border-color: #a6a6a6;
border-radius: 4px 0 0 0; /* LTR */
background-color: #ffffff;
color: #004f80;
}
[dir="rtl"] .tabs.primary .tabs__tab.active {
[dir="rtl"] .tabs.primary .tabs__tab.is-active {
border-top-left-radius: 0;
border-top-right-radius: 4px;
}
@ -100,7 +100,7 @@ li.tabs__tab a {
background-color: #fafaf7;
text-decoration: underline;
}
.tabs.primary .active a:focus {
.tabs.primary .is-active a:focus {
background: none;
text-decoration: underline;
}
@ -113,7 +113,7 @@ li.tabs__tab a {
[dir="rtl"] .tabs.primary a {
background: url(../../../../misc/icons/0074bd/chevron-left.svg) 1% center no-repeat;
}
.tabs.primary .tabs__tab.active a {
.tabs.primary .tabs__tab.is-active a {
background-image: none;
}
}
@ -157,21 +157,21 @@ li.tabs__tab a {
padding-bottom:16px;
padding-bottom: 1rem;
}
.is-collapse-enabled .tabs__tab.active {
.is-collapse-enabled .tabs__tab.is-active {
position: absolute;
top: 2px;
left: 0; /* LTR */
width: 75%;
border-bottom: 0;
}
[dir="rtl"] .is-collapse-enabled .tabs__tab.active {
[dir="rtl"] .is-collapse-enabled .tabs__tab.is-active {
left: auto;
right: 0;
}
.is-collapse-enabled .tabs.primary a.active:before {
.is-collapse-enabled .tabs.primary a.is-active:before {
content: none;
}
.is-open .tabs__tab.active {
.is-open .tabs__tab.is-active {
border-color: #a6a6a6;
background-color: #ffffff;
color: #004f80;
@ -218,9 +218,9 @@ li.tabs__tab a {
}
/* Override the states above */
.is-horizontal .tabs__tab.active,
.is-horizontal .tabs.primary .tabs__tab.active,
[dir="rtl"] .is-horizontal .tabs.primary .tabs__tab.active {
.is-horizontal .tabs__tab.is-active,
.is-horizontal .tabs.primary .tabs__tab.is-active,
[dir="rtl"] .is-horizontal .tabs.primary .tabs__tab.is-active {
border-radius: 4px 4px 0 0;
position: relative;
width: auto;
@ -259,12 +259,12 @@ li.tabs__tab a {
.tabs.secondary .tabs__tab + .tabs__tab {
border-top: 1px solid #d9d8d4;
}
.tabs.secondary .tabs__tab.active {
.tabs.secondary .tabs__tab.is-active {
color: #004f80;
border-left: 2px solid #004f80; /* LTR */
padding-left: 15px; /* LTR */
}
[dir="rtl"] .tabs.secondary .tabs__tab.active {
[dir="rtl"] .tabs.secondary .tabs__tab.is-active {
border-left: 1px solid #bfbfbf;
border-right: 2px solid #004f80;
padding-right: 15px;
@ -286,7 +286,7 @@ li.tabs__tab a {
padding: 7px 13px 5px;
text-decoration: none;
}
.tabs.secondary .active a {
.tabs.secondary .is-active a {
color: #004f80;
}
.tabs.secondary a:focus {
@ -319,7 +319,7 @@ li.tabs__tab a {
border-left-color: transparent;
padding-right: 0; /* 1 */
}
.is-horizontal .tabs.secondary .tabs__tab.active {
.is-horizontal .tabs.secondary .tabs__tab.is-active {
border-bottom-color: #004f80;
}
.is-horizontal .tabs.secondary .tabs__tab:hover,

View File

@ -96,8 +96,8 @@ details.fieldset-no-legend {
}
.views-displays ul.secondary li a,
.views-displays ul.secondary li.active a,
.views-displays ul.secondary li.active a.active {
.views-displays ul.secondary li.is-active a,
.views-displays ul.secondary li.is-active a.is-active {
padding: 2px 7px 3px;
}
@ -105,8 +105,8 @@ details.fieldset-no-legend {
color: #0074bd;
}
.views-displays ul.secondary li.active a,
.views-displays ul.secondary li.active a.active {
.views-displays ul.secondary li.is-active a,
.views-displays ul.secondary li.is-active a.is-active {
border: 1px solid transparent;
}

View File

@ -66,12 +66,12 @@
[dir="rtl"] .task-list li {
padding: 0.5em 3.85em 0.5em 1em;
}
.task-list .active {
.task-list .is-active {
background: #ebeae4;
position: relative;
font-weight: normal;
}
.task-list .active:after {
.task-list .is-active:after {
left: 100%; /* LTR */
border: solid transparent;
border-color: rgba(235, 234, 228, 0);
@ -85,7 +85,7 @@
top: 50%;
margin-top: -1.32em;
}
[dir="rtl"] .task-list .active:after {
[dir="rtl"] .task-list .is-active:after {
left: auto;
right: 100%;
border-left-color: transparent;

View File

@ -4,7 +4,7 @@
function findActiveStep(steps) {
for (var i = 0; i < steps.length; i++) {
if (steps[i].className === 'active') {
if (steps[i].className === 'is-active') {
return i + 1;
}
}