index.less 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. @import '../../style/themes/index';
  2. @import '../../style/mixins/index';
  3. @layout-prefix-cls: ~'@{ant-prefix}-layout';
  4. @layout-menu-prefix-cls: ~'@{ant-prefix}-menu';
  5. .@{layout-prefix-cls} {
  6. display: flex;
  7. flex: auto;
  8. flex-direction: column;
  9. /* fix firefox can't set height smaller than content on flex item */
  10. min-height: 0;
  11. background: @layout-body-background;
  12. &,
  13. * {
  14. box-sizing: border-box;
  15. }
  16. &&-has-sider {
  17. flex-direction: row;
  18. > .@{layout-prefix-cls},
  19. > .@{layout-prefix-cls}-content {
  20. width: 0; // https://segmentfault.com/a/1190000019498300
  21. }
  22. }
  23. &-header,
  24. &-footer {
  25. flex: 0 0 auto;
  26. }
  27. &-header {
  28. height: @layout-header-height;
  29. padding: @layout-header-padding;
  30. color: @layout-header-color;
  31. line-height: @layout-header-height;
  32. background: @layout-header-background;
  33. }
  34. &-footer {
  35. padding: @layout-footer-padding;
  36. color: @text-color;
  37. font-size: @font-size-base;
  38. background: @layout-footer-background;
  39. }
  40. &-content {
  41. flex: auto;
  42. /* fix firefox can't set height smaller than content on flex item */
  43. min-height: 0;
  44. }
  45. &-sider {
  46. position: relative;
  47. /* fix firefox can't set width smaller than content on flex item */
  48. min-width: 0;
  49. background: @layout-sider-background;
  50. transition: all 0.2s;
  51. &-children {
  52. height: 100%;
  53. margin-top: -0.1px;
  54. // Hack for fixing margin collaspe bug
  55. // https://github.com/ant-design/ant-design/issues/7967
  56. // solution from https://stackoverflow.com/a/33132624/3040605
  57. padding-top: 0.1px;
  58. .@{layout-menu-prefix-cls}.@{layout-menu-prefix-cls}-inline-collapsed {
  59. width: auto;
  60. }
  61. }
  62. &-has-trigger {
  63. padding-bottom: @layout-trigger-height;
  64. }
  65. &-right {
  66. order: 1;
  67. }
  68. &-trigger {
  69. position: fixed;
  70. bottom: 0;
  71. z-index: 1;
  72. height: @layout-trigger-height;
  73. color: @layout-trigger-color;
  74. line-height: @layout-trigger-height;
  75. text-align: center;
  76. background: @layout-trigger-background;
  77. cursor: pointer;
  78. transition: all 0.2s;
  79. }
  80. &-zero-width {
  81. > * {
  82. overflow: hidden;
  83. }
  84. &-trigger {
  85. position: absolute;
  86. top: @layout-header-height;
  87. right: -@layout-zero-trigger-width;
  88. z-index: 1;
  89. width: @layout-zero-trigger-width;
  90. height: @layout-zero-trigger-height;
  91. color: @layout-trigger-color;
  92. font-size: (@layout-zero-trigger-width / 2);
  93. line-height: @layout-zero-trigger-height;
  94. text-align: center;
  95. background: @layout-sider-background;
  96. border-radius: 0 @border-radius-base @border-radius-base 0;
  97. cursor: pointer;
  98. transition: background 0.3s ease;
  99. &::after {
  100. position: absolute;
  101. top: 0;
  102. right: 0;
  103. bottom: 0;
  104. left: 0;
  105. background: transparent;
  106. transition: all 0.3s;
  107. content: '';
  108. }
  109. &:hover::after {
  110. background: rgba(255, 255, 255, 0.1);
  111. }
  112. &-right {
  113. left: -@layout-zero-trigger-width;
  114. border-radius: @border-radius-base 0 0 @border-radius-base;
  115. }
  116. }
  117. }
  118. }
  119. }
  120. @import './light';
  121. @import './rtl';