naive-ui/styles/Layout.scss

134 lines
3.4 KiB
SCSS
Raw Normal View History

2019-11-18 18:37:20 +08:00
@import './mixins/mixins.scss';
@include themes-mixin {
@include b(layout) {
2019-11-28 14:03:12 +08:00
@include once {
box-sizing: border-box;
position: relative;
display: flex;
flex-wrap: nowrap;
transition: margin-left .3s $--n-ease-in-out-cubic-bezier;
2019-11-28 14:03:12 +08:00
flex-direction: column;
overflow: auto;
@include m(has-sider) {
flex-direction: row;
& > {
@include b(layout) {
flex: 1;
}
}
2019-11-18 18:37:20 +08:00
}
2019-11-28 14:03:12 +08:00
@include m(absolute-positioned) {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
@include b(layout-sider) {
z-index: 1;
}
2019-11-28 14:03:12 +08:00
}
2019-11-18 18:37:20 +08:00
}
}
@include b(layout-header) {
2019-11-28 14:03:12 +08:00
@include once {
transition: background-color .3s $--n-ease-in-out-cubic-bezier, border-color .3s $--n-ease-in-out-cubic-bezier;
2019-11-28 14:03:12 +08:00
box-sizing: border-box;
width: 100%;
@include m(absolute-positioned) {
position: absolute;
left: 0;
right: 0;
top: 0;
}
2019-11-18 18:37:20 +08:00
}
2019-11-28 14:03:12 +08:00
background-color: $--layout-header-background-color;
2019-11-18 18:37:20 +08:00
@include m(bordered) {
2019-11-28 14:03:12 +08:00
border-bottom: solid 1px $--layout-header-border-color;
2019-11-18 18:37:20 +08:00
}
}
@include b(layout-content) {
2019-11-28 14:03:12 +08:00
@include once {
box-sizing: border-box;
position: relative;
}
transition: margin-left .3s $--n-ease-in-out-cubic-bezier;
2019-11-18 18:37:20 +08:00
}
@include b(layout-footer) {
2019-11-28 14:03:12 +08:00
@include once {
transition: border-color .3s $--n-ease-in-out-cubic-bezier;
2019-11-28 14:03:12 +08:00
box-sizing: border-box;
@include m(absolute-positioned) {
position: absolute;
left: 0;
right: 0;
bottom: 0;
}
2019-11-26 19:16:10 +08:00
}
2019-11-28 14:03:12 +08:00
@include m(bordered) {
border-top: solid 1px $--layout-footer-border-color;
}
2019-11-18 18:37:20 +08:00
}
@include b(layout-sider) {
2019-11-28 14:03:12 +08:00
@include once {
box-sizing: border-box;
position: relative;
transition: min-width .3s $--n-ease-in-out-cubic-bezier, max-width .3s $--n-ease-in-out-cubic-bezier, transform .3s $--n-ease-in-out-cubic-bezier, background-color .3s $--n-ease-in-out-cubic-bezier, border-color .3s $--n-ease-in-out-cubic-bezier;
2019-11-28 14:03:12 +08:00
}
background-color: $--layout-sider-background-color;
2019-11-18 18:37:20 +08:00
@include e(toggle-button) {
2019-11-28 14:03:12 +08:00
@include once {
z-index: 1;
transition: transform .3s $--n-ease-in-out-cubic-bezier;
2019-11-28 14:03:12 +08:00
cursor: pointer;
width: 36px;
height: 36px;
position: absolute;
top: 50%;
right: 0;
transform: translateX(50%) translateY(-50%);
}
2019-11-18 18:37:20 +08:00
path {
2019-11-28 14:03:12 +08:00
@include once {
transition: fill .3s $--n-ease-in-out-cubic-bezier;
2019-11-28 14:03:12 +08:00
}
fill: $--layout-sider-toggle-button-fill;
2019-11-18 18:37:20 +08:00
}
}
2019-11-28 14:03:12 +08:00
@include once {
@include e(content) {
2019-11-28 14:03:12 +08:00
opacity: 0;
transition: opacity .3s $--n-ease-in-out-cubic-bezier;
}
}
2019-11-28 14:03:12 +08:00
@include once {
@include m(show-content) {
@include e(content) {
opacity: 1;
}
}
@include m(collapsed) {
@include e(toggle-button) {
transform: translateX(50%) translateY(-50%) rotate(180deg);
}
}
@include m(absolute-positioned) {
position: absolute;
left: 0;
top: 0;
bottom: 0;
@include e(content) {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
overflow: auto;
}
2019-11-18 18:37:20 +08:00
}
}
2019-11-28 14:03:12 +08:00
@include m(bordered) {
border-right: solid 1px $--layout-sider-border-color;
2019-11-18 18:37:20 +08:00
}
}
}