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/theme/media-library.css
  3. 8.9.x core/themes/seven/css/classy/layout/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.pcss.css

Styling for Media Library.

File

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

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