Skip to content

Commit cb84827

Browse files
committed
Add helper function to return sidebar class
1 parent 5e5c044 commit cb84827

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

‎helpers.php‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,25 @@ function color($key)
8787
}
8888
}
8989

90+
if (!function_exists('sidebar_class')) {
91+
/**
92+
* Returns the class for the sidebar based on admin settings.
93+
*
94+
* @return boolean
95+
*/
96+
function sidebar_class()
97+
{
98+
if (config('css-override.variables')) {
99+
$defaults = ['#0872C2', '#2773F3'];
100+
if (! in_array(color('primary'), $defaults)) {
101+
return 'sidebar-custom';
102+
}
103+
}
104+
105+
return 'sidebar-default';
106+
}
107+
}
108+
90109
if (!function_exists('refresh_artisan_caches')) {
91110
/**
92111
* Re-caches artisan config, routes, and/or events when they are already cached.

0 commit comments

Comments
 (0)