naive-ui/styles/Layout.scss

212 lines
5.5 KiB
SCSS
Raw Normal View History

2019-11-18 18:37:20 +08:00
@import './mixins/mixins.scss';
@include themes-mixin {
@include b(layout) {
color: $--layout-text-color;
background-color: $--layout-background-color;
2019-11-28 14:03:12 +08:00
@include once {
box-sizing: border-box;
position: relative;
z-index: auto;
2020-02-27 18:09:23 +08:00
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: auto;
overflow-x: hidden;
2019-11-28 14:03:12 +08:00
@include m(has-sider) {
display: flex;
flex-wrap: nowrap;
width: 100%;
2019-11-28 14:03:12 +08:00
flex-direction: row;
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 {
2020-02-27 18:09:23 +08:00
transition:
background-color .3s $--n-ease-in-out-cubic-bezier,
2020-03-05 22:31:20 +08:00
box-shadow .3s $--n-ease-in-out-cubic-bezier,
2020-02-27 18:09:23 +08:00
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;
z-index: auto;
2019-11-28 14:03:12 +08:00
}
2020-02-27 18:09:23 +08:00
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;
2019-11-18 18:37:20 +08:00
}
@include b(layout-footer) {
2019-11-28 14:03:12 +08:00
@include once {
2020-02-27 18:09:23 +08:00
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;
@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;
z-index: auto;
2020-02-27 18:09:23 +08:00
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,
2020-03-21 15:05:26 +08:00
background-color .3s $--n-ease-in-out-cubic-bezier;
@include e(border) {
position: absolute;
top: 0;
right: 0;
bottom: 0;
width: 1px;
transition: background-color .3s $--n-ease-in-out-cubic-bezier;
}
2019-11-28 14:03:12 +08:00
}
background-color: $--layout-sider-background-color;
2020-03-21 15:05:26 +08:00
@include b(layout-toggle-button) {
2019-11-28 14:03:12 +08:00
@include once {
z-index: 1;
2020-02-21 14:59:17 +08:00
transition:
transform .3s $--n-ease-in-out-cubic-bezier,
fill .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%);
}
2020-02-21 14:59:17 +08:00
fill: $--layout-sider-toggle-button-fill;
}
2020-03-21 15:05:26 +08:00
@include b(layout-toggle-bar) {
@include once {
cursor: pointer;
height: 72px;
width: 32px;
position: absolute;
top: calc(50% - 36px);
right: -28px;
@include e(top, bottom) {
position: absolute;
width: 4px;
border-radius: 2px;
height: 38px;
left: 14px;
transition:
background-color .3s $--n-ease-in-out-cubic-bezier,
transform .3s $--n-ease-in-out-cubic-bezier;
}
@include e(bottom) {
position: absolute;
top: 34px;
}
&:hover {
@include e(top) {
transform: rotate(12deg) scale(1.15) translateY(-2px);
}
@include e(bottom) {
transform: rotate(-12deg) scale(1.15) translateY(2px);
}
}
@include m(collapsed) {
&:hover {
@include e(top) {
transform: rotate(-12deg) scale(1.15) translateY(-2px);
}
@include e(bottom) {
transform: rotate(12deg) scale(1.15) translateY(2px);
}
}
}
}
@include e(top, bottom) {
background-color: map-get(
$--layout-sider-toggle-bar-background-color,
'default'
);
}
&:hover {
@include e(top, bottom) {
background-color: map-get(
$--layout-sider-toggle-bar-background-color,
'hover'
);
}
}
}
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;
}
2019-11-18 18:37:20 +08:00
}
}
2019-11-28 14:03:12 +08:00
@include m(bordered) {
2020-03-21 15:05:26 +08:00
@include e(border) {
background-color: $--layout-sider-border-color;
}
2019-11-18 18:37:20 +08:00
}
}
}