Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sb-sidenav-primary style #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 30 additions & 1 deletion dist/css/styles.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@charset "UTF-8";
/*!
* Start Bootstrap - SB Admin v7.0.7 (https://startbootstrap.com/template/sb-admin)
* Copyright 2013-2023 Start Bootstrap
* Copyright 2013-2024 Start Bootstrap
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just updated by the generation scripts.

* Licensed under MIT (https://github.com/StartBootstrap/startbootstrap-sb-admin/blob/master/LICENSE)
*/
/*!
Expand Down Expand Up @@ -11076,6 +11076,35 @@ body {
background-color: #e9ecef;
}

.sb-sidenav-primary {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This whole file is generated.

background-color: #0d6efd;
color: rgba(255, 255, 255, 0.9);
}
.sb-sidenav-primary .sb-sidenav-menu .sb-sidenav-menu-heading {
color: rgba(255, 255, 255, 0.8);
}
.sb-sidenav-primary .sb-sidenav-menu .nav-link {
color: rgba(255, 255, 255, 0.9);
}
.sb-sidenav-primary .sb-sidenav-menu .nav-link .sb-nav-link-icon {
color: rgba(255, 255, 255, 0.8);
}
.sb-sidenav-primary .sb-sidenav-menu .nav-link .sb-sidenav-collapse-arrow {
color: rgba(255, 255, 255, 0.8);
}
.sb-sidenav-primary .sb-sidenav-menu .nav-link:hover {
color: #fff;
}
.sb-sidenav-primary .sb-sidenav-menu .nav-link.active {
color: #fff;
}
.sb-sidenav-primary .sb-sidenav-menu .nav-link.active .sb-nav-link-icon {
color: #fff;
}
.sb-sidenav-primary .sb-sidenav-footer {
background-color: #052c65;
}

.datatable-wrapper .datatable-container {
font-size: 0.875rem;
}
Expand Down
2 changes: 1 addition & 1 deletion dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
</nav>
<div id="layoutSidenav">
<div id="layoutSidenav_nav">
<nav class="sb-sidenav accordion sb-sidenav-dark" id="sidenavAccordion">
<nav class="sb-sidenav accordion sb-sidenav-primary" id="sidenavAccordion">
<div class="sb-sidenav-menu">
<div class="nav">
<div class="sb-sidenav-menu-heading">Core</div>
Expand Down
2 changes: 1 addition & 1 deletion dist/js/scripts.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* Start Bootstrap - SB Admin v7.0.7 (https://startbootstrap.com/template/sb-admin)
* Copyright 2013-2023 Start Bootstrap
* Copyright 2013-2024 Start Bootstrap
* Licensed under MIT (https://github.com/StartBootstrap/startbootstrap-sb-admin/blob/master/LICENSE)
*/
//
Expand Down
2 changes: 1 addition & 1 deletion src/pug/pages/index.pug
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ block config
- var bodyClass = 'sb-nav-fixed'
- var pageTitle = 'Dashboard';
- var index = true;
- var sidenavStyle = 'sb-sidenav-dark'
- var sidenavStyle = 'sb-sidenav-primary'
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To preview it in this repo at index.html.


prepend css
//- Load Simple DataTables Stylesheet
Expand Down
8 changes: 8 additions & 0 deletions src/scss/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,16 @@
// Variables
//

// See https://getbootstrap.com/docs/5.0/customize/sass/#importing

// Import Bootstrap variables for use within theme
// 1. Include functions first (so you can manipulate colors, SVGs, calc, etc)
@import "bootstrap/scss/functions.scss";

// 2. Include any default variable overrides here


// 3. Include remainder of required Bootstrap stylesheets
@import "bootstrap/scss/variables.scss";

// Import spacing variables
Expand Down
45 changes: 45 additions & 0 deletions src/scss/navigation/sidenav/_sidenav-primary.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
//
// Sidenav Primary
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a new file for the sb-sidenav-primary style, based on sb-sidenav-dark.

//

// Primary color theme for sidenav
// Append .sb-sidenav-primary to .sb-sidenav to use

.sb-sidenav-primary {
background-color: $sidenav-primary-bg;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perhaps if we add below or in place of background-color:

background-image: linear-gradient(180deg, #4e73df 10%, #224abe 100%);

that would bring back that slightly paler blue from the sb-admin-2 theme

color: $sidenav-primary-color;

.sb-sidenav-menu {
.sb-sidenav-menu-heading {
color: $sidenav-primary-heading-color;
}

.nav-link {
color: $sidenav-primary-link-color;

.sb-nav-link-icon {
color: $sidenav-primary-icon-color;
}

.sb-sidenav-collapse-arrow {
color: $sidenav-primary-icon-color;
}

&:hover {
color: $sidenav-primary-link-active-color;
}

&.active {
color: $sidenav-primary-link-active-color;

.sb-nav-link-icon {
color: $sidenav-primary-link-active-color;
}
}
}
}

.sb-sidenav-footer {
background-color: $sidenav-primary-footer-bg;
}
}
5 changes: 4 additions & 1 deletion src/scss/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
// Styles
//

// Import Custom Variables
// See https://getbootstrap.com/docs/5.0/customize/sass/#importing

// Import Custom Variables (note that this imports some bootstrap variables too)
@import "variables.scss";

// Import Bootstrap
Expand All @@ -23,6 +25,7 @@
@import "navigation/sidenav/sidenav.scss";
@import "navigation/sidenav/sidenav-dark.scss";
@import "navigation/sidenav/sidenav-light.scss";
@import "navigation/sidenav/sidenav-primary.scss";

// Plugins
@import "plugins/simple-datatables.scss";
9 changes: 9 additions & 0 deletions src/scss/variables/_navigation.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@ $sidenav-light-link-active-color: $primary;
$sidenav-light-icon-color: $gray-500;
$sidenav-light-footer-bg: $gray-200;

// -- Sidenav Dark
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New scss variables for our new style.

$sidenav-primary-bg: $primary;
$sidenav-primary-color: fade-out($white, 0.1);
$sidenav-primary-heading-color: fade-out($white, 0.2);
$sidenav-primary-link-color: fade-out($white, 0.1);
$sidenav-primary-link-active-color: $white;
$sidenav-primary-icon-color: fade-out($white, 0.2);
$sidenav-primary-footer-bg: $blue-800;

// Color variables for the topnav
$topnav-dark-toggler-color: fade-out($white, 0.5);
$topnav-light-toggler-color: $gray-900;