menu.css 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  1. /* menu */
  2. body
  3. {
  4. --menuitem-width: 180px;
  5. --menuitem-height: 28px;
  6. --menuitem-background1: #254441;
  7. --menuitem-background2: #f0f0f0;
  8. --focused-menuitem-background: #ff8080;
  9. }
  10. nav ul
  11. {
  12. float: left;
  13. padding:0;
  14. margin:0;
  15. list-style: none;
  16. position: relative;
  17. z-index: 100;
  18. }
  19. nav ul li
  20. {
  21. margin: 0px;
  22. display:inline-block;
  23. float: left;
  24. background-color: var(--menuitem-background1);
  25. }
  26. nav a
  27. {
  28. display:block;
  29. padding:0 10px;
  30. color:white;
  31. font-size:14px;
  32. text-decoration:none;
  33. cursor: pointer;
  34. line-height: var(--menuitem-height);
  35. user-select: none;
  36. }
  37. nav a:hover,
  38. nav a:focus
  39. {
  40. background-color: var(--focused-menuitem-background);
  41. color: #202020;
  42. border:none;
  43. outline: none;
  44. }
  45. nav a div.label
  46. {
  47. }
  48. nav a div.shortcut
  49. {
  50. text-align: right;
  51. font-size: 11px;
  52. position: absolute;
  53. right: 4px;
  54. color: gray;
  55. top: 0;
  56. height: var(--menuitem-height);
  57. }
  58. nav a:focus div.shortcut,
  59. nav a:hover div.shortcut
  60. {
  61. color: black;
  62. }
  63. nav ul ul
  64. {
  65. display: none;
  66. position: absolute;
  67. top: var(--menuitem-height);
  68. }
  69. nav ul ul ul
  70. {
  71. margin-top: -1px;
  72. }
  73. nav ul li.drop > ul
  74. {
  75. display:inherit;
  76. animation: fade_in 0.3s;
  77. }
  78. nav ul ul li
  79. {
  80. width: var(--menuitem-width);
  81. float:none;
  82. display:list-item;
  83. position: relative;
  84. box-shadow: 0px 8px 6px -6px rgba(50, 50, 50, 0.3);
  85. background-color: var(--menuitem-background2);
  86. border-left: 1px solid gray;
  87. border-right: 1px solid gray;
  88. }
  89. nav ul ul ul li:first-child
  90. {
  91. border-top: 1px solid gray;
  92. }
  93. nav ul ul li:last-child
  94. {
  95. border-bottom: 1px solid gray;
  96. }
  97. nav ul ul li a
  98. {
  99. color: #404040;
  100. }
  101. nav ul ul ul
  102. {
  103. position: relative;
  104. top: calc(var(--menuitem-height) * -1);
  105. left: var(--menuitem-width);
  106. height: 0;
  107. }
  108. nav ul ul a.menu
  109. {
  110. background-position: 96% 50%;
  111. background-repeat: no-repeat;
  112. background-image: url(images/expand.svg);
  113. }
  114. .menu_button
  115. {
  116. display: none;
  117. }
  118. @media all and (max-width : 950px)
  119. {
  120. nav
  121. {
  122. margin: 0;
  123. bottom: 0;
  124. overflow-x: hidden;
  125. overflow-y: auto;
  126. scrollbar-width: none;
  127. }
  128. nav::-webkit-scrollbar
  129. {
  130. width: 0px;
  131. height: 0px;
  132. }
  133. nav ul ul,
  134. nav ul ul ul li
  135. {
  136. float: none;
  137. position:static;
  138. }
  139. nav ul ul ul
  140. {
  141. height: inherit;
  142. top:inherit;
  143. left:inherit;
  144. }
  145. nav ul ul li:last-child
  146. {
  147. border-bottom: none;
  148. }
  149. nav ul li,
  150. nav ul ul li,
  151. nav ul li.drop > ul,
  152. nav ul ul li.drop > ul
  153. {
  154. display: block;
  155. width: 100%;
  156. background-color: var(--menuitem-background1);
  157. }
  158. nav ul li.drop > ul
  159. {
  160. padding:4px 30px;
  161. }
  162. nav ul li a,
  163. nav ul ul li a
  164. {
  165. color: white;
  166. padding: 4px 16px;
  167. }
  168. nav ul ul ul li:first-child
  169. {
  170. border-top: none;
  171. }
  172. nav li > a.menu div.label:after { content: ' +'; }
  173. nav li.drop > a div.label:after { content: ' -'; }
  174. nav li div.shortcut { display: none }
  175. nav a:hover,
  176. nav a:focus
  177. {
  178. color: #F08080;
  179. background: transparent;
  180. }
  181. nav > ul
  182. {
  183. position: absolute;
  184. top: var(--menuitem-height);
  185. right: 0;
  186. display: block;
  187. opacity: 0;
  188. visibility: hidden;
  189. width: 300px;
  190. max-width: 100%;
  191. }
  192. nav ul li.drop > ul
  193. {
  194. display:inherit;
  195. animation: none;
  196. }
  197. nav > ul.menu_hide
  198. {
  199. visibility: hidden;
  200. opacity: 0;
  201. transition: visibility 0s 0.2s, opacity 0.2s linear;
  202. }
  203. nav > ul.menu_drop
  204. {
  205. visibility: visible;
  206. opacity: 1;
  207. transition: opacity 0.2s linear;
  208. }
  209. .menu_button
  210. {
  211. position: absolute;
  212. display: block;
  213. top: 0;
  214. right: 0;
  215. cursor:pointer;
  216. color: white;
  217. z-index:200;
  218. font-size: 14px;
  219. user-select: none;
  220. padding-left: 24px;
  221. background-size: 16px 16px;
  222. background-repeat: no-repeat;
  223. background-position: 4px center;
  224. padding-right: 8px;
  225. background-color: #B00000;
  226. line-height: var(--menuitem-height);
  227. }
  228. .menu_button[aria-pressed=true]
  229. {
  230. background-image: url(images/menu_hide.svg);
  231. }
  232. .menu_button[aria-pressed=false]
  233. {
  234. background-image: url(images/menu_show.svg);
  235. }
  236. }