admin_menu_theme.scss 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437
  1. /**
  2. * admin_menu_theme
  3. * Theme styles for menus and other toolbar elements. SVG icons are styled in
  4. * the [theme]_icons.scss file, while click handles, e.g. origination buttons
  5. * are styled here.
  6. */
  7. // Import global variables.
  8. @import "variables";
  9. body {
  10. .toolbar-no-tabs {
  11. padding-top: $tab-item-height !important;
  12. }
  13. }
  14. #toolbar-administration {
  15. font-family: $font-family;
  16. font-weight: 400;
  17. font-size: $font-size;
  18. height: $tab-item-height * 2;
  19. background-color: $toolbar-bar-background;
  20. -webkit-tap-highlight-color: $tap-highlight;
  21. .toolbar-vertical &,
  22. .toolbar-no-tabs &,
  23. .toolbar-tab,
  24. .toolbar-tray {
  25. height: $tab-item-height;
  26. }
  27. .toolbar-tray {
  28. top: $tab-item-height;
  29. }
  30. .toolbar-tab,
  31. .toolbar-item {
  32. a {
  33. &:hover,
  34. &:focus {
  35. text-decoration: none;
  36. outline: none;
  37. }
  38. }
  39. }
  40. .toolbar-item {
  41. padding: $toolbar-item-padding;
  42. display: block;
  43. }
  44. .toolbar__link-label {
  45. font-size: 1em;
  46. }
  47. // Toolbar bar.
  48. .toolbar-bar {
  49. background-color: $toolbar-bar-background;
  50. color: $toolbar-bar-color;
  51. @if $drop-shadows == true {
  52. box-shadow: -1px 0 3px 1px $drop-shadow-color;
  53. [dir="rtl"] & {
  54. box-shadow: 1px 0 3px 1px $drop-shadow-color;
  55. }
  56. }
  57. .toolbar-item {
  58. &:hover,
  59. &:focus,
  60. &:active,
  61. &.is-active {
  62. }
  63. }
  64. .toolbar-tab .toolbar-tab__items-wrapper a {
  65. color: $tab-color;
  66. &:hover,
  67. &:focus,
  68. &.is-active {
  69. color: $tab-active-color;
  70. background-image: linear-gradient($toolbar-bar-background, $tray-background);
  71. }
  72. }
  73. // Tour is a button.
  74. .tour-toolbar-tab {
  75. &.toolbar-tab {
  76. float: none; // Override tour module CSS.
  77. }
  78. button.toolbar-item {
  79. padding: $toolbar-item-padding;
  80. }
  81. }
  82. // Edit button
  83. .contextual-toolbar-tab button.toolbar-item {
  84. color: $tab-color;
  85. &:hover,
  86. &:focus,
  87. &.is-active {
  88. color: $tab-active-color;
  89. background: none;
  90. }
  91. }
  92. }
  93. // Button reset.
  94. .toolbar-lining button:focus {
  95. outline: none;
  96. }
  97. // Menu reset.
  98. .toolbar-menu {
  99. list-style: none;
  100. margin: 0;
  101. padding: 0;
  102. }
  103. // Wrapper around list item items, injected when tray is vertical (and
  104. // persists even if toggled back to vertical).
  105. .toolbar-box a {
  106. &:focus {
  107. outline: none;
  108. }
  109. &:hover:focus {
  110. text-decoration: none;
  111. }
  112. }
  113. // Toolbar tray.
  114. .toolbar-tray {
  115. background-color: $tray-background;
  116. a {
  117. color: $tray-color;
  118. cursor: pointer;
  119. padding: $toolbar-item-padding;
  120. &:hover,
  121. &:active,
  122. &:focus,
  123. &.is-active {
  124. color: $tray-active;
  125. }
  126. &.is-active[href="/"] {
  127. color: $tray-color;
  128. }
  129. }
  130. }
  131. // Horizontal tray.
  132. .toolbar-tray-horizontal {
  133. @if $drop-shadows == true {
  134. box-shadow: -2px 1px 3px 1px $drop-shadow-color;
  135. [dir="rtl"] & {
  136. box-shadow: 2px 1px 3px 1px $drop-shadow-color;
  137. }
  138. }
  139. a:focus {
  140. outline: none;
  141. background-color: $tray-background;
  142. }
  143. // Admin Toolbar Module drop menus.
  144. .toolbar-menu-administration {
  145. .toolbar-menu .toolbar-menu {
  146. background-color: $drop-menu-background ;
  147. @if $drop-shadows == true {
  148. box-shadow: 0 2px 1px 1px $drop-shadow-color;
  149. }
  150. .menu-item {
  151. border-top: 1px solid $tray-background;
  152. &:first-child {
  153. border-top-color: $tray-background;
  154. }
  155. }
  156. // Sub-sub menus
  157. .toolbar-menu {
  158. @if $drop-shadows == true {
  159. box-shadow: 2px 2px 2px 0 $drop-shadow-color;
  160. }
  161. }
  162. > .menu-item--expanded > .toolbar-menu {
  163. top: -1px;
  164. }
  165. }
  166. > .toolbar-menu > .menu-item > a,
  167. > .toolbar-menu > .menu-item > .toolbar-box a {
  168. border-right: 1px solid;
  169. border-color: $tray-background;
  170. border-image: linear-gradient(to top, $tray-border-color, $tray-background) 1 100%;
  171. [dir="rtl"] & {
  172. border-right: 0;
  173. border-left: 1px solid;
  174. }
  175. }
  176. }
  177. .menu-item {
  178. .menu-item {
  179. &:hover,
  180. &:focus {
  181. background-color: $tray-background;
  182. }
  183. }
  184. }
  185. // Sub-menu indicator in drop menus.
  186. .toolbar-menu-administration > .toolbar-menu .toolbar-menu {
  187. > .menu-item--expanded > a,
  188. > .menu-item--expanded .toolbar-box > a {
  189. &:after {
  190. color: $sub-menu-indicator;
  191. right: 0.65em;
  192. top: 0.5em;
  193. display: block;
  194. font-size: 0.9em;
  195. }
  196. &:hover,
  197. &:focus {
  198. &:after {
  199. color: $tray-active;
  200. }
  201. }
  202. }
  203. }
  204. .edit-shortcuts {
  205. float: none; // Override shortcut module CSS.
  206. position: absolute;
  207. right: 2.2em;
  208. top: 0;
  209. }
  210. }
  211. // Vertical tray.
  212. .toolbar-tray-vertical {
  213. background-color: $tray-vertical-background;
  214. border-right: 1px solid $border-color;
  215. height: 100%;
  216. @if $drop-shadows == true {
  217. box-shadow: -1px 0 5px 2px $drop-shadow-color;
  218. }
  219. [dir="rtl"] & {
  220. border-left: 1px solid $border-color;
  221. border-right: 0 none;
  222. @if $drop-shadows == true {
  223. box-shadow: 1px 0 5px 2px $drop-shadow-color;
  224. }
  225. }
  226. .toolbar-menu .toolbar-menu {
  227. display: none;
  228. }
  229. .menu-item--expanded.open > .toolbar-menu {
  230. display: block;
  231. border-bottom-width: 0;
  232. .toolbar-menu {
  233. border-bottom-width: 1px;
  234. }
  235. }
  236. .toolbar-handle + a {
  237. margin-right: 3em;
  238. [dir="rtl"] & {
  239. margin-left: 3em;
  240. margin-right: 0;
  241. }
  242. }
  243. .menu-item {
  244. + .menu-item {
  245. border-top: 1px solid $tray-border-color;
  246. }
  247. &:last-child {
  248. border-bottom: 1px solid $tray-border-color;
  249. }
  250. .menu-item {
  251. border: 0 none;
  252. }
  253. .toolbar-box:hover,
  254. .toolbar-box:focus {
  255. background-color: lighten($tray-background, 5%);
  256. }
  257. }
  258. .toolbar-menu {
  259. &.root {
  260. border: 0;
  261. }
  262. .toolbar-menu {
  263. border-bottom: 1px solid;
  264. border-top: 1px solid;
  265. }
  266. }
  267. // Loop to generate nested selectors and styles.
  268. $self: '.toolbar-menu';
  269. @for $i from 1 through 8 {
  270. $self: if($i == 1, "ul", nest($self, "ul")) !global;
  271. #{$self} > .level-#{$i} > ul {
  272. background-color: darken($toolbar-bar-background , 5 * $i);
  273. border-bottom-color: darken($tray-border-color, 5 * $i);
  274. border-top-color: darken($tray-border-color, 5 * $i);
  275. }
  276. }
  277. }
  278. .menu-item:last-child > .toolbar-menu {
  279. border-bottom: 0;
  280. }
  281. // Click handles.
  282. .toolbar-icon.toolbar-handle {
  283. &:before {
  284. color: $tray-border-color;
  285. }
  286. &.open {
  287. &:before {
  288. color: $tray-active;
  289. }
  290. }
  291. }
  292. .toolbar-toggle-orientation button.toolbar-icon {
  293. &:after,
  294. &:before {
  295. color: $toggle-orientation-color;
  296. }
  297. &:hover,
  298. &:focus,
  299. &:hover:after,
  300. &:focus:before {
  301. color: $toggle-orientation-active;
  302. background-color: transparent;
  303. }
  304. }
  305. // Orientation toggles and handles
  306. .toolbar-toggle-orientation {
  307. button {}
  308. > .toolbar-lining {}
  309. }
  310. .toolbar-tray-horizontal .toolbar-toggle-orientation {
  311. border-left: 1px solid $toggle-orientation-border-color;
  312. [dir="rtl"] & {
  313. border-left: 0 none;
  314. border-right: 1px solid $toggle-orientation-border-color;
  315. }
  316. }
  317. .toolbar-toggle-orientation [value="horizontal"]:after {
  318. right: 0.95em;
  319. }
  320. }
  321. // Support for the Adminimal admin theme.
  322. .adminimal {
  323. #toolbar-bar {
  324. font: normal 83.1%/1.538 "Open Sans", sans-serif !important;
  325. }
  326. &.toolbar-tray-open {
  327. &.toolbar-fixed {
  328. &.toolbar-horizontal {
  329. &.toolbar-themes {
  330. padding-top: 4.75em !important;
  331. }
  332. #toolbar-administration {
  333. background-color: #333;
  334. }
  335. &.toolbar-has-tabs #toolbar-administration {
  336. min-height: 4em;
  337. }
  338. &.toolbar-no-tabs #toolbar-administration {
  339. min-height: 2em;
  340. }
  341. }
  342. }
  343. }
  344. &.toolbar-fixed.toolbar-vertical.toolbar-has-tabs,
  345. &.toolbar-fixed.toolbar-horizontal.toolbar-no-tabs,
  346. &.toolbar-fixed.toolbar-vertical.toolbar-no-tabs,
  347. &.toolbar-tray-open.toolbar-fixed.toolbar-horizontal.toolbar-no-tabs {
  348. padding-top: 2.3em !important;
  349. }
  350. }