drupalmedia.css

Same filename in other branches
  1. 9 core/modules/ckeditor5/css/drupalmedia.css
  2. 11.x core/modules/ckeditor5/css/drupalmedia.css

Styles for the Drupal Media in CKEditor 5.

Most of these styles are written to match those in the CKEditor 5 image plugin to provide a consistent editing experience.

File

core/modules/ckeditor5/css/drupalmedia.css

View source
  1. /**
  2. * @file
  3. * Styles for the Drupal Media in CKEditor 5.
  4. *
  5. * Most of these styles are written to match those in the CKEditor 5 image
  6. * plugin to provide a consistent editing experience.
  7. */
  8. .ck .drupal-media {
  9. position: relative;
  10. display: table;
  11. clear: both;
  12. min-width: 50px;
  13. }
  14. .ck .drupal-media [data-drupal-media-preview] {
  15. pointer-events: none;
  16. }
  17. .ck-content .drupal-media img {
  18. display: block;
  19. min-width: 100%;
  20. max-width: 100%;
  21. margin: 0 auto;
  22. }
  23. .ck-content .drupal-media > figcaption {
  24. display: table-caption;
  25. padding: 0.6em;
  26. caption-side: bottom;
  27. word-break: break-word;
  28. color: hsl(0, 0%, 20%);
  29. outline-offset: -1px;
  30. background-color: hsl(0, 0%, 97%);
  31. font-size: 0.75em;
  32. }
  33. .ck.ck-editor__editable .drupal-media__caption_highlighted {
  34. animation: drupal-media-caption-highlight 0.6s ease-out;
  35. }
  36. @keyframes drupal-media-caption-highlight {
  37. 0% {
  38. background-color: hsl(52, 100%, 50%);
  39. }
  40. 100% {
  41. background-color: hsl(0, 0%, 97%);
  42. }
  43. }
  44. .ck .drupal-media__metadata-error {
  45. position: absolute;
  46. top: 8px;
  47. right: 8px;
  48. width: 28px;
  49. height: 28px;
  50. border: 1px solid #e29700;
  51. border-radius: 50%;
  52. background: #fdf8ed;
  53. }
  54. .ck .drupal-media__metadata-error-icon {
  55. display: block;
  56. width: 28px;
  57. height: 28px;
  58. background: url("../../../misc/icons/e29700/warning.svg") no-repeat center 4px;
  59. background-size: 18px;
  60. }
  61. .ck .drupal-media__metadata-error .ck-tooltip {
  62. display: block;
  63. overflow: visible;
  64. }
  65. .ck .drupal-media__metadata-error:hover .ck-tooltip {
  66. visibility: visible;
  67. opacity: 1;
  68. }
  69. .ck .drupal-media__metadata-error:hover .ck-tooltip__text {
  70. display: block;
  71. width: 240px;
  72. }
  73. .ck.ck-media-alternative-text-form {
  74. min-width: 300px;
  75. max-width: 600px;
  76. padding: 0;
  77. }
  78. .ck.ck-media-alternative-text-form .ck-labeled-field-view,
  79. .ck.ck-media-alternative-text-form .ck-media-alternative-text-form__default-alt-text {
  80. margin: var(--ck-spacing-large) var(--ck-spacing-large) var(--ck-spacing-small);
  81. }
  82. .ck.ck-media-alternative-text-form .ck-labeled-field-view .ck-input-text {
  83. width: 100%;
  84. }
  85. .ck.ck-media-alternative-text-form .ck-button {
  86. width: 50%;
  87. margin: var(--ck-spacing-large) 0 0 0;
  88. padding: var(--ck-spacing-standard);
  89. border: 0;
  90. border-top: 1px solid var(--ck-color-base-border);
  91. border-radius: 0;
  92. }
  93. .ck.ck .ck-media-alternative-text-form__default-alt-text-label {
  94. font-weight: bold;
  95. }
  96. .ck.ck .ck-media-alternative-text-form__default-alt-text-label,
  97. .ck.ck .ck-media-alternative-text-form__default-alt-text-value {
  98. white-space: normal;
  99. }

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.