media-library.css

Same filename in this branch
  1. 8.9.x core/profiles/demo_umami/themes/umami/css/classy/layout/media-library.css
  2. 8.9.x core/themes/seven/css/classy/layout/media-library.css
  3. 8.9.x core/themes/claro/css/theme/media-library.css
  4. 8.9.x core/themes/bartik/css/classy/layout/media-library.css
  5. 8.9.x core/themes/classy/css/layout/media-library.css
Same filename in other branches
  1. 9 core/profiles/demo_umami/themes/umami/css/classy/layout/media-library.css
  2. 9 core/themes/seven/css/theme/media-library.css
  3. 9 core/themes/seven/css/classy/layout/media-library.css
  4. 9 core/themes/claro/css/theme/media-library.css
  5. 9 core/themes/bartik/css/classy/layout/media-library.css
  6. 9 core/themes/classy/css/layout/media-library.css
  7. 10 core/profiles/demo_umami/themes/umami/css/classy/layout/media-library.css
  8. 10 core/themes/claro/css/theme/media-library.css
  9. 11.x core/profiles/demo_umami/themes/umami/css/classy/layout/media-library.css
  10. 11.x core/themes/claro/css/theme/media-library.css

media-library.css

Styling for Media Library.

File

core/themes/seven/css/theme/media-library.css

View source
  1. /**
  2. * @file media-library.css
  3. * Styling for Media Library.
  4. */
  5. .media-library-wrapper {
  6. display: flex;
  7. margin: -1em;
  8. }
  9. /**
  10. * @todo Reuse or build on vertical tabs styling for the media library menu.
  11. * https://www.drupal.org/project/drupal/issues/3023767
  12. */
  13. .media-library-menu {
  14. display: block;
  15. width: 600px;
  16. max-width: 20%;
  17. margin: 0; /* LTR */
  18. padding: 0;
  19. border-bottom: 1px solid #ccc;
  20. background-color: #e6e5e1;
  21. line-height: 1;
  22. }
  23. [dir="rtl"] .media-library-menu {
  24. margin: 0;
  25. }
  26. /**
  27. * @todo Use a class instead of the li element.
  28. * https://www.drupal.org/project/drupal/issues/3029227
  29. */
  30. .media-library-menu li {
  31. display: block;
  32. padding: 0;
  33. list-style: none;
  34. }
  35. .media-library-menu__link {
  36. position: relative;
  37. display: block;
  38. box-sizing: border-box;
  39. padding: 15px;
  40. text-decoration: none;
  41. border-bottom: 1px solid #b3b2ad;
  42. background-color: #f2f2f0;
  43. text-shadow: 0 1px hsla(0, 0%, 100%, 0.6);
  44. }
  45. .media-library-menu__link:active,
  46. .media-library-menu__link:hover,
  47. .media-library-menu__link:focus {
  48. background: #fcfcfa;
  49. text-shadow: none;
  50. }
  51. .media-library-menu__link:focus,
  52. .media-library-menu__link:active {
  53. outline: none;
  54. }
  55. .media-library-menu__link.active {
  56. z-index: 1;
  57. margin-right: -1px; /* LTR */
  58. color: #000;
  59. border-right: 1px solid #fcfcfa; /* LTR */
  60. border-bottom: 1px solid #b3b2ad;
  61. background-color: #fff;
  62. box-shadow: 0 5px 5px -5px hsla(0, 0%, 0%, 0.3);
  63. }
  64. [dir="rtl"] .media-library-menu__link.active {
  65. margin-right: 0;
  66. margin-left: -1px;
  67. border-right: 0;
  68. border-left: 1px solid #fcfcfa;
  69. }
  70. .media-library-content {
  71. width: 100%;
  72. padding: 1em;
  73. border-left: 1px solid #b3b2ad; /* LTR */
  74. outline: none;
  75. }
  76. [dir="rtl"] .media-library-content {
  77. border-right: 1px solid #b3b2ad;
  78. border-left: 0;
  79. }
  80. /* Generic media add form styles. */
  81. .media-library-add-form--without-input .form-item {
  82. margin: 0 0 1em;
  83. }
  84. /**
  85. * Remove outline from added media list.
  86. *
  87. * The added media list receives focus after adding new media, but since it is
  88. * not an interactive element, it does not need an outline.
  89. */
  90. .media-library-add-form__added-media {
  91. margin: 0;
  92. padding: 0;
  93. outline: none;
  94. }
  95. .media-library-add-form__input-wrapper {
  96. padding: 16px;
  97. border: 1px solid #bfbfbf;
  98. border-radius: 2px;
  99. background: #fcfcfa;
  100. }
  101. /* Style the media add upload form. */
  102. .media-library-add-form--upload.media-library-add-form--without-input .form-item-upload {
  103. margin-bottom: 0;
  104. }
  105. .media-library-add-form .file-upload-help {
  106. margin: 8px 0 0;
  107. }
  108. /* Style the media add oEmbed form. */
  109. .media-library-add-form--oembed .media-library-add-form__input-wrapper {
  110. display: flex;
  111. }
  112. @media screen and (max-width: 37.5em) {
  113. .media-library-add-form--oembed .media-library-add-form__input-wrapper {
  114. display: block;
  115. }
  116. }
  117. .media-library-add-form--oembed.media-library-add-form--without-input .form-item-url {
  118. margin-bottom: 0;
  119. }
  120. .media-library-add-form-oembed-url {
  121. width: 100%;
  122. }
  123. /**
  124. * @todo Remove .button when styles are moved to the seven theme in
  125. * https://www.drupal.org/project/drupal/issues/2980769
  126. */
  127. .button.media-library-add-form-oembed-submit {
  128. align-self: center;
  129. }
  130. /* Media add form selection styles. */
  131. .media-library-add-form__selected-media {
  132. margin-top: 1em;
  133. }
  134. /* Change to padding to account for the negative margin for flex grid. */
  135. .media-library-add-form__selected-media .details-wrapper {
  136. padding: 0 10px 1em 10px;
  137. }
  138. .media-library-add-form__selected-media .media-library-item .field--name-thumbnail img {
  139. height: 100px;
  140. }
  141. /* Generic media library view styles. */
  142. .media-library-select-all {
  143. flex-basis: 100%;
  144. width: 100%;
  145. margin: 10px 8px;
  146. }
  147. .media-library-select-all input {
  148. margin-right: 10px;
  149. }
  150. [dir="rtl"] .media-library-select-all input {
  151. margin-left: 10px;
  152. }
  153. .media-library-views-form,
  154. .media-library-selection,
  155. .media-library-add-form__selected-media .details-wrapper,
  156. .media-library-views-form__bulk_form,
  157. .media-library-view .form--inline {
  158. display: flex;
  159. flex-wrap: wrap;
  160. }
  161. .media-library-views-form > .form-actions {
  162. flex-basis: 100%;
  163. }
  164. .media-library-views-form__header {
  165. flex-basis: 100%;
  166. }
  167. .media-library-views-form__header .form-item {
  168. margin-right: 8px;
  169. }
  170. .media-library-views-form__rows {
  171. display: flex;
  172. flex-wrap: wrap;
  173. flex-basis: 100%;
  174. margin: 0 -8px;
  175. }
  176. .media-library-view .form-actions {
  177. align-self: flex-end;
  178. margin: 0.75em 0;
  179. }
  180. @media screen and (max-width: 600px) {
  181. .media-library-view .form-actions {
  182. flex-basis: 100%;
  183. }
  184. }
  185. .media-library-view .media-library-view--form-actions {
  186. clear: left;
  187. align-self: flex-end;
  188. margin: 0.75em 0;
  189. }
  190. /**
  191. * Override the table display of the visually hidden labels.
  192. *
  193. * The width, height and overflow properties in the styles for the
  194. * .visually-hidden class do not work correctly if the element has a table
  195. * display.
  196. */
  197. .media-library-item label {
  198. display: inline-block;
  199. }
  200. /* Media library widget view styles. */
  201. .media-library-wrapper .media-library-view {
  202. position: relative;
  203. display: flex;
  204. flex-wrap: wrap;
  205. justify-content: space-between;
  206. }
  207. .media-library-wrapper .view-header {
  208. align-self: flex-end;
  209. margin: 1em 0;
  210. text-align: right; /* LTR */
  211. }
  212. [dir="rtl"] .media-library-wrapper .view-header {
  213. text-align: left;
  214. }
  215. .media-library-wrapper .media-library-view .view-content {
  216. flex: 0 0 100%;
  217. }
  218. .media-library-wrapper .views-display-link {
  219. margin: 0;
  220. padding-left: 22px; /* LTR */
  221. color: #333;
  222. font-size: 15px;
  223. line-height: 16px;
  224. }
  225. [dir="rtl"] .media-library-wrapper .views-display-link {
  226. padding-right: 22px;
  227. padding-left: 0;
  228. }
  229. .media-library-wrapper .views-display-link.is-active {
  230. font-weight: bold;
  231. }
  232. .media-library-wrapper .views-display-link-widget {
  233. margin-right: 15px;
  234. background: url(../../../../misc/icons/333333/grid.svg) left 0 no-repeat; /* LTR */
  235. }
  236. [dir="rtl"] .media-library-wrapper .views-display-link-widget {
  237. background-position: right 0;
  238. }
  239. .media-library-wrapper .views-display-link-widget_table {
  240. background: url(../../../../misc/icons/333333/table.svg) left 0 no-repeat; /* LTR */
  241. }
  242. [dir="rtl"] .media-library-wrapper .views-display-link-widget_table {
  243. background-position: right 0;
  244. }
  245. /**
  246. * Style the media library grid items.
  247. */
  248. .media-library-item {
  249. position: relative;
  250. }
  251. /**
  252. * The media library item container receives screen reader focus when items are
  253. * removed. Since it is not an interactive element, it does not need an
  254. * outline.
  255. */
  256. .media-library-item--grid {
  257. justify-content: center;
  258. box-sizing: border-box;
  259. width: 50%;
  260. padding: 8px;
  261. vertical-align: top;
  262. outline: none;
  263. background: #fff;
  264. }
  265. .media-library-item--grid:before {
  266. position: absolute;
  267. top: 7px;
  268. left: 7px;
  269. width: calc(100% - 16px);
  270. height: calc(100% - 16px);
  271. content: "";
  272. transition: border-color 0.2s, color 0.2s, background 0.2s;
  273. pointer-events: none;
  274. border: 1px solid #dbdbdb;
  275. }
  276. /* Media library widget weight field styles. */
  277. .media-library-item--grid .form-item {
  278. margin: 0.75em;
  279. }
  280. /* The selected items in the add form should be shown a bit smaller. */
  281. .media-library-add-form__selected-media .media-library-item--small {
  282. width: 33.3%;
  283. }
  284. .media-library-widget-modal .ui-dialog-buttonpane {
  285. display: flex;
  286. align-items: center;
  287. }
  288. .media-library-widget-modal .ui-dialog-buttonpane .form-actions {
  289. flex: 1;
  290. }
  291. /**
  292. * By default, the dialog is too narrow to be usable.
  293. * @see Drupal.ckeditor.openDialog()
  294. */
  295. .ui-dialog--narrow.media-library-widget-modal {
  296. max-width: 75%;
  297. }
  298. @media screen and (min-width: 45em) {
  299. .media-library-item--grid {
  300. width: 33.3%;
  301. }
  302. /* Change the width for the modal and widget since there is less space. */
  303. .media-library-widget-modal .media-library-item--grid,
  304. .media-library-selection .media-library-item--grid {
  305. width: 50%;
  306. }
  307. /* The selected items in the add form should be shown a bit smaller. */
  308. .media-library-add-form__selected-media .media-library-item--small {
  309. width: 25%;
  310. }
  311. }
  312. @media screen and (min-width: 60em) {
  313. .media-library-item--grid {
  314. width: 25%;
  315. }
  316. /* Change the width for the modal and widget since there is less space. */
  317. .media-library-widget-modal .media-library-item--grid,
  318. .media-library-selection .media-library-item--grid {
  319. width: 33.3%;
  320. }
  321. /* The selected items in the add form should be shown a bit smaller. */
  322. .media-library-add-form__selected-media .media-library-item--small {
  323. width: 16.6%;
  324. }
  325. }
  326. @media screen and (min-width: 77em) {
  327. .media-library-item--grid {
  328. width: 16.6%;
  329. }
  330. /* Change the width for the modal and widget since there is less space. */
  331. .media-library-widget-modal .media-library-item--grid,
  332. .media-library-selection .media-library-item--grid {
  333. width: 25%;
  334. }
  335. /* The selected items in the add form should be shown a bit smaller. */
  336. .media-library-add-form__selected-media .media-library-item--small {
  337. width: 16.6%;
  338. }
  339. }
  340. .media-library-item--grid .field--name-thumbnail {
  341. overflow: hidden;
  342. text-align: center;
  343. background-color: #ebebeb;
  344. }
  345. .media-library-item--grid .field--name-thumbnail img {
  346. height: 180px;
  347. object-fit: contain;
  348. object-position: center center;
  349. }
  350. .media-library-item--grid.is-hover:before,
  351. .media-library-item--grid.checked:before,
  352. .media-library-item--grid.is-focus:before {
  353. top: 5px;
  354. left: 5px;
  355. border-width: 3px;
  356. border-color: #40b6ff;
  357. border-radius: 3px;
  358. }
  359. .media-library-item--grid.checked:before {
  360. border-color: #0076c0;
  361. }
  362. .media-library-item__click-to-select-checkbox {
  363. position: absolute;
  364. z-index: 1;
  365. top: 16px;
  366. left: 16px; /* LTR */
  367. display: block;
  368. }
  369. [dir="rtl"] .media-library-item__click-to-select-checkbox {
  370. right: 16px;
  371. left: auto;
  372. }
  373. .media-library-item__click-to-select-checkbox input {
  374. width: 20px;
  375. height: 20px;
  376. }
  377. .media-library-item__click-to-select-checkbox .form-item {
  378. margin: 0;
  379. }
  380. .media-library-item__click-to-select-trigger {
  381. overflow: hidden;
  382. height: 100%;
  383. cursor: pointer;
  384. }
  385. /* Media library item table styles. */
  386. .media-library-item--table img {
  387. max-width: 100px;
  388. height: auto;
  389. }
  390. /* Media library entity view display styles. */
  391. .media-library-item__preview {
  392. padding-bottom: 34px;
  393. cursor: move;
  394. }
  395. .media-library-item__status {
  396. position: absolute;
  397. top: 40px;
  398. left: 5px; /* LTR */
  399. padding: 5px 10px;
  400. pointer-events: none;
  401. color: #e4e4e4;
  402. background: #666;
  403. font-size: 12px;
  404. font-style: italic;
  405. }
  406. [dir="rtl"] .media-library-item__status {
  407. right: 5px;
  408. left: auto;
  409. }
  410. .media-library-item__attributes {
  411. position: absolute;
  412. bottom: 0;
  413. display: block;
  414. overflow: hidden;
  415. max-width: calc(100% - 10px);
  416. max-height: calc(100% - 50px);
  417. padding: 5px;
  418. background: white;
  419. }
  420. .media-library-item__name {
  421. font-size: 14px;
  422. }
  423. .media-library-item__name {
  424. display: block;
  425. overflow: hidden;
  426. margin: 2px;
  427. white-space: nowrap;
  428. text-overflow: ellipsis;
  429. }
  430. .media-library-item__attributes:hover .media-library-item__name,
  431. .media-library-item--grid.is-focus .media-library-item__name,
  432. .media-library-item--grid.checked .media-library-item__name {
  433. white-space: normal;
  434. }
  435. .media-library-item__type {
  436. color: #696969;
  437. font-size: 12px;
  438. }
  439. .media-library-item--disabled {
  440. pointer-events: none;
  441. opacity: 0.5;
  442. }
  443. /* Media library widget styles. */
  444. .media-library-widget {
  445. position: relative;
  446. }
  447. /**
  448. * @todo Change to .media-library-open-button when styles are moved to the
  449. * seven theme in https://www.drupal.org/project/drupal/issues/2980769
  450. */
  451. .button.media-library-open-button {
  452. margin-bottom: 1em;
  453. margin-left: 0; /* LTR */
  454. }
  455. [dir="rtl"] .button.media-library-open-button {
  456. margin-right: 0;
  457. margin-left: 1em;
  458. }
  459. .media-library-widget__toggle-weight {
  460. position: absolute;
  461. top: 5px;
  462. right: 5px; /* LTR */
  463. }
  464. [dir="rtl"] .media-library-widget__toggle-weight {
  465. right: auto;
  466. left: 5px;
  467. }
  468. /* Add negative margin for flex grid. */
  469. .media-library-selection {
  470. margin: 1em -8px;
  471. }
  472. /**
  473. * Media library widget edit and delete button styles.
  474. *
  475. * We have to override the .button styles since buttons make heavy use of
  476. * background and border property changes.
  477. */
  478. .media-library-item__edit,
  479. .media-library-item__edit:hover,
  480. .media-library-item__edit:focus,
  481. .media-library-item__remove,
  482. .media-library-item__remove:hover,
  483. .media-library-item__remove:focus,
  484. .media-library-item__remove.button,
  485. .media-library-item__remove.button:first-child,
  486. .media-library-item__remove.button:disabled,
  487. .media-library-item__remove.button:disabled:active,
  488. .media-library-item__remove.button:hover,
  489. .media-library-item__remove.button:focus {
  490. position: absolute;
  491. z-index: 1;
  492. top: 10px;
  493. overflow: hidden;
  494. width: 21px;
  495. height: 21px;
  496. margin: 5px;
  497. padding: 0;
  498. transition: 0.2s border-color;
  499. color: transparent;
  500. border: 2px solid #ccc;
  501. border-radius: 20px;
  502. background-size: 13px;
  503. text-shadow: none;
  504. font-size: 0;
  505. }
  506. .media-library-item__edit {
  507. right: 40px; /* LTR */
  508. }
  509. [dir="rtl"] .media-library-item__edit {
  510. right: auto;
  511. left: 40px;
  512. }
  513. .media-library-item__remove {
  514. right: 10px; /* LTR */
  515. }
  516. [dir="rtl"] .media-library-item__remove {
  517. right: auto;
  518. left: 10px;
  519. }
  520. .media-library-item__edit {
  521. background: url("../../../../misc/icons/787878/pencil.svg") #fff center no-repeat;
  522. background-size: 13px;
  523. }
  524. .media-library-item__remove,
  525. .media-library-item__remove.button,
  526. .media-library-item__remove.button:first-child,
  527. .media-library-item__remove.button:disabled,
  528. .media-library-item__remove.button:disabled:active,
  529. .media-library-item__remove.button:hover,
  530. .media-library-item__remove.button:focus {
  531. background: url("../../../../misc/icons/787878/ex.svg") #fff center no-repeat;
  532. background-size: 13px;
  533. }
  534. .media-library-item__edit:hover,
  535. .media-library-item__edit:focus,
  536. .media-library-item__remove:hover,
  537. .media-library-item__remove:focus,
  538. .media-library-item__remove.button:hover,
  539. .media-library-item__remove.button:focus,
  540. .media-library-item__remove.button:disabled:active {
  541. border-color: #40b6ff;
  542. }
  543. /**
  544. * Style the added media item container.
  545. *
  546. * The added media container receives screen reader focus since it has the role
  547. * 'listitem'. Since it is not an interactive element, it does not need an
  548. * outline.
  549. */
  550. .media-library-add-form__media {
  551. position: relative;
  552. display: flex;
  553. padding: 1em 0;
  554. border-bottom: 1px solid #c0c0c0;
  555. outline: none;
  556. }
  557. /* Do not show the top padding for the first item. */
  558. .media-library-add-form__media:first-child {
  559. padding-top: 0;
  560. }
  561. /**
  562. * Change the position of the remove button for the first item.
  563. *
  564. * The first item doesn't have a top padding, change the location of the remove
  565. * button as well.
  566. */
  567. .media-library-add-form__media:first-child .media-library-add-form__remove-button[type="submit"] {
  568. top: 5px;
  569. }
  570. /* Do not show the bottom border and padding for the last item. */
  571. .media-library-add-form__media:last-child {
  572. padding-bottom: 0;
  573. border-bottom: 0;
  574. }
  575. .media-library-add-form__preview {
  576. display: flex;
  577. align-items: center;
  578. justify-content: center;
  579. width: 220px;
  580. margin-right: 20px; /* LTR */
  581. background: #ebebeb;
  582. }
  583. [dir="rtl"] .media-library-add-form__preview {
  584. margin-right: 0;
  585. margin-left: 20px;
  586. }
  587. /**
  588. * @todo Remove [type="submit"] when styles are moved to the seven theme in
  589. * https://www.drupal.org/project/drupal/issues/2980769
  590. */
  591. .media-library-add-form__remove-button[type="submit"] {
  592. position: absolute;
  593. top: 25px;
  594. right: 6px; /* LTR */
  595. width: auto;
  596. margin: 0;
  597. padding: 2px 20px 2px 2px; /* LTR */
  598. text-transform: lowercase;
  599. color: transparent;
  600. border: 0;
  601. border-radius: 0;
  602. background: transparent url(../../../../misc/icons/787878/ex.svg) right 2px no-repeat; /* LTR */
  603. font-weight: normal;
  604. line-height: 16px;
  605. }
  606. [dir="rtl"] .media-library-add-form__remove-button[type="submit"] {
  607. right: auto;
  608. left: 13px;
  609. padding: 2px 2px 2px 20px;
  610. background-position: left 2px;
  611. }
  612. .media-library-add-form__remove-button:focus,
  613. .media-library-add-form__remove-button.button:disabled,
  614. .media-library-add-form__remove-button.button:disabled:active,
  615. .media-library-add-form__remove-button.button:focus {
  616. color: #787878;
  617. border: 0;
  618. background: transparent url(../../../../misc/icons/787878/ex.svg) right 2px no-repeat; /* LTR */
  619. }
  620. [dir="rtl"] .media-library-add-form__remove-button:focus,
  621. [dir="rtl"] .media-library-add-form__remove-button.button:disabled,
  622. [dir="rtl"] .media-library-add-form__remove-button.button:disabled:active,
  623. [dir="rtl"] .media-library-add-form__remove-button.button:focus {
  624. background-position: left 2px;
  625. }
  626. .media-library-add-form__remove-button:hover,
  627. .media-library-add-form__remove-button.button:hover {
  628. color: #e00;
  629. border: 0;
  630. background: transparent url(../../../../misc/icons/ee0000/ex.svg) right 2px no-repeat; /* LTR */
  631. box-shadow: none;
  632. }
  633. [dir="rtl"] .media-library-add-form__remove-button:hover,
  634. [dir="rtl"] .media-library-add-form__remove-button.button:hover {
  635. background-position: left 2px;
  636. }
  637. /* @todo Remove in https://www.drupal.org/project/drupal/issues/3064914 */
  638. .views-live-preview .media-library-view div.views-row + div.views-row {
  639. margin-top: 0;
  640. }

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