From 34cf3fe1f6d9e7838c8e5c40432044c643253493 Mon Sep 17 00:00:00 2001 From: John Rassa Date: Tue, 11 Jun 2024 12:33:17 -0400 Subject: [PATCH] style: style updates for navbar --- src/app/app.config.ts | 6 ++-- src/app/common/flyout/flyout.component.scss | 4 +-- .../table/sidebar/sidebar.component.scss | 13 ++++--- .../site-navbar/site-navbar.component.html | 12 ++++--- .../site-navbar/site-navbar.component.scss | 36 ++++++------------- src/styles/_mixins.scss | 14 -------- src/styles/_shared.scss | 1 + src/styles/bootstrap/_nav.scss | 11 ------ 8 files changed, 34 insertions(+), 63 deletions(-) diff --git a/src/app/app.config.ts b/src/app/app.config.ts index 2d7c5ecc..c1a5a374 100644 --- a/src/app/app.config.ts +++ b/src/app/app.config.ts @@ -1,6 +1,6 @@ import { provideHttpClient, withInterceptors, withInterceptorsFromDi } from '@angular/common/http'; import { ApplicationConfig, importProvidersFrom } from '@angular/core'; -import { provideAnimations } from '@angular/platform-browser/animations'; +import { provideAnimations, provideNoopAnimations } from '@angular/platform-browser/animations'; import { TitleStrategy, provideRouter, @@ -31,10 +31,12 @@ import { import { provideTeamsFeature } from './core/teams/provider'; import { provideExampleSiteFeature } from './site/example/provider'; +const disableAnimations: boolean = window.matchMedia('(prefers-reduced-motion: reduce)').matches; + export const appConfig: ApplicationConfig = { providers: [ importProvidersFrom(BsDatepickerModule.forRoot(), TooltipModule.forRoot()), - provideAnimations(), + !disableAnimations ? provideAnimations() : provideNoopAnimations(), provideHttpClient( withInterceptors([ signinInterceptor, diff --git a/src/app/common/flyout/flyout.component.scss b/src/app/common/flyout/flyout.component.scss index 5f6888df..be7f65da 100644 --- a/src/app/common/flyout/flyout.component.scss +++ b/src/app/common/flyout/flyout.component.scss @@ -12,7 +12,7 @@ $flyout-bottom-bottom: 20px * 2 !default; position: fixed; right: 0; top: $flyout-right-top; - transition: left 0.15s ease-in-out, right 0.15s ease-in-out; + @include transition(left 0.15s ease-in-out, right 0.15s ease-in-out); z-index: $zindex-popover; &[placement='left'] { @@ -116,5 +116,5 @@ $flyout-bottom-bottom: 20px * 2 !default; max-height: calc(100vh - 100px); } - transition: width 1s ease-in-out, height 1s ease-in-out; + @include transition(width 1s ease-in-out, height 1s ease-in-out); } diff --git a/src/app/common/table/sidebar/sidebar.component.scss b/src/app/common/table/sidebar/sidebar.component.scss index 5812fc4c..f7690346 100644 --- a/src/app/common/table/sidebar/sidebar.component.scss +++ b/src/app/common/table/sidebar/sidebar.component.scss @@ -1,6 +1,5 @@ @use 'sass:map'; @import '../../../../styles/shared'; -@import '../../../../styles/bootstrap/shared'; $sidebar-width: 250px !default; $sidebar-transition-duration: 0.15s !default; @@ -13,19 +12,23 @@ $sidebar-transition-duration: 0.15s !default; width: 0; min-width: 0; - transition: width $sidebar-transition-duration ease-in-out, + @include transition( + width $sidebar-transition-duration ease-in-out, min-width $sidebar-transition-duration ease-in-out, margin-left $sidebar-transition-duration ease-in-out, - opacity 0s ease-in-out $sidebar-transition-duration; + opacity 0s ease-in-out $sidebar-transition-duration + ); &.sidebar-open { margin-left: map.get($spacers, 3); opacity: 1; width: $sidebar-width; min-width: $sidebar-width; - transition: width $sidebar-transition-duration ease-in-out, + @include transition( + width $sidebar-transition-duration ease-in-out, min-width $sidebar-transition-duration ease-in-out, - margin-left $sidebar-transition-duration ease-in-out; + margin-left $sidebar-transition-duration ease-in-out + ); &.sidebar-left { margin-left: 0; diff --git a/src/app/core/site-navbar/site-navbar.component.html b/src/app/core/site-navbar/site-navbar.component.html index d7f6d6ae..065f57bf 100644 --- a/src/app/core/site-navbar/site-navbar.component.html +++ b/src/app/core/site-navbar/site-navbar.component.html @@ -1,16 +1,16 @@