_menu.scss 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. /**
  2. * Creates the base structure of a Menu
  3. * @member Ext.menu.Menu
  4. */
  5. @mixin extjs-menu {
  6. .#{$prefix}menu-body {
  7. @include no-select;
  8. background: $menu-background-color !important;
  9. padding: $menu-padding;
  10. }
  11. .#{$prefix}menu-item .#{$prefix}form-text {
  12. user-select: text;
  13. -webkit-user-select: text;
  14. -o-user-select: text;
  15. -ie-user-select: text;
  16. -moz-user-select: text;
  17. -ie-user-select: text;
  18. }
  19. .#{$prefix}menu-icon-separator {
  20. position: absolute;
  21. top: 0px;
  22. left: $menu-item-indent;
  23. z-index: 0;
  24. border-left: solid 1px $menu-separator-border-color;
  25. background-color: $menu-separator-background-color;
  26. width: 2px;
  27. overflow: hidden;
  28. }
  29. .#{$prefix}menu-plain {
  30. .#{$prefix}menu-icon-separator {
  31. display: none;
  32. }
  33. }
  34. .#{$prefix}menu-focus {
  35. display: block;
  36. position: absolute;
  37. top: -10px;
  38. left: -10px;
  39. width: 0px;
  40. height: 0px;
  41. }
  42. .#{$prefix}menu-item {
  43. white-space: nowrap;
  44. overflow: hidden;
  45. z-index: 1;
  46. }
  47. .#{$prefix}menu-item-cmp {
  48. margin-bottom: 1px;
  49. }
  50. .#{$prefix}menu-item-link {
  51. display: block;
  52. margin: 1px;
  53. padding: $menu-link-padding;
  54. text-decoration: none !important;
  55. line-height: 16px;
  56. cursor: default;
  57. }
  58. @if $include-opera {
  59. .#{$prefix}opera {
  60. // Opera 10.5 absolute positioning of submenu arrow has issues
  61. // This will fix it, and not affect newer Operas
  62. .#{$prefix}menu-item-link {
  63. position: relative;
  64. }
  65. }
  66. }
  67. .#{$prefix}menu-item-icon {
  68. width: 16px;
  69. height: 16px;
  70. position: absolute;
  71. top: 5px;
  72. left: 4px;
  73. background: no-repeat center center;
  74. }
  75. // For when an icon needs to be used in the right position where a submenu arrow usually goes.
  76. // eg: When a CheckItem needs an icon. The left icon position is a checkbox, so the icon is moved to the right.
  77. .#{$prefix}menu-item-icon-right {
  78. width: 16px;
  79. height: 16px;
  80. position: absolute;
  81. top: 6px;
  82. right: 4px;
  83. background: no-repeat center center;
  84. }
  85. .#{$prefix}menu-item-text {
  86. font-size: ceil($font-size * .9);
  87. color: $menu-text-color;
  88. }
  89. .#{$prefix}menu-item-checked {
  90. .#{$prefix}menu-item-icon {
  91. background-image: theme-background-image($theme-name, $menu-icon-checked);
  92. }
  93. .#{$prefix}menu-group-icon {
  94. background-image: theme-background-image($theme-name, $menu-icon-group-checked);
  95. }
  96. }
  97. .#{$prefix}menu-item-unchecked {
  98. .#{$prefix}menu-item-icon {
  99. background-image: theme-background-image($theme-name, $menu-icon-unchecked);
  100. }
  101. .#{$prefix}menu-group-icon {
  102. background-image: none;
  103. }
  104. }
  105. .#{$prefix}menu-item-separator {
  106. height: 2px;
  107. border-top: solid 1px $menu-separator-border-color;
  108. background-color: $menu-separator-background-color;
  109. margin: $menu-padding 0px;
  110. overflow: hidden;
  111. }
  112. .#{$prefix}menu-item-arrow {
  113. position: absolute;
  114. width: 12px;
  115. height: 9px;
  116. top: 9px;
  117. right: 0px;
  118. background: no-repeat center center;
  119. background-image: theme-background-image($theme-name, $menu-icon-arrow);
  120. }
  121. .#{$prefix}menu-item-indent {
  122. margin-left: $menu-item-indent + $menu-padding + 2px; /* The 2px is the width of the seperator */
  123. }
  124. .#{$prefix}menu-item-active {
  125. cursor: pointer;
  126. .#{$prefix}menu-item-link {
  127. @include background-gradient($menu-item-active-background-color, 'matte');
  128. margin: 0px;
  129. border: 1px solid $menu-item-active-border-color;
  130. cursor: pointer;
  131. @include border-radius(3px);
  132. }
  133. }
  134. .#{$prefix}menu-item-disabled {
  135. @include opacity(.5);
  136. }
  137. @if $include-ie {
  138. .#{$prefix}ie {
  139. .#{$prefix}menu-item-disabled {
  140. .#{$prefix}menu-item-icon {
  141. @include opacity(.5);
  142. }
  143. .#{$prefix}menu-item-text {
  144. // IE opacity/cleartype bug workaround
  145. background-color: transparent;
  146. }
  147. }
  148. .#{$prefix}strict .#{$prefix}ie7m & {
  149. .#{$prefix}menu-icon-separator {
  150. width: 1px;
  151. }
  152. .#{$prefix}menu-item-separator {
  153. height: 1px;
  154. }
  155. }
  156. }
  157. .#{$prefix}ie6,
  158. .#{$prefix}ie7,
  159. .#{$prefix}quirks .#{$prefix}ie8 {
  160. .#{$prefix}menu-item-link {
  161. padding-bottom: $menu-padding;
  162. }
  163. }
  164. }
  165. @if not $supports-gradients or $compile-all {
  166. .#{$prefix}nlg {
  167. .#{$prefix}menu-item-active .#{$prefix}menu-item-link {
  168. background: $menu-item-active-background-color repeat-x left top;
  169. background-image: theme-background-image($theme-name, $menu-item-active-background-image);
  170. }
  171. }
  172. }
  173. .#{$prefix}menu-date-item {
  174. border-color: #99BBE8;
  175. }
  176. }