split-menu.less 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. .split-menu {
  2. display: flex;
  3. &.btn-md,
  4. &.btn-sm,
  5. &.btn-xs {
  6. padding: 0;
  7. }
  8. &.btn-md {
  9. & > .split-menu-button,
  10. & > .split-menu-dropdown-toggle {
  11. height: 36px;
  12. }
  13. }
  14. &.btn-sm {
  15. & > .split-menu-button,
  16. & > .split-menu-dropdown-toggle {
  17. height: 32px;
  18. }
  19. }
  20. &.btn-xs {
  21. & > .split-menu-button,
  22. & > .split-menu-dropdown-toggle {
  23. height: 28px;
  24. }
  25. }
  26. &.btn-primary {
  27. background-color: @ol-green;
  28. }
  29. .split-menu-icon {
  30. margin-right: @line-height-computed / 4;
  31. }
  32. .split-menu-button {
  33. border-top-right-radius: 0;
  34. border-bottom-right-radius: 0;
  35. height: 100%;
  36. padding-top: 0;
  37. padding-bottom: 0;
  38. &.btn-primary {
  39. border-right: 1px solid fade(@neutral-90, 16%);
  40. }
  41. // on new css, btn-secondary already has a border
  42. &.btn-secondary when (@is-new-css = false) {
  43. border-right: 1px solid fade(@ol-blue-gray-6, 16%);
  44. }
  45. &.btn-danger {
  46. border-right: 1px solid fade(@neutral-90, 16%);
  47. }
  48. &[disabled] when (@is-new-css = false) {
  49. opacity: 1;
  50. }
  51. &.no-left-radius {
  52. border-top-left-radius: 0;
  53. border-bottom-left-radius: 0;
  54. }
  55. }
  56. .split-menu-button when (@is-new-css = true) {
  57. // workaround for for the blue 2x border on the new css
  58. // if z-index rule is not added, the border will overlap under the `split-menu-dropdown-toggle` since margin between both component is only 1px
  59. z-index: 1;
  60. }
  61. .split-menu-dropdown {
  62. float: none;
  63. display: flex;
  64. flex-wrap: nowrap;
  65. align-self: stretch;
  66. margin-right: 6px;
  67. .split-menu-dropdown-toggle {
  68. border-bottom-left-radius: 0;
  69. border-top-left-radius: 0;
  70. padding: 0 8px;
  71. // on new css, btn-secondary has a border
  72. // since the border between both buttons already been defined in the `split-menu-button`
  73. // we will remove the rule from the dropdown toggle
  74. &.btn-secondary when (@is-new-css = true) {
  75. border-left: none;
  76. }
  77. }
  78. }
  79. }