Nicer slim sidebar transitioning, dark mode fixes, fix tests by making settings taller

This commit is contained in:
Michael Shamoon 2022-09-13 11:47:19 -07:00
parent aa55162e2e
commit e0f93c26d6
6 changed files with 34 additions and 10 deletions

View File

@ -46,7 +46,7 @@ describe('settings', () => {
}) })
}) })
cy.viewport(1024, 1024) cy.viewport(1024, 1600)
cy.visit('/settings') cy.visit('/settings')
cy.wait('@savedViews') cy.wait('@savedViews')
}) })

View File

@ -237,7 +237,7 @@
</div> </div>
</nav> </nav>
<main role="main" class="ms-sm-auto px-md-4" [ngClass]="slimSidebarEnabled ? 'col slim' : 'col-md-9 col-lg-10'"> <main role="main" class="ms-sm-auto px-md-4" [ngClass]="slimSidebarEnabled ? 'col-slim' : 'col-md-9 col-lg-10'">
<router-outlet></router-outlet> <router-outlet></router-outlet>
</main> </main>
</div> </div>

View File

@ -1,3 +1,6 @@
@import "node_modules/bootstrap/scss/functions";
@import "node_modules/bootstrap/scss/variables";
/* /*
* Sidebar * Sidebar
*/ */
@ -15,7 +18,6 @@
height: 0.8em; height: 0.8em;
} }
// These come from the col-md-3 col-lg-2 classes for regular sidebar, needed for animation // These come from the col-md-3 col-lg-2 classes for regular sidebar, needed for animation
@media (min-width: 768px) { @media (min-width: 768px) {
max-width: 25%; max-width: 25%;
@ -25,7 +27,7 @@
max-width: 16.66666667%; max-width: 16.66666667%;
} }
transition: all .3s ease; transition: all .2s ease;
} }
@media (max-width: 767.98px) { @media (max-width: 767.98px) {
.sidebar { .sidebar {
@ -33,6 +35,10 @@
} }
} }
main {
transition: all .2s ease;
}
.sidebar-slim-toggler { .sidebar-slim-toggler {
display: none; // hide on mobile display: none; // hide on mobile
} }
@ -45,8 +51,8 @@
} }
} }
.col.slim { .col-slim {
margin-left: 50px !important; padding-left: calc(50px + $grid-gutter-width) !important;
} }
.sidebar-slim-toggler { .sidebar-slim-toggler {

View File

@ -22,7 +22,7 @@ $paperless-card-breakpoints: (
); );
.row-cols-paperless-cards { .row-cols-paperless-cards {
// xs, we dont want in .col.slim block // xs, we dont want in .col-slim block
> * { > * {
flex: 0 0 auto; flex: 0 0 auto;
width: calc(100% / 2); width: calc(100% / 2);
@ -38,12 +38,12 @@ $paperless-card-breakpoints: (
} }
} }
::ng-deep .col.slim .row-cols-paperless-cards { ::ng-deep .col-slim .row-cols-paperless-cards {
@each $width, $n_cols in $paperless-card-breakpoints { @each $width, $n_cols in $paperless-card-breakpoints {
@media(min-width: $width) { @media(min-width: $width) {
> * { > * {
flex: 0 0 auto; flex: 0 0 auto;
width: calc(100% / ($n-cols + 1)); width: calc(100% / ($n-cols + 1)) !important;
} }
} }
} }

View File

@ -1,9 +1,9 @@
// bs options // bs options
$enable-negative-margins: true; $enable-negative-margins: true;
@import "theme";
@import "node_modules/bootstrap/scss/bootstrap"; @import "node_modules/bootstrap/scss/bootstrap";
@import "~@ng-select/ng-select/themes/default.theme.css"; @import "~@ng-select/ng-select/themes/default.theme.css";
@import "theme";
@import "print"; @import "print";
// Paperless-ngx styles // Paperless-ngx styles
@ -84,6 +84,15 @@ svg.logo {
} }
} }
.btn-dark {
--bs-btn-color: var(--bs-gray-600);
--bs-btn-bg: var(--bs-gray-200);
--bs-btn-border-color: var(--bs-gray-200);
--bs-btn-hover-bg: var(--bs-gray-400);
--bs-btn-hover-border-color: var(--bs-gray-500);
--bs-btn-active-bg: var(--bs-gray-200);
}
.text-primary { .text-primary {
color: var(--bs-primary) !important; color: var(--bs-primary) !important;
} }

View File

@ -79,6 +79,15 @@ $form-check-radio-checked-bg-image-dark: url("data:image/svg+xml,<svg xmlns='htt
} }
} }
.btn-dark {
--bs-btn-color: $text-color-dark-bg;
--bs-btn-bg: var(--pngx-bg-alt);
--bs-btn-border-color: var(--pngx-bg-alt);
--bs-btn-hover-bg: var(--bs-light);
--bs-btn-hover-border-color: var(--pngx-bg-darker);
--bs-btn-active-bg: var(--pngx-bg-alt);
}
.btn-outline-primary { .btn-outline-primary {
&:hover, &:focus, &.active, &:active { &:hover, &:focus, &.active, &:active {
color: var(--bs-light) !important; color: var(--bs-light) !important;