split-menu.less 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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. color: @white;
  37. padding-top: 0;
  38. padding-bottom: 0;
  39. &.btn-primary {
  40. border-right: 1px solid @green-10;
  41. }
  42. // on new css, btn-secondary already has a border
  43. &.btn-secondary when (@is-new-css = false) {
  44. border-right: 1px solid @neutral-10;
  45. }
  46. &.btn-danger {
  47. border-right: 1px solid @red-10;
  48. }
  49. &[disabled] when (@is-new-css = false) {
  50. opacity: 1;
  51. }
  52. }
  53. .split-menu-button when (@is-new-css = true) {
  54. // workaround for for the blue 2x border on the new css
  55. // 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
  56. z-index: 1;
  57. }
  58. .split-menu-dropdown {
  59. float: none;
  60. display: flex;
  61. flex-wrap: nowrap;
  62. align-self: stretch;
  63. margin-right: 6px;
  64. .split-menu-dropdown-toggle {
  65. border-bottom-left-radius: 0;
  66. border-top-left-radius: 0;
  67. padding: 0 8px;
  68. // on new css, btn-secondary has a border
  69. // since the border between both buttons already been defined in the `split-menu-button`
  70. // we will remove the rule from the dropdown toggle
  71. &.btn-secondary when (@is-new-css = true) {
  72. border-left: none;
  73. }
  74. }
  75. }
  76. }