Skip to content
Snippets Groups Projects
Unverified Commit caa58b26 authored by Kris Booghmans's avatar Kris Booghmans
Browse files

Organize assets and add icon for local tasks.

parent ace514f0
No related branches found
No related tags found
No related merge requests found
Pipeline #425019 passed
......@@ -6,26 +6,6 @@
--icon: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" viewBox="0 0 50 50"><path d="M 24.625 2.03125 C 19.47085 2.1146826 14.290937 3.8936875 10.0625 7.5 C 4.9425 11.866 2.004 18.271 2 25 C 2 25.67 1.99375 26.35375 2.09375 27.09375 L 2.1875 28 L 8.21875 28 L 8.125 26.875 C 7.115 17.541 13.8535 9.16525 23.1875 8.15625 C 28.9275 7.53525 34.58375 9.89 38.21875 14.375 L 33.59375 19 L 47 19 L 47 5.59375 L 42.5 10.09375 C 37.863312 4.6571875 31.251764 1.9239795 24.625 2.03125 z M 41.78125 22 L 41.875 23.125 C 42.885 32.459 36.1465 40.83475 26.8125 41.84375 C 21.0725 42.46475 15.41625 40.11 11.78125 35.625 L 16.40625 31 L 3 31 L 3 44.40625 L 7.5 39.90625 C 15.743 49.57125 30.2725 50.743 39.9375 42.5 C 45.0575 38.134 47.996 31.729 48 25 C 48 24.33 48.00625 23.64625 47.90625 22.90625 L 47.8125 22 L 41.78125 22 z"/></svg>');
}
.admin-toolbar__header.navigation-extra--env {
color: var(--env-color);
border-radius: var(--admin-toolbar-space-8);
background-color: var(--env-background);
}
.admin-toolbar__header.navigation-extra--env .admin-toolbar__logo svg rect {
fill: var(--env-background);
}
.admin-toolbar__header.navigation-extra--env .admin-toolbar__logo svg path {
fill: var(--env-color);
}
.admin-toolbar__header.navigation-extra--env
.toolbar-button.toolbar-button--icon--navigation-version,
.admin-toolbar__header.navigation-extra--env
.toolbar-button.toolbar-button--icon--navigation-version.current,
.admin-toolbar__header.navigation-extra--env
.toolbar-button.toolbar-button--icon--navigation-version.current.is-active {
color: var(--env-color);
background-color: var(--env-background);
.toolbar-button.toolbar-button--icon--navigation-local-tasks {
--icon: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" stroke="currentColor" viewBox="0 0 24 24"><polyline points="21 5 12 14 8 10" style="fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2;"></polyline><path d="M20.94,11A8.26,8.26,0,0,1,21,12a9,9,0,1,1-9-9,8.83,8.83,0,0,1,4,1" style="fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2;"></path></svg>');
}
.admin-toolbar__header.navigation-extra--env {
color: var(--env-color);
border-radius: var(--admin-toolbar-space-8);
background-color: var(--env-background);
}
.admin-toolbar__header.navigation-extra--env .admin-toolbar__logo svg rect {
fill: var(--env-background);
}
.admin-toolbar__header.navigation-extra--env .admin-toolbar__logo svg path {
fill: var(--env-color);
}
.admin-toolbar__header.navigation-extra--env
.toolbar-button.toolbar-button--icon--navigation-version,
.admin-toolbar__header.navigation-extra--env
.toolbar-button.toolbar-button--icon--navigation-version.current,
.admin-toolbar__header.navigation-extra--env
.toolbar-button.toolbar-button--icon--navigation-version.current.is-active {
color: var(--env-color);
background-color: var(--env-background);
}
File moved
navigation_extra:
version: VERSION
css:
theme:
assets/css/navigation_extra.css: {}
navigation_extra_version:
version: VERSION
js:
js/navigation_extra.js: {}
assets/js/navigation_extra_version.js: {}
css:
theme:
css/navigation_extra.css: {}
assets/css/navigation_extra_version.css: {}
dependencies:
- core/once
- core/drupalSettings
......@@ -99,8 +99,6 @@ function navigation_extra_block_alter(&$definitions): void {
* Implements hook_page_attachments().
*/
function navigation_extra_page_attachments(&$page): void {
$page['#attached']['library'][] = 'navigation_extra/navigation_extra';
/** @var \Drupal\navigation_extra\NavigationExtraPluginManagerInterface $navigationExtra */
$navigationExtra = \Drupal::service('navigation_extra.manager');
$navigationExtra->pageAttachments($page);
......
......@@ -126,7 +126,7 @@ class NavigationExtraLocalTasksBlock extends LocalTasksBlock implements Containe
$local_task_items = [
[
'title' => $label,
'class' => 'local-tasks',
'class' => 'navigation-local-tasks',
'below' => $local_task_links,
],
];
......
......@@ -55,4 +55,11 @@ class CommonPlugin extends NavigationExtraPluginBase {
return $elements;
}
/**
* {@inheritdoc}
*/
public function pageAttachments(&$page): void {
$page['#attached']['library'][] = 'navigation_extra/navigation_extra';
}
}
......@@ -835,6 +835,9 @@ class VersionPlugin extends NavigationExtraPluginBase {
* {@inheritdoc}
*/
public function pageAttachments(&$page): void {
$page['#attached']['library'][] = 'navigation_extra/navigation_extra_version';
$environment = $this->getEnvironment();
$page['#attached']['drupalSettings']['navigation_extra']['environment'] = $environment;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment