fix(layout):transition &background-color

This commit is contained in:
songwanli2025@163.com 2019-12-27 17:29:49 +08:00
parent a78dca19cf
commit 5565f59d58
9 changed files with 14 additions and 11 deletions

View File

@ -129,7 +129,6 @@ export default {
align-items: center;
padding-left: 44px;
font-size: 18px;
transition: color .3s cubic-bezier(.4, 0, .2, 1);
}
.ui-logo > img {
margin-right: 12px;

View File

@ -4,6 +4,7 @@
:class="{
[`n-layout--${mode}-positioned`]: mode,
'n-layout--has-sider': hasSider,
[`n-${synthesizedTheme}-theme`]: synthesizedTheme
}"
:style="{
marginLeft: styleMarginLeft,
@ -19,10 +20,12 @@
<script>
import layoutModeMixin from './layoutModeMixin'
import themeable from '../../../mixins/themeable'
import withapp from '../../../mixins/withapp'
export default {
name: 'NLayout',
mixins: [ layoutModeMixin ],
mixins: [ withapp, themeable, layoutModeMixin ],
provide () {
return {
NLayout: this

View File

@ -15,7 +15,7 @@
width: styleWidth,
}"
>
<n-scrollbar v-if="!useNativeScrollbar">
<n-scrollbar v-if="!useNativeScrollbar" class="n-layout-sider__content">
<slot />
</n-scrollbar>
<div v-else class="n-layout-sider__content">
@ -156,11 +156,8 @@ export default {
} else {
this.styleWidth = `${this.width}px`
}
},
mounted () {
const NLayout = this.NLayout
if (NLayout) {
NLayout.blockChildLayoutTransitionOneTick()
NLayout.hasSider = true
NLayout.siderWidth = this.width
NLayout.collapsedSiderWidth = this.collapsedWidth

View File

@ -2,12 +2,14 @@
@include themes-mixin {
@include b(layout) {
color: $--layout-text-color;
background-color: $--layout-back-color;
@include once {
box-sizing: border-box;
position: relative;
display: flex;
flex-wrap: nowrap;
transition: margin-left .3s $--n-ease-in-out-cubic-bezier;
transition: margin-left .3s $--n-ease-in-out-cubic-bezier, background-color .3s $--n-ease-in-out-cubic-bezier, color .3s $--n-ease-in-out-cubic-bezier;
flex-direction: column;
overflow: auto;
@include m(has-sider) {

View File

@ -117,7 +117,7 @@ $layout-nav-height: 64px;
top: calc(50% - 3px);
transform: rotate(45deg) ;
transform-origin: 25% 25%;
transition: transform 0.3s $--n-ease-in-out-cubic-bezier, opacity 0.3s $--n-ease-in-out-cubic-bezier;
transition: transform 0.3s $--n-ease-in-out-cubic-bezier, opacity 0.3s $--n-ease-in-out-cubic-bezier, border-color 0.3s $--n-ease-in-out-cubic-bezier;
}
@include m(collapsed) {
&::after {

View File

@ -2,8 +2,6 @@
@include themes-mixin() {
@include b(new-nimbus-service-layout) {
color: $service-layout-color;
background-color: $service-layout-body-background-color;
@include e(header) {
height: 64px;
@include m(hide) {

View File

@ -15,7 +15,7 @@
overflow: scroll;
height: 100%;
max-height: inherit;
scrollbar-width: 0;
scrollbar-width: none;
&::-webkit-scrollbar {
width: 0;
height: 0;

View File

@ -1,4 +1,6 @@
@mixin setup-dark-layout {
$--layout-text-color: $--n-secondary-text-color !global;
$--layout-back-color: $--n-background-color !global;
$--layout-header-background-color: $--n-card-color !global;
$--layout-header-border-color: $--n-divider-color !global;
$--layout-footer-border-color: $--n-divider-color !global;

View File

@ -1,4 +1,6 @@
@mixin setup-light-layout {
$--layout-text-color: $--n-secondary-text-color !global;
$--layout-back-color: $--neutral-9 !global;
$--layout-header-background-color: $--n-card-color !global;
$--layout-header-border-color: $--n-divider-color !global;
$--layout-footer-border-color: $--n-divider-color !global;