Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
xnavigation
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
xnavigation
Commits
6016b8ae
Commit
6016b8ae
authored
3 months ago
by
Jacques R. Blier
Browse files
Options
Downloads
Patches
Plain Diff
Resolve
#3478945
"Separate color schemes"
parent
1e1f4c33
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!6
Resolve #3478945 "Separate color schemes"
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
css/xnavigation.css
+0
-97
0 additions, 97 deletions
css/xnavigation.css
xnavigation.libraries.yml
+12
-3
12 additions, 3 deletions
xnavigation.libraries.yml
xnavigation.module
+16
-3
16 additions, 3 deletions
xnavigation.module
with
28 additions
and
103 deletions
css/xnavigation.css
deleted
100644 → 0
+
0
−
97
View file @
1e1f4c33
#admin-toolbar
.xnavigation-blackstone
.toolbar-menu--level-2
{
box-shadow
:
none
;
}
#admin-toolbar
.xnavigation-blackstone
.toolbar-button
{
color
:
white
;
}
#admin-toolbar
.xnavigation-blackstone
.toolbar-menu__link
,
#admin-toolbar
.xnavigation-blackstone
+
nav
#menu-footer
.admin-toolbar__footer
.toolbar-button
{
color
:
#797167
;
}
#admin-toolbar
.xnavigation-blackstone
,
#admin-toolbar
.xnavigation-blackstone
.admin-toolbar__header
,
#admin-toolbar
.xnavigation-blackstone
.toolbar-button
,
#admin-toolbar
.xnavigation-blackstone
>
nav
,
#admin-toolbar
.xnavigation-blackstone
+
nav
,
#admin-toolbar
.xnavigation-blackstone
.toolbar-popover__wrapper
,
#admin-toolbar
.xnavigation-blackstone
.toolbar-menu__item--level-1
,
#admin-toolbar
.xnavigation-blackstone
.toolbar-menu--level-2
,
#admin-toolbar
.xnavigation-blackstone
+
nav
.toolbar-popover__wrapper
,
#admin-toolbar
.xnavigation-blackstone
+
nav
#menu-footer
.admin-toolbar__footer
.toolbar-button
{
background
:
#1D1E1C
;
}
#admin-toolbar
.xnavigation-blackstone
.toolbar-popover__header
{
color
:
#4E4943
;
}
#admin-toolbar
.xnavigation-blackstone
.toolbar-block
:nth-last-child
(
n
+
2
)
::after
{
border-top
:
2px
solid
#43352C
;
}
#admin-toolbar
.xnavigation-blackstone
button
,
#admin-toolbar
.xnavigation-blackstone
+
nav
.toolbar-popover__wrapper
button
{
background
:
#594739
;
}
#admin-toolbar
.xnavigation-blackstone
+
nav
{
border-top-color
:
#43352C
;
}
#admin-toolbar
#menu-builder
.xnavigation-blackstone
,
#admin-toolbar
.xnavigation-blackstone
+
nav
#menu-footer
{
border-right-color
:
#43352C
;
}
/* Slate */
#admin-toolbar
.xnavigation-slate
.toolbar-menu--level-2
{
box-shadow
:
none
;
}
#admin-toolbar
.xnavigation-slate
.toolbar-button
{
color
:
white
;
}
#admin-toolbar
.xnavigation-slate
.toolbar-menu__link
,
#admin-toolbar
.xnavigation-slate
+
nav
#menu-footer
.admin-toolbar__footer
.toolbar-button
{
color
:
#9498A1
;
}
#admin-toolbar
.xnavigation-slate
,
#admin-toolbar
.xnavigation-slate
.admin-toolbar__header
,
#admin-toolbar
.xnavigation-slate
.toolbar-button
,
#admin-toolbar
.xnavigation-slate
>
nav
,
#admin-toolbar
.xnavigation-slate
+
nav
,
#admin-toolbar
.xnavigation-slate
.toolbar-popover__wrapper
,
#admin-toolbar
.xnavigation-slate
.toolbar-menu__item--level-1
,
#admin-toolbar
.xnavigation-slate
.toolbar-menu--level-2
,
#admin-toolbar
.xnavigation-slate
+
nav
.toolbar-popover__wrapper
,
#admin-toolbar
.xnavigation-slate
+
nav
#menu-footer
.admin-toolbar__footer
.toolbar-button
{
background
:
#122537
;
}
#admin-toolbar
.xnavigation-slate
.toolbar-popover__header
{
color
:
#74563B
;
}
#admin-toolbar
.xnavigation-slate
.toolbar-block
:nth-last-child
(
n
+
2
)
::after
{
border-top
:
2px
solid
#2D4459
;
}
#admin-toolbar
.xnavigation-slate
button
,
#admin-toolbar
.xnavigation-slate
+
nav
.toolbar-popover__wrapper
button
{
background
:
#74563B
;
}
#admin-toolbar
.xnavigation-slate
+
nav
{
border-top-color
:
#2D4459
;
}
#admin-toolbar
#menu-builder
.xnavigation-slate
,
#admin-toolbar
.xnavigation-slate
+
nav
#menu-footer
{
border-right-color
:
#2D4459
;
}
This diff is collapsed.
Click to expand it.
xnavigation.libraries.yml
+
12
−
3
View file @
6016b8ae
xnavigation
:
version
:
1.x
css
:
theme
:
css/xnavigation.css
:
{}
js
:
js/xnavigation.js
:
{
}
dependencies
:
-
core/jquery
-
core/drupal
xnavigation.blackstone
:
version
:
1.x
css
:
theme
:
css/xnavigation-blackstone.css
:
{}
xnavigation.slate
:
version
:
1.x
css
:
theme
:
css/xnavigation-slate.css
:
{}
This diff is collapsed.
Click to expand it.
xnavigation.module
+
16
−
3
View file @
6016b8ae
<?php
use
Drupal\Core\Routing\RouteMatchInterface
;
use
const
var_dump
as
var_dumpAlias
;
/**
* Implements hook_help().
...
...
@@ -36,14 +37,26 @@ function xnavigation_preprocess_block(&$variables) {
* Implements hook_page_attachments().
*/
function
xnavigation_page_attachments
(
array
&
$attachments
)
{
$attachments
[
'#attached'
][
'library'
][]
=
'xnavigation/xnavigation'
;
// Load the xNavigation settings.
$config
=
\Drupal
::
config
(
'xnavigation.settings'
);
// Get the selected color scheme.
$color_scheme
=
$config
->
get
(
'color_scheme'
)
??
'blackstone'
;
// Attach the site-wide library.
$attachments
[
'#attached'
][
'library'
][]
=
'xnavigation/xnavigation'
;
// Dynamically add the CSS file based on the selected color scheme.
switch
(
$color_scheme
)
{
case
'slate'
:
$attachments
[
'#attached'
][
'library'
][]
=
'xnavigation/xnavigation.slate'
;
break
;
case
'blackstone'
:
default
:
$attachments
[
'#attached'
][
'library'
][]
=
'xnavigation/xnavigation.blackstone'
;
break
;
}
// Pass the color scheme setting to JavaScript.
$attachments
[
'#attached'
][
'drupalSettings'
][
'xNavigation'
][
'color_scheme'
]
=
$color_scheme
;
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment