splitbutton.css 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. * Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md.
  4. */
  5. @import "../../../mixins/_rounded.css";
  6. :root {
  7. --ck-color-split-button-hover-background: hsl(0, 0%, 92%);
  8. --ck-color-split-button-hover-border: hsl(0, 0%, 70%);
  9. }
  10. .ck.ck-splitbutton {
  11. & > .ck-splitbutton__action {
  12. /* Don't round the first button on the right side */
  13. @mixin ck-rounded-corners {
  14. border-top-right-radius: unset;
  15. border-bottom-right-radius: unset;
  16. }
  17. }
  18. & > .ck-splitbutton__arrow {
  19. /* It's a text-less button but still, it should not be square. */
  20. min-width: unset;
  21. /* Don't round the arrow button on the right side */
  22. @mixin ck-rounded-corners {
  23. border-top-left-radius: unset;
  24. border-bottom-left-radius: unset;
  25. }
  26. & svg {
  27. width: var(--ck-dropdown-arrow-size);
  28. }
  29. }
  30. /* When the split button is "open" (the arrow is on) or being hovered, it should get some styling
  31. as a whole. The background of both buttons should stand out and there should be a visual
  32. separation between both buttons. */
  33. &.ck-splitbutton_open,
  34. &:hover {
  35. /* When the split button hovered as a whole, not as individual buttons. */
  36. & > .ck-button:not(.ck-on):not(:hover) {
  37. background: var(--ck-color-split-button-hover-background);
  38. }
  39. & > .ck-splitbutton__arrow {
  40. border-left-color: var(--ck-color-split-button-hover-border);
  41. }
  42. }
  43. /* Don't round the bottom left and right corners of the buttons when "open"
  44. https://github.com/ckeditor/ckeditor5/issues/816 */
  45. &.ck-splitbutton_open {
  46. @mixin ck-rounded-corners {
  47. & > .ck-splitbutton__action {
  48. border-bottom-left-radius: 0;
  49. }
  50. & > .ck-splitbutton__arrow {
  51. border-bottom-right-radius: 0;
  52. }
  53. }
  54. }
  55. }