Blame view

src/styles/components/menu.less 3.24 KB
e05d7289   梁灏   update Menu
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
  @menu-prefix-cls: ~"@{css-prefix}menu";
  @menu-dropdown-item-prefix-cls: ~"@{menu-prefix-cls}-horizontal .@{menu-prefix-cls}-submenu .@{select-dropdown-prefix-cls} .@{menu-prefix-cls}-item";
  
  .@{menu-prefix-cls} {
      display: block;
      margin: 0;
      padding: 0;
      outline: none;
      list-style: none;
      color: @text-color;
      font-size: @font-size-base;
      position: relative;
  
      &-horizontal{
          height: 60px;
          line-height: 60px;
  
          &.@{menu-prefix-cls}-light{
              &:after{
                  content: '';
                  display: block;
                  width: 100%;
                  height: 1px;
                  background: @border-color-base;
                  position: absolute;
                  bottom: 0;
                  left: 0;
              }
          }
      }
      &-vertical{
          width: 240px;
          &.@{menu-prefix-cls}-light{
              &:after{
                  content: '';
                  display: block;
                  width: 1px;
                  height: 100%;
                  background: @border-color-base;
                  position: absolute;
                  top: 0;
                  bottom: 0;
                  right: 0;
              }
          }
      }
  
      &-light{
          background: #fff;
      }
      &-dark{
          background: @title-color;
      }
      &-primary{
          background: @primary-color;
      }
  
      &-item{
          display: block;
          outline: none;
          list-style: none;
          font-size: @font-size-base;
          position: relative;
          z-index: 1;
          cursor: pointer;
          transition: all @transition-time @ease-in-out;
  
          .@{menu-prefix-cls}-light &{
              color: @text-color;
          }
          .@{menu-prefix-cls}-dark &{
              color: @subsidiary-color;
              &-active, &:hover{
                  color: #fff;
              }
          }
          .@{menu-prefix-cls}-primary &{
              color: #fff;
              &-active, &:hover{
                  background: @link-active-color;
              }
          }
      }
      &-horizontal &-item,
      &-horizontal &-submenu
      {
          float: left;
          padding: 0 20px;
          position: relative;
          cursor: pointer;
          z-index: 1;
          transition: all @transition-time @ease-in-out;
      }
  
      &-light&-horizontal &-item, &-light&-horizontal &-submenu{
          height: inherit;
          line-height: inherit;
          border-bottom: 2px solid transparent;
          &-active, &:hover{
              color: @primary-color;
              border-bottom: 2px solid @primary-color;
          }
      }
  
      &-dark&-horizontal &-item{
          &-active, &:hover{
              color: #fff;
          }
      }
  
      &-primary&-horizontal &-item{
          &-active, &:hover{
              background: @link-active-color;
          }
      }
  
      &-horizontal &-submenu .@{select-dropdown-prefix-cls} {
          width: 100%;
          .@{menu-prefix-cls}-item{
              height: auto;
              line-height: normal;
              border-bottom: 0;
              float: none;
          }
      }
  
      &-item-group{
          line-height: normal;
          &-title {
              padding-left: 8px;
              font-size: 12px;
              color: @legend-color;
              height: 30px;
              line-height: 30px;
          }
      }
  }
  .select-item(@menu-prefix-cls, @menu-dropdown-item-prefix-cls);