theme.less 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. /**
  2. @navBg 菜单背景色
  3. @headerBg 头部背景色
  4. @footBg 页脚背景色
  5. @fontColor 头部颜色
  6. @activeFontColor 菜单激活是文字颜色
  7. @menuItemActive 菜单激活时背景色
  8. @subMenuOpened 子菜单打开时背景色
  9. @menuFontColor 菜单文字颜色
  10. @mainBackground 主要的背景色
  11. */
  12. .main-theme(@navBg,@headerBg, @footBg,@fontColor,@activeFontColor,@menuItemActive,@subMenuOpened,@menuFontColor,@mainBackground){
  13. .main-framework__aside{
  14. position: relative;
  15. z-index: 200;
  16. background: @navBg;
  17. box-shadow: 0 1px 4px rgba(0,21,41,.1);
  18. .el-menu{
  19. background: @navBg;
  20. &:not(.el-menu--collapse){
  21. .el-menu-item.is-active{
  22. border-left-color: @activeFontColor !important;
  23. background: @menuItemActive !important;
  24. color: @activeFontColor !important;
  25. }
  26. }
  27. .el-menu-item{
  28. color: @useMenuFontColor;
  29. border-left: 5px solid transparent;
  30. &:hover{
  31. color: @useMenuFontColor !important;
  32. background: @menuItemActive !important;
  33. }
  34. }
  35. .el-submenu {
  36. }
  37. .el-submenu__title{
  38. border-left: 5px solid transparent;
  39. color: @useMenuFontColor;
  40. }
  41. .el-menu-item.is-active{
  42. background: @menuItemActive;
  43. color: @activeFontColor;
  44. }
  45. .el-submenu{
  46. .el-submenu__title{
  47. background: @navBg;
  48. }
  49. &.is-active.el-submenu__title{
  50. background: @menuItemActive;
  51. }
  52. &.is-opened{
  53. .el-submenu__title{
  54. background: @subMenuOpened;
  55. }
  56. .el-menu{
  57. .el-menu-item{
  58. background: @subMenuOpened;
  59. &.is-active{
  60. background: @subMenuOpened;
  61. }
  62. }
  63. }
  64. }
  65. }
  66. }
  67. }
  68. .main-framework__name{
  69. background: @navBg;
  70. color: @fontColor;
  71. }
  72. .main-framework__header{
  73. .main-framework__name{ // 使用header的默认颜色和背景色
  74. background: @headerBg;
  75. color: @fontColor;
  76. }
  77. background: @headerBg;
  78. color: @fontColor;
  79. box-shadow: 0 1px 4px rgba(0,21,41,.1);
  80. position: relative;
  81. z-index: 200;
  82. .el-dropdown{
  83. color: inherit;
  84. }
  85. .el-breadcrumb__inner{
  86. color: inherit;
  87. }
  88. }
  89. .main-framework__main{
  90. background: @mainBackground;
  91. }
  92. .main-framework__footer{
  93. position: relative;
  94. z-index: 200;
  95. background: @footBg;
  96. color: @fontColor;
  97. }
  98. .main-framework__aside__switch{
  99. color: @useMenuFontColor;
  100. //box-shadow: 0 1px 4px rgba(0,21,41,.3);
  101. }
  102. @useMenuFontColor: if((iscolor(@menuFontColor)), @menuFontColor, @fontColor);
  103. }
  104. .main-theme--data-center{
  105. @themePrimary: #1e3851;
  106. .main-theme(@themePrimary,@themePrimary,@themePrimary,#fff,#fff,#104682,#253f58,'',@background);
  107. }
  108. .main-theme--light{
  109. @themePrimary: #fff;
  110. .main-theme(@themePrimary,@themePrimary,@themePrimary,#333,@primary,#e8f4ff,'','',@background);
  111. }
  112. // TODO: 黑暗模式待完善
  113. .main-theme--dark{
  114. @themePrimary: #2f3542;
  115. .main-theme(@themePrimary,@themePrimary,@themePrimary,#fff,@primary,#444,'','',@background);
  116. }