media-library.css

Same filename in this branch
  1. 11.x core/profiles/demo_umami/themes/umami/css/classy/layout/media-library.css
  2. 11.x core/themes/claro/css/theme/media-library.css
  3. 11.x core/themes/admin/css/theme/media-library.css
  4. 11.x core/themes/default_admin/css/theme/media-library.css
Same filename and directory in other branches
  1. 10 core/profiles/demo_umami/themes/umami/css/classy/layout/media-library.css
  2. 10 core/themes/claro/css/theme/media-library.css
  3. 9 core/profiles/demo_umami/themes/umami/css/classy/layout/media-library.css
  4. 9 core/themes/seven/css/theme/media-library.css
  5. 9 core/themes/seven/css/classy/layout/media-library.css
  6. 9 core/themes/claro/css/theme/media-library.css
  7. 9 core/themes/bartik/css/classy/layout/media-library.css
  8. 9 core/themes/classy/css/layout/media-library.css
  9. 8.9.x core/profiles/demo_umami/themes/umami/css/classy/layout/media-library.css
  10. 8.9.x core/themes/seven/css/theme/media-library.css
  11. 8.9.x core/themes/seven/css/classy/layout/media-library.css
  12. 8.9.x core/themes/claro/css/theme/media-library.css
  13. 8.9.x core/themes/bartik/css/classy/layout/media-library.css
  14. 8.9.x core/themes/classy/css/layout/media-library.css
/*
 * DO NOT EDIT THIS FILE.
 * See the following change record for more information,
 * https://www.drupal.org/node/3084859
 * @preserve
 */

/*
 * @file
 *
 * Styling for Media Library.
 */

/*
 * The field widget shown on the entity create page.
 */

.field--widget-media-library-widget {
  .media-library-item__preview {
    cursor: move;

    img {
      border-start-start-radius: 2px;
      border-start-end-radius: 2px;
    }
  }

  .js-media-library-item:only-child .media-library-item__preview {
    cursor: inherit;
  }
}

/**
 * Negative margins compensate for modal dialog padding and compensate for
 * positioning that would otherwise hide the active tab indicator on the start.
 */

#media-library-wrapper {
  display: flex;
  margin-inline: calc(-1 * var(--space-l));

  .messages-list,
  .messages {
    margin-block: 0 var(--space-l);
  }

  /* "Grid" and "Table" buttons. */
  .views-display-link {
    position: relative;
    margin: 0;
    padding-inline-start: 1.375rem;
    white-space: nowrap;
    -webkit-text-decoration: none;
    text-decoration: none;
    color: var(--gin-color-text);
    background-image: none;
    font-size: 0.9375rem;
    line-height: 1rem;

    &::before {
      position: absolute;
      display: inline-block;
      width: 1rem;
      height: 1rem;
      content: "";
      background-color: var(--gin-color-text);
      inset-block-start: 1px;
      inset-inline-start: 0;
    }

    &.is-active {
      color: var(--gin-color-primary);
      font-weight: bold;

      &::before {
        background-color: var(--gin-color-primary);
      }
    }
  }

  .views-display-link-widget::before {
    mask-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3e  %3cg fill='none' stroke='currentColor' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3e    %3crect x='3' y='3' width='7' height='7'%3e%3c/rect%3e    %3crect x='14' y='3' width='7' height='7'%3e%3c/rect%3e    %3crect x='14' y='14' width='7' height='7'%3e%3c/rect%3e    %3crect x='3' y='14' width='7' height='7'%3e%3c/rect%3e  %3c/g%3e%3c/svg%3e");
  }

  .views-display-link-widget_table::before {
    mask-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3e  %3cg fill='none' stroke='currentColor' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3e    %3cline x1='8' y1='6' x2='21' y2='6'%3e%3c/line%3e    %3cline x1='8' y1='12' x2='21' y2='12'%3e%3c/line%3e    %3cline x1='8' y1='18' x2='21' y2='18'%3e%3c/line%3e    %3cline x1='3' y1='6' x2='3.01' y2='6'%3e%3c/line%3e    %3cline x1='3' y1='12' x2='3.01' y2='12'%3e%3c/line%3e    %3cline x1='3' y1='18' x2='3.01' y2='18'%3e%3c/line%3e  %3c/g%3e%3c/svg%3e");
  }
}

#media-library-content {
  width: 100%;
  padding: 1em;
  border-color: var(--gin-border-color);
  border-inline-start: 0 none;
  outline: none;

  .media-library-menu + & {
    z-index: var(--vertical-tabs-menu--z-index);
    border-inline-start: var(--vertical-tabs-border);
    box-shadow: var(--vertical-tabs-shadow);
  }
}

/* Generic media add form styles. */

.media-library-add-form--without-input .form-item {
  margin-inline-end: 1rem;
}

.media-library-add-form__input-wrapper {
  .form-item--upload {
    margin-block-start: 0;
    margin-inline-end: 0;
  }

  .dropzone-enable .button {
    margin: 0;
  }
}

/* Form within media library that allows you to upload additional media. */

.media-library-add-form {
  .messages-list:has(.messages) {
    margin-block: var(--space-m);
  }

  .file-upload-help {
    margin: 0.5rem 0 0;
  }
}

/* Style the media add oEmbed form. */

.media-library-add-form--oembed {
  .media-library-add-form__input-wrapper {
    display: flex;
    align-items: center;

    @media screen and (max-width: 37.5em) {
      display: block;
    }
  }

  &.media-library-add-form--without-input .form-item-url {
    margin-block-end: 0;
  }
}

.media-library-add-form-oembed-url {
  width: 100%;
}

.media-library-select-all {
  flex-basis: 100%;
  box-sizing: border-box;
  width: 100%;
  color: var(--gin-color-title);
  border-block-end: 1px solid var(--gin-border-color-table-header);
  border-radius: 0;
  background: var(--gin-bg-layer);
  margin-block: 0 0.625rem;
  margin-inline: 0 0.5rem;
  padding-block: 0 var(--space-m);
  padding-inline: var(--space-m);

  input {
    margin-inline-end: 0.625rem;
  }
}

.media-library-add-form__selected-media .details-wrapper,
.media-library-view .form--inline {
  display: flex;
  flex-wrap: wrap;
}

.media-library-views-form__header {
  flex-basis: 100%;

  .form-item {
    margin-inline-end: 0.5rem;
  }
}

.media-library-views-form__rows {
  display: grid;
  gap: 0.625rem;
  grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr));
}

.media-library-widget-modal {
  /* By default, the dialog is too narrow to be usable. @see Drupal.ckeditor5.openDialog() */
  &.ui-dialog--narrow {
    min-width: min(75%, 93.75rem);
  }

  .ui-dialog-buttonpane {
    display: flex;
    flex-direction: column;
    align-items: center;

    .form-actions,
    .field-actions {
      flex: 1;
    }

    .form-actions {
      display: flex;
      flex-direction: row;
      justify-content: flex-end;
      margin-block-start: 0;
      white-space: nowrap;

      .button:not(:last-child) {
        margin-inline-end: var(--space-xs);
      }
    }

    .media-library-selected-count {
      flex-grow: 1;
      margin-block-end: var(--space-s);

      /* cspell:disable-next-line */
      @media (min-width: 36.75em) {
        margin-block-end: 0;
        margin-inline-start: 0;
      }
    }

    /* cspell:disable-next-line */
    @media (min-width: 36.75em) {
      flex-direction: row;
    }
  }
}

/*
 * Selection widget area shown on the parent form after items are
 * inserted.
 */

.media-library-selection {
  display: grid;
  gap: 0.625rem;
  grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr));
}

/* Media library widget styles. */

.media-library-widget {
  position: relative;
}

fieldset.media-library-widget {
  .media-library-edit__link {
    margin: var(--space-xs);
  }
}

.media-library-widget__toggle-weight {
  position: absolute;
  inset-block-start: var(--space-s);
  inset-inline-end: var(--space-m);
  -webkit-text-decoration: none;
  text-decoration: none;

  .fieldset.media-library-widget & {
    padding: var(--space-xs);
    font-size: var(--font-size-xxs);
    line-height: 1;
  }
}

/* The <li> that is shown after a media item has been uploaded */

.media-library-add-form__media {
  position: relative;
  display: flex;
  gap: 1.25rem;
  padding: 0.625rem;
  border-block-end: 1px solid #c0c0c0;

  /* Do not show the bottom border and padding for the last item. */
  &:last-child {
    padding-block-end: 0;
    border-block-end: 0;
  }
}

/*
 * Only renders after a file is uploaded via the add-form. Coverage matrix never
 * completed an upload.
 */

.media-library-add-form__preview {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 13.75rem;
  background: var(--gin-bg-app);
}

.media-library-add-form__fields {
  display: grid;
  flex-grow: 1;
  gap: 0.625rem;

  .form-item,
  .form-managed-file__meta {
    margin-block: 0;
  }
}

.media-library-add-form__remove-button {
  position: absolute;
  inset-inline-end: 0;

  &.button--extrasmall {
    margin: var(--space-xs) 0;
  }
}

.media-library-selected-count {
  margin: 0 var(--space-l);
  color: var(--gin-color-text-light);
}

.media-library-widget-empty-text {
  margin-inline: 0;
  color: var(--gin-color-text-light);
}

.media-library-open-button {
  margin-block-start: 0;
}

.media-library-view {
  display: grid;
  gap: var(--space-l);

  .view-header {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9375rem;
    padding: var(--space-m);
    -webkit-text-decoration: none;
    text-decoration: none;
    color: var(--gin-color-text);
    border-radius: var(--gin-border-m);
    background: var(--gin-bg-layer3);
    box-shadow: var(--gin-shadow-l1);
  }

  .views-exposed-form {
    margin-block: 0;
  }
}

File

core/themes/default_admin/css/components/media-library.css

View source
  1. /*
  2. * DO NOT EDIT THIS FILE.
  3. * See the following change record for more information,
  4. * https://www.drupal.org/node/3084859
  5. * @preserve
  6. */
  7. /*
  8. * @file
  9. *
  10. * Styling for Media Library.
  11. */
  12. /*
  13. * The field widget shown on the entity create page.
  14. */
  15. .field--widget-media-library-widget {
  16. .media-library-item__preview {
  17. cursor: move;
  18. img {
  19. border-start-start-radius: 2px;
  20. border-start-end-radius: 2px;
  21. }
  22. }
  23. .js-media-library-item:only-child .media-library-item__preview {
  24. cursor: inherit;
  25. }
  26. }
  27. /**
  28. * Negative margins compensate for modal dialog padding and compensate for
  29. * positioning that would otherwise hide the active tab indicator on the start.
  30. */
  31. #media-library-wrapper {
  32. display: flex;
  33. margin-inline: calc(-1 * var(--space-l));
  34. .messages-list,
  35. .messages {
  36. margin-block: 0 var(--space-l);
  37. }
  38. /* "Grid" and "Table" buttons. */
  39. .views-display-link {
  40. position: relative;
  41. margin: 0;
  42. padding-inline-start: 1.375rem;
  43. white-space: nowrap;
  44. -webkit-text-decoration: none;
  45. text-decoration: none;
  46. color: var(--gin-color-text);
  47. background-image: none;
  48. font-size: 0.9375rem;
  49. line-height: 1rem;
  50. &::before {
  51. position: absolute;
  52. display: inline-block;
  53. width: 1rem;
  54. height: 1rem;
  55. content: "";
  56. background-color: var(--gin-color-text);
  57. inset-block-start: 1px;
  58. inset-inline-start: 0;
  59. }
  60. &.is-active {
  61. color: var(--gin-color-primary);
  62. font-weight: bold;
  63. &::before {
  64. background-color: var(--gin-color-primary);
  65. }
  66. }
  67. }
  68. .views-display-link-widget::before {
  69. mask-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3e %3cg fill='none' stroke='currentColor' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3e %3crect x='3' y='3' width='7' height='7'%3e%3c/rect%3e %3crect x='14' y='3' width='7' height='7'%3e%3c/rect%3e %3crect x='14' y='14' width='7' height='7'%3e%3c/rect%3e %3crect x='3' y='14' width='7' height='7'%3e%3c/rect%3e %3c/g%3e%3c/svg%3e");
  70. }
  71. .views-display-link-widget_table::before {
  72. mask-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3e %3cg fill='none' stroke='currentColor' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3e %3cline x1='8' y1='6' x2='21' y2='6'%3e%3c/line%3e %3cline x1='8' y1='12' x2='21' y2='12'%3e%3c/line%3e %3cline x1='8' y1='18' x2='21' y2='18'%3e%3c/line%3e %3cline x1='3' y1='6' x2='3.01' y2='6'%3e%3c/line%3e %3cline x1='3' y1='12' x2='3.01' y2='12'%3e%3c/line%3e %3cline x1='3' y1='18' x2='3.01' y2='18'%3e%3c/line%3e %3c/g%3e%3c/svg%3e");
  73. }
  74. }
  75. #media-library-content {
  76. width: 100%;
  77. padding: 1em;
  78. border-color: var(--gin-border-color);
  79. border-inline-start: 0 none;
  80. outline: none;
  81. .media-library-menu +
  82. }
  83. /* Generic media add form styles. */
  84. .media-library-add-form--without-input .form-item {
  85. margin-inline-end: 1rem;
  86. }
  87. .media-library-add-form__input-wrapper {
  88. .form-item--upload {
  89. margin-block-start: 0;
  90. margin-inline-end: 0;
  91. }
  92. .dropzone-enable .button {
  93. margin: 0;
  94. }
  95. }
  96. /* Form within media library that allows you to upload additional media. */
  97. .media-library-add-form {
  98. .messages-list:has(.messages) {
  99. margin-block: var(--space-m);
  100. }
  101. .file-upload-help {
  102. margin: 0.5rem 0 0;
  103. }
  104. }
  105. /* Style the media add oEmbed form. */
  106. .media-library-add-form--oembed {
  107. .media-library-add-form__input-wrapper {
  108. display: flex;
  109. align-items: center;
  110. @media screen and (max-width: 37.5em) {
  111. display: block;
  112. }
  113. }
  114. &.media-library-add-form--without-input .form-item-url {
  115. margin-block-end: 0;
  116. }
  117. }
  118. .media-library-add-form-oembed-url {
  119. width: 100%;
  120. }
  121. .media-library-select-all {
  122. flex-basis: 100%;
  123. box-sizing: border-box;
  124. width: 100%;
  125. color: var(--gin-color-title);
  126. border-block-end: 1px solid var(--gin-border-color-table-header);
  127. border-radius: 0;
  128. background: var(--gin-bg-layer);
  129. margin-block: 0 0.625rem;
  130. margin-inline: 0 0.5rem;
  131. padding-block: 0 var(--space-m);
  132. padding-inline: var(--space-m);
  133. input {
  134. margin-inline-end: 0.625rem;
  135. }
  136. }
  137. .media-library-add-form__selected-media .details-wrapper,
  138. .media-library-view .form--inline {
  139. display: flex;
  140. flex-wrap: wrap;
  141. }
  142. .media-library-views-form__header {
  143. flex-basis: 100%;
  144. .form-item {
  145. margin-inline-end: 0.5rem;
  146. }
  147. }
  148. .media-library-views-form__rows {
  149. display: grid;
  150. gap: 0.625rem;
  151. grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr));
  152. }
  153. .media-library-widget-modal {
  154. /* By default, the dialog is too narrow to be usable. @see Drupal.ckeditor5.openDialog() */
  155. &.ui-dialog--narrow {
  156. min-width: min(75%, 93.75rem);
  157. }
  158. .ui-dialog-buttonpane {
  159. display: flex;
  160. flex-direction: column;
  161. align-items: center;
  162. .form-actions,
  163. .field-actions {
  164. flex: 1;
  165. }
  166. .form-actions {
  167. display: flex;
  168. flex-direction: row;
  169. justify-content: flex-end;
  170. margin-block-start: 0;
  171. white-space: nowrap;
  172. .button:not(:last-child) {
  173. margin-inline-end: var(--space-xs);
  174. }
  175. }
  176. .media-library-selected-count {
  177. flex-grow: 1;
  178. margin-block-end: var(--space-s);
  179. /* cspell:disable-next-line */
  180. @media (min-width: 36.75em) {
  181. margin-block-end: 0;
  182. margin-inline-start: 0;
  183. }
  184. }
  185. /* cspell:disable-next-line */
  186. @media (min-width: 36.75em) {
  187. flex-direction: row;
  188. }
  189. }
  190. }
  191. /*
  192. * Selection widget area shown on the parent form after items are
  193. * inserted.
  194. */
  195. .media-library-selection {
  196. display: grid;
  197. gap: 0.625rem;
  198. grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr));
  199. }
  200. /* Media library widget styles. */
  201. .media-library-widget {
  202. position: relative;
  203. }
  204. fieldset.media-library-widget {
  205. .media-library-edit__link {
  206. margin: var(--space-xs);
  207. }
  208. }
  209. .media-library-widget__toggle-weight {
  210. position: absolute;
  211. inset-block-start: var(--space-s);
  212. inset-inline-end: var(--space-m);
  213. -webkit-text-decoration: none;
  214. text-decoration: none;
  215. .fieldset.media-library-widget
  216. }
  217. /* The
  218. that is shown after a media item has been uploaded */
  219. .media-library-add-form__media {
  220. position: relative;
  221. display: flex;
  222. gap: 1.25rem;
  223. padding: 0.625rem;
  224. border-block-end: 1px solid #c0c0c0;
  225. /* Do not show the bottom border and padding for the last item. */
  226. &:last-child {
  227. padding-block-end: 0;
  228. border-block-end: 0;
  229. }
  230. }
  231. /*
  232. * Only renders after a file is uploaded via the add-form. Coverage matrix never
  233. * completed an upload.
  234. */
  235. .media-library-add-form__preview {
  236. display: flex;
  237. align-items: center;
  238. justify-content: center;
  239. width: 13.75rem;
  240. background: var(--gin-bg-app);
  241. }
  242. .media-library-add-form__fields {
  243. display: grid;
  244. flex-grow: 1;
  245. gap: 0.625rem;
  246. .form-item,
  247. .form-managed-file__meta {
  248. margin-block: 0;
  249. }
  250. }
  251. .media-library-add-form__remove-button {
  252. position: absolute;
  253. inset-inline-end: 0;
  254. &.button--extrasmall {
  255. margin: var(--space-xs) 0;
  256. }
  257. }
  258. .media-library-selected-count {
  259. margin: 0 var(--space-l);
  260. color: var(--gin-color-text-light);
  261. }
  262. .media-library-widget-empty-text {
  263. margin-inline: 0;
  264. color: var(--gin-color-text-light);
  265. }
  266. .media-library-open-button {
  267. margin-block-start: 0;
  268. }
  269. .media-library-view {
  270. display: grid;
  271. gap: var(--space-l);
  272. .view-header {
  273. display: flex;
  274. flex-wrap: wrap;
  275. gap: 0.9375rem;
  276. padding: var(--space-m);
  277. -webkit-text-decoration: none;
  278. text-decoration: none;
  279. color: var(--gin-color-text);
  280. border-radius: var(--gin-border-m);
  281. background: var(--gin-bg-layer3);
  282. box-shadow: var(--gin-shadow-l1);
  283. }
  284. .views-exposed-form {
  285. margin-block: 0;
  286. }
  287. }

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