context-menu.css 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. [data-component="context-menu-content"],
  2. [data-component="context-menu-sub-content"] {
  3. min-width: 8rem;
  4. overflow: hidden;
  5. border: none;
  6. border-radius: var(--radius-md);
  7. box-shadow: var(--shadow-xs-border);
  8. background-clip: padding-box;
  9. background-color: var(--surface-raised-stronger-non-alpha);
  10. padding: 4px;
  11. z-index: 100;
  12. transform-origin: var(--kb-menu-content-transform-origin);
  13. &:focus-within,
  14. &:focus {
  15. outline: none;
  16. }
  17. animation: contextMenuContentHide var(--transition-duration) var(--transition-easing) forwards;
  18. @starting-style {
  19. animation: none;
  20. }
  21. &[data-expanded] {
  22. pointer-events: auto;
  23. animation: contextMenuContentShow var(--transition-duration) var(--transition-easing) forwards;
  24. }
  25. }
  26. [data-component="context-menu-content"],
  27. [data-component="context-menu-sub-content"] {
  28. [data-slot="context-menu-item"],
  29. [data-slot="context-menu-checkbox-item"],
  30. [data-slot="context-menu-radio-item"],
  31. [data-slot="context-menu-sub-trigger"] {
  32. position: relative;
  33. display: flex;
  34. align-items: center;
  35. gap: 8px;
  36. padding: 4px 8px;
  37. border-radius: var(--radius-sm);
  38. cursor: default;
  39. outline: none;
  40. font-family: var(--font-family-sans);
  41. font-size: var(--font-size-base);
  42. font-weight: var(--font-weight-medium);
  43. line-height: var(--line-height-large);
  44. letter-spacing: var(--letter-spacing-normal);
  45. color: var(--text-strong);
  46. transition-property: background-color, color;
  47. transition-duration: var(--transition-duration);
  48. transition-timing-function: var(--transition-easing);
  49. user-select: none;
  50. &:hover {
  51. background-color: var(--surface-raised-base-hover);
  52. }
  53. &[data-disabled] {
  54. color: var(--text-weak);
  55. pointer-events: none;
  56. }
  57. }
  58. [data-slot="context-menu-sub-trigger"] {
  59. &[data-expanded] {
  60. background: var(--surface-raised-base-hover);
  61. outline: none;
  62. border: none;
  63. }
  64. }
  65. [data-slot="context-menu-item-indicator"] {
  66. display: flex;
  67. align-items: center;
  68. justify-content: center;
  69. width: 16px;
  70. height: 16px;
  71. }
  72. [data-slot="context-menu-item-label"] {
  73. flex: 1;
  74. }
  75. [data-slot="context-menu-item-description"] {
  76. font-size: var(--font-size-x-small);
  77. color: var(--text-weak);
  78. }
  79. [data-slot="context-menu-separator"] {
  80. height: 1px;
  81. margin: 4px -4px;
  82. border-top-color: var(--border-weak-base);
  83. }
  84. [data-slot="context-menu-group-label"] {
  85. padding: 4px 8px;
  86. font-family: var(--font-family-sans);
  87. font-size: var(--font-size-x-small);
  88. font-weight: var(--font-weight-medium);
  89. line-height: var(--line-height-large);
  90. letter-spacing: var(--letter-spacing-normal);
  91. color: var(--text-weak);
  92. }
  93. [data-slot="context-menu-arrow"] {
  94. fill: var(--surface-raised-stronger-non-alpha);
  95. }
  96. }
  97. @keyframes contextMenuContentShow {
  98. from {
  99. opacity: 0;
  100. transform: scaleY(0.95);
  101. }
  102. to {
  103. opacity: 1;
  104. transform: scaleY(1);
  105. }
  106. }
  107. @keyframes contextMenuContentHide {
  108. from {
  109. opacity: 1;
  110. transform: scaleY(1);
  111. }
  112. to {
  113. opacity: 0;
  114. transform: scaleY(0.95);
  115. }
  116. }