You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

_valo-menu.scss 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559
  1. /**
  2. * @group valo-menu
  3. */
  4. $valo-menu-background-color: scale-color($v-app-background-color, $lightness: if(color-luminance($v-app-background-color) < 10, 15%, -70%)) !default;
  5. /**
  6. *
  7. *
  8. * @param {string} $bg ($valo-menu-background-color) -
  9. *
  10. * @group valo-menu
  11. */
  12. @mixin valo-menu ($bg: $valo-menu-background-color) {
  13. .valo-menu {
  14. @include valo-menu-style($bg);
  15. }
  16. .valo-menu-toggle {
  17. display: none;
  18. position: fixed;
  19. z-index: 200;
  20. $offset: floor(($v-unit-size - $v-unit-size * 0.8) / 2);
  21. top: $offset;
  22. left: $offset;
  23. min-width: 0;
  24. }
  25. .valo-menu-part {
  26. border-left: valo-border($color: $bg, $strength: 0.6);
  27. height: 100%;
  28. padding-bottom: $v-unit-size;
  29. overflow: auto;
  30. &:first-child {
  31. border-left: none;
  32. }
  33. }
  34. .valo-menu-title,
  35. .valo-menu-subtitle,
  36. .valo-menu-item {
  37. display: block;
  38. line-height: inherit;
  39. white-space: nowrap;
  40. position: relative;
  41. .valo-menu-badge {
  42. position: absolute;
  43. right: round($v-unit-size/2);
  44. }
  45. }
  46. .valo-menu-title {
  47. @include valo-menu-title-style;
  48. text-align: center;
  49. .v-menubar.v-menubar {
  50. background: transparent;
  51. border-color: first-color(valo-border($color: $v-selection-color));
  52. color: inherit;
  53. @include box-shadow(none);
  54. text-shadow: inherit;
  55. }
  56. .v-menubar-menuitem {
  57. background: transparent;
  58. @include box-shadow(valo-bevel-and-shadow($bevel: $v-bevel, $background-color: $v-selection-color, $gradient: $v-gradient));
  59. text-shadow: inherit;
  60. font-size: $v-font-size;
  61. border-color: inherit;
  62. }
  63. h1, .v-label-h1,
  64. h2, .v-label-h2,
  65. h3, .v-label-h3,
  66. h4, .v-label-h4 {
  67. margin-top: 0;
  68. margin-bottom: 0;
  69. color: inherit;
  70. }
  71. }
  72. .v-menubar-user-menu {
  73. @include valo-menubar-borderless-style;
  74. margin: round($v-unit-size/2) round($v-unit-size/5);
  75. display: block;
  76. overflow: hidden;
  77. text-align: center;
  78. height: auto;
  79. color: inherit;
  80. > .v-menubar-menuitem {
  81. color: inherit;
  82. white-space: normal;
  83. line-height: 1.4;
  84. margin: 0;
  85. img.v-icon {
  86. width: round($v-unit-size * 1.5);
  87. height: round($v-unit-size * 1.5);
  88. border-radius: ceil($v-unit-size * 1.5 / 2 + first-number($v-border));
  89. box-shadow: valo-bevel-and-shadow($bevel: null, $shadow: $v-shadow);
  90. display: block;
  91. margin: 0 auto .3em;
  92. border: valo-border();
  93. }
  94. &:after {
  95. top: 0;
  96. right: 0;
  97. bottom: 0;
  98. left: 0;
  99. }
  100. }
  101. .v-menubar-menuitem-selected {
  102. background: transparent;
  103. }
  104. }
  105. .valo-menu-subtitle {
  106. @include valo-menu-subtitle-style($bg);
  107. }
  108. .valo-menuitems {
  109. display: block;
  110. }
  111. .valo-menu-item {
  112. @include valo-menu-item-style($bg);
  113. }
  114. .valo-menu-part.large-icons {
  115. @include valo-menu-large-icons-style($bg);
  116. }
  117. .valo-menu-logo {
  118. @include valo-menu-logo-style;
  119. }
  120. @include valo-menu-responsive;
  121. }
  122. /**
  123. *
  124. *
  125. *
  126. * @group valo-menu
  127. */
  128. @mixin valo-menu-responsive {
  129. .v-ui {
  130. @include width-range($min: 801px, $max: 1100px) {
  131. .valo-menu-part {
  132. @include valo-menu-large-icons-style($valo-menu-background-color);
  133. }
  134. }
  135. @include width-range($max: 800px) {
  136. padding-top: $v-unit-size;
  137. -webkit-box-sizing: border-box;
  138. box-sizing: border-box;
  139. .v-loading-indicator {
  140. top: $v-unit-size;
  141. }
  142. > .v-widget {
  143. position: relative !important
  144. }
  145. .valo-menu {
  146. border-right: none;
  147. }
  148. .valo-menu-part {
  149. overflow: visible;
  150. }
  151. .valo-menu-toggle {
  152. display: inline-block;
  153. }
  154. .valo-menu-title {
  155. position: fixed;
  156. z-index: 100;
  157. top: 0;
  158. left: 0;
  159. right: 0;
  160. height: $v-unit-size !important;
  161. padding-top: 0;
  162. padding-bottom: 0;
  163. -webkit-backface-visibility: hidden;
  164. }
  165. .valo-menu .v-menubar-user-menu {
  166. position: fixed;
  167. z-index: 100;
  168. top: 0;
  169. right: 0;
  170. margin: 0;
  171. padding: 0;
  172. height: $v-unit-size;
  173. color: valo-font-color($v-selection-color, 0.5);
  174. max-width: 30%;
  175. -webkit-backface-visibility: hidden;
  176. .v-menubar-menuitem {
  177. line-height: $v-unit-size - 1px;
  178. white-space: nowrap;
  179. }
  180. img.v-icon {
  181. display: inline-block;
  182. margin: 0 round($v-unit-size / 6) 0 0;
  183. width: round($v-unit-size / 2);
  184. height: round($v-unit-size / 2);
  185. border-radius: ceil($v-unit-size / 4);
  186. border: none;
  187. }
  188. }
  189. .valo-menuitems {
  190. @include valo-menu-style;
  191. position: fixed;
  192. z-index: 200;
  193. top: $v-unit-size;
  194. bottom: 0;
  195. height: auto;
  196. max-width: 100%;
  197. overflow: auto;
  198. padding: round($v-unit-size / 2) 0;
  199. @include transform(translatex(-100%));
  200. @include transition(all 300ms);
  201. }
  202. .valo-menu-visible .valo-menuitems {
  203. @include transform(translatex(0%));
  204. }
  205. }
  206. @include width-range($max: 500px) {
  207. .valo-menu-toggle .v-button-caption {
  208. display: none;
  209. }
  210. .valo-menu .v-menubar-user-menu .v-menubar-menuitem-caption {
  211. display: inline-block;
  212. width: round($v-unit-size / 2);
  213. overflow: hidden;
  214. }
  215. }
  216. }
  217. }
  218. /**
  219. *
  220. *
  221. * @param {string} $bg ($valo-menu-background-color) -
  222. *
  223. * @group valo-menu
  224. */
  225. @mixin valo-menu-style ($bg: $valo-menu-background-color) {
  226. height: 100%;
  227. @include linear-gradient(to left, (darken($bg, valo-gradient-opacity() / 2) 0%, $bg round($v-unit-size/4)), $fallback: $bg);
  228. color: valo-font-color($bg, 0.5);
  229. font-size: round($v-font-size * 0.9);
  230. line-height: round($v-unit-size * 0.8);
  231. border-right: valo-border($color: $bg);
  232. white-space: nowrap;
  233. }
  234. /**
  235. *
  236. *
  237. *
  238. * @group valo-menu
  239. */
  240. @mixin valo-menu-title-style {
  241. line-height: 1.2;
  242. @include valo-gradient($color: $v-selection-color);
  243. $font-color: valo-font-color($v-selection-color, 1);
  244. color: $font-color;
  245. text-shadow: valo-text-shadow($font-color: $font-color, $background-color: $v-selection-color);
  246. padding: round($v-unit-size/3) round($v-unit-size/2);
  247. font-size: round($v-font-size * 0.9);
  248. border-bottom: valo-border($color: $v-selection-color);
  249. @include box-shadow(valo-bevel-and-shadow($shadow: $v-shadow));
  250. }
  251. /**
  252. *
  253. *
  254. * @param {color} $bg ($valo-menu-background-color) -
  255. *
  256. * @group valo-menu
  257. */
  258. @mixin valo-menu-subtitle-style ($bg: $valo-menu-background-color) {
  259. color: valo-font-color($bg, 0.33);
  260. margin: round($v-unit-size/5) 0 round($v-unit-size/5) round($v-unit-size/2);
  261. border-bottom: valo-border($color: $bg, $strength: 0.5, $border: first-number($v-border) solid v-tone);
  262. [class*="badge"] {
  263. color: mix(valo-font-color($bg), $v-selection-color);
  264. }
  265. }
  266. /**
  267. *
  268. *
  269. * @param {color} $bg ($valo-menu-background-color) -
  270. *
  271. * @group valo-menu
  272. */
  273. @mixin valo-menu-item-style ($bg: $valo-menu-background-color) {
  274. $font-color: valo-font-color($bg, 0.5);
  275. outline: none;
  276. font-weight: $v-font-weight + 100;
  277. padding: 0 round($v-unit-size) 0 round($v-unit-size/2);
  278. cursor: pointer;
  279. position: relative;
  280. overflow: hidden;
  281. text-shadow: valo-text-shadow($font-color: $font-color, $background-color: $bg, $offset: 2px);
  282. @include transition(background-color 300ms, color 60ms);
  283. $diff: color-luminance($bg) - color-luminance($v-selection-color);
  284. $active-color: $v-selection-color;
  285. @if abs($diff) < 30 {
  286. $active-color: lighten($v-selection-color, 10%);
  287. }
  288. [class*="caption"] {
  289. vertical-align: middle;
  290. display: inline-block;
  291. width: 90%;
  292. max-width: 15em;
  293. padding-right: round($v-unit-size/2);
  294. text-overflow: ellipsis;
  295. overflow: hidden;
  296. }
  297. [class*="badge"] {
  298. @if abs($diff) < 50 {
  299. color: mix(valo-font-color($bg), $v-selection-color);
  300. } @else {
  301. color: $active-color;
  302. }
  303. }
  304. &.selected {
  305. background: if(is-dark-color($bg), darken($bg, 3%), lighten($bg, 5%));
  306. .v-icon {
  307. color: $active-color;
  308. }
  309. [class*="badge"] {
  310. @include valo-badge-style($states: active, $active-color: $active-color);
  311. }
  312. }
  313. &:focus,
  314. &:hover,
  315. &.selected {
  316. color: valo-font-color($bg, 1);
  317. }
  318. // Font icons
  319. span.v-icon {
  320. min-width: 1em;
  321. margin-right: round($v-unit-size/2);
  322. text-align: center;
  323. vertical-align: middle;
  324. @if $v-gradient {
  325. -webkit-mask-image: -webkit-gradient(linear, left top, left bottom, from(black), to(rgba(0, 0, 0, 0.75)));
  326. }
  327. + span {
  328. margin-left: 0;
  329. }
  330. }
  331. [class*="badge"] {
  332. @include valo-badge-style($states: inactive, $background-color: lighten($bg, 5%));
  333. }
  334. }
  335. /**
  336. *
  337. *
  338. * @param {string} $states (inactive active) -
  339. * @param {color} $background-color (null) -
  340. * @param {color} $active-color ($v-selection-color) -
  341. *
  342. * @group valo-menu
  343. */
  344. @mixin valo-badge-style ($states: inactive active, $background-color: null, $active-color: $v-selection-color) {
  345. @if contains($states, inactive) {
  346. background-color: $background-color;
  347. @include transition(background-color 300ms);
  348. line-height: 1;
  349. padding: round($v-unit-size/9) round($v-unit-size/6);
  350. min-width: round($v-font-size/1.5);
  351. text-align: center;
  352. top: (round($v-unit-size * 0.8) - round($v-font-size * 0.9) - round($v-unit-size/9) * 2) / 2;
  353. border-radius: $v-border-radius;
  354. }
  355. @if contains($states, active) {
  356. @include valo-gradient($color: $active-color);
  357. color: valo-font-color($active-color);
  358. }
  359. }
  360. /**
  361. *
  362. *
  363. * @param {color} $bg (darken($valo-menu-background-color, 4%)) -
  364. *
  365. * @group valo-menu
  366. */
  367. @mixin valo-menu-large-icons-style ($bg: darken($valo-menu-background-color, 4%)) {
  368. background-color: $bg;
  369. min-width: $v-unit-size * 2;
  370. max-width: $v-unit-size * 3;
  371. .valo-menu-title {
  372. font-size: round($v-font-size * 0.75);
  373. .v-label-undef-w {
  374. white-space: normal;
  375. }
  376. }
  377. .v-menubar-user-menu {
  378. margin-left: 0;
  379. margin-right: 0;
  380. font-size: round($v-font-size * 0.7);
  381. img.v-icon {
  382. width: round($v-unit-size/1.3);
  383. height: round($v-unit-size/1.3);
  384. }
  385. }
  386. [class*="subtitle"] {
  387. margin: round($v-unit-size/4) 0 0;
  388. padding: round($v-unit-size/5) round($v-unit-size/1.5) round($v-unit-size/5) round($v-unit-size/4);
  389. line-height: 1;
  390. border: none;
  391. text-overflow: ellipsis;
  392. overflow: hidden;
  393. background: darken($bg, 6%);
  394. font-size: round($v-font-size * 0.8);
  395. box-shadow: valo-bevel-and-shadow($shadow: $v-shadow);
  396. [class*="badge"] {
  397. right: round($v-unit-size/4);
  398. }
  399. + .valo-menu-item {
  400. border-top: none;
  401. }
  402. }
  403. .valo-menu-item {
  404. display: block;
  405. font-size: round($v-font-size * 1.6);
  406. line-height: 1;
  407. padding: round($v-unit-size/3);
  408. text-align: center;
  409. border-top: valo-border($color: $bg, $strength: 0.2, $border: first-number($v-border) solid v-tone);
  410. &:first-child {
  411. border-top: none;
  412. }
  413. [class*="caption"] {
  414. display: block;
  415. width: auto;
  416. margin: .3em 0 0;
  417. padding: 0;
  418. font-size: round($v-font-size * 0.7);
  419. line-height: 1.3;
  420. }
  421. .v-icon {
  422. margin: 0;
  423. }
  424. span.v-icon {
  425. opacity: 0.8;
  426. }
  427. &.selected {
  428. background: if(is-dark-color($bg), darken($bg, 3%), lighten($bg, 5%));
  429. .v-icon {
  430. opacity: 1;
  431. }
  432. [class*="badge"] {
  433. border-color: darken($bg, 3%);
  434. }
  435. }
  436. [class*="badge"] {
  437. padding-left: round($v-unit-size/9);
  438. padding-right: round($v-unit-size/9);
  439. top: round($v-unit-size/5);
  440. right: round($v-unit-size/5);
  441. border: 2px solid $bg;
  442. }
  443. }
  444. }
  445. /**
  446. *
  447. *
  448. *
  449. * @group valo-menu
  450. */
  451. @mixin valo-menu-logo-style {
  452. display: block;
  453. overflow: hidden;
  454. width: round($v-unit-size * 1.2) !important;
  455. height: round($v-unit-size * 1.2);
  456. border-radius: $v-border-radius;
  457. text-align: center;
  458. @include valo-gradient($color: $v-selection-color);
  459. color: valo-font-color($v-selection-color, 1);
  460. font-size: round($v-unit-size/1.5);
  461. line-height: round($v-unit-size * 1.2);
  462. margin: round($v-unit-size/2) auto;
  463. @include box-shadow(valo-bevel-and-shadow($shadow: $v-shadow));
  464. &:focus {
  465. outline: none;
  466. }
  467. }