editor-floating-menu.scss 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. .editor-floating-menu {
  2. display: flex;
  3. flex-direction: column;
  4. box-shadow: 0 2px 4px 0 #1e253029;
  5. background-color: var(--dropdown-background);
  6. color: var(--dropdown-text-color);
  7. border: 1px solid var(--border-divider);
  8. border-radius: var(--border-radius-base);
  9. padding: var(--spacing-02);
  10. gap: var(--spacing-02);
  11. transition: opacity 0.05s ease-in;
  12. opacity: 0;
  13. }
  14. .editor-floating-menu-visible {
  15. opacity: 1;
  16. }
  17. // Module actions self-gate and may render nothing, so hide the pill when it
  18. // has no buttons rather than showing an empty box.
  19. .editor-floating-menu:not(:has(button)) {
  20. display: none;
  21. }
  22. .editor-floating-menu-button {
  23. display: flex;
  24. align-items: center;
  25. justify-content: center;
  26. background-color: inherit;
  27. color: inherit;
  28. border: none;
  29. padding: var(--spacing-01);
  30. border-radius: var(--border-radius-base);
  31. cursor: pointer;
  32. &:hover {
  33. background-color: var(--dropdown-background-hover);
  34. }
  35. }
  36. .editor-floating-menu-divider {
  37. height: 1px;
  38. background-color: var(--dropdown-border-divider);
  39. // Hide dividers at the menu edges, or with no following button (e.g. a module
  40. // action rendered nothing). `~ * button` keeps it wrapper-agnostic.
  41. &:first-child,
  42. &:last-child,
  43. &:not(:has(~ button, ~ * button)) {
  44. display: none;
  45. }
  46. }
  47. // Flatten AppWritefullContainer's `<div class="writefull">` wrapper so the button
  48. // is a direct flex item of the menu.
  49. .editor-floating-menu .writefull {
  50. display: contents;
  51. }
  52. @include theme('default') {
  53. .cm-tooltip .editor-floating-menu {
  54. border-color: var(--border-primary);
  55. }
  56. }