media-library.css

Same filename in this branch
  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/bartik/css/classy/layout/media-library.css
  5. 9 core/themes/classy/css/layout/media-library.css
Same filename in other branches
  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/claro/css/theme/media-library.css
  5. 8.9.x core/themes/bartik/css/classy/layout/media-library.css
  6. 8.9.x 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/3084859
  5. * @preserve
  6. */
  7. /**
  8. * @file media-library.pcss.css
  9. * Styling for Media Library.
  10. */
  11. /**
  12. * Negative margins compensate for modal dialog padding and compensate for
  13. * positioning that would otherwise hide the active tab indicator on the left.
  14. */
  15. .media-library-wrapper {
  16. display: flex;
  17. margin: -1rem -1.5rem -1rem -1rem; /* LTR */
  18. }
  19. [dir="rtl"] .media-library-wrapper {
  20. margin-right: -1em;
  21. margin-left: -1.5em;
  22. }
  23. .media-library-wrapper .messages-list,
  24. .media-library-wrapper .messages {
  25. margin-top: 0;
  26. margin-bottom: 1.5rem;
  27. }
  28. .media-library-menu {
  29. position: relative;
  30. display: block;
  31. width: 20em;
  32. margin: 0;
  33. padding-top: 0.5rem;
  34. list-style: none;
  35. color: #232429;
  36. }
  37. [dir="rtl"] .media-library-menu {
  38. margin: 0;
  39. }
  40. .media-library-menu__item {
  41. overflow: hidden;
  42. margin: -1rem -1px -0.5rem -0.5rem; /* LTR */
  43. padding: 0.5rem 0;
  44. }
  45. [dir="rtl"] .media-library-menu__item {
  46. margin-right: -0.5rem;
  47. margin-left: -1px;
  48. }
  49. .media-library-menu__item::before {
  50. z-index: 0; /* The line should be kept above the vertical tabs menu link to keep it visible even if the link is hovered and gets the 'hover' background color. */
  51. display: block;
  52. width: 100%;
  53. margin-top: -1px;
  54. content: "";
  55. border-top: 1px solid #d3d4d9;
  56. }
  57. .media-library-menu__link {
  58. position: relative;
  59. display: block;
  60. margin-top: -1px;
  61. padding: 0.75rem 0.75rem 0.75rem 1.25rem; /* LTR */
  62. text-decoration: none;
  63. word-wrap: break-word;
  64. -webkit-hyphens: auto;
  65. -ms-hyphens: auto;
  66. hyphens: auto;
  67. color: #232429;
  68. border: 1px solid transparent;
  69. border-width: 1px 0 1px 4px; /* LTR */
  70. border-radius: 2px 0 0 2px; /* LTR */
  71. }
  72. [dir="rtl"] .media-library-menu__link {
  73. padding-right: 1.25rem;
  74. padding-left: 0.75rem;
  75. border-width: 1px 4px 1px 0;
  76. border-radius: 0 2px 2px 0;
  77. }
  78. @media screen and (-ms-high-contrast: active) {
  79. .media-library-menu__link {
  80. border-color: transparent;
  81. }
  82. }
  83. /* Menu link states. */
  84. .media-library-menu__link:focus {
  85. z-index: 3; /* Focus state should be on the highest level to make the focus effect be fully visible. This also means that it should have bigger z-index than the selected link. */
  86. text-decoration: none;
  87. box-shadow: none;
  88. }
  89. .media-library-menu__link:hover {
  90. text-decoration: none;
  91. color: #003ecc;
  92. /* These borders are necessary to replace the dividing lines while in the hover state. */
  93. border-top: 1px solid #d3d4d9;
  94. border-bottom: 1px solid #d3d4d9;
  95. background: #f5f8ff;
  96. }
  97. /* This pseudo element provides the background for the hover state. */
  98. .media-library-menu__link::before {
  99. position: absolute;
  100. z-index: -1; /* This should be on a lower level than the menu-item separator lines. */
  101. top: -1px;
  102. right: 0; /* LTR */
  103. bottom: -1px;
  104. left: -0.25rem; /* LTR */
  105. content: "";
  106. pointer-events: none;
  107. background-clip: padding-box;
  108. }
  109. [dir="rtl"] .media-library-menu__link::before {
  110. right: -0.25rem;
  111. left: 0;
  112. }
  113. .media-library-menu__link:focus::after {
  114. position: absolute;
  115. top: 0;
  116. right: 0;
  117. bottom: 0;
  118. left: 0;
  119. margin: -1px -0.25rem;
  120. content: "";
  121. pointer-events: none;
  122. border: 3px solid #26a769;
  123. border-radius: 2px;
  124. }
  125. .media-library-menu__link.active {
  126. z-index: 2; /* The selected menu link should be on a higher level than the white masking line that hides the gray separator. */
  127. color: #003ecc;
  128. border-color: #dedfe4 transparent;
  129. background-color: #fff;
  130. box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  131. }
  132. .media-library-menu__link.active:hover {
  133. color: #0036b1;
  134. background-color: #f5f8ff;
  135. }
  136. .media-library-menu__link.active::before {
  137. z-index: 1; /* The blue active-tab indication should be on a higher level than the green focus border. */
  138. border-left: 4px solid #003ecc; /* LTR */
  139. border-radius: 2px 0 0 2px; /* LTR */
  140. }
  141. [dir=rtl] .media-library-menu__link.active::before {
  142. border-right: 4px solid #003ecc;
  143. border-left: 0;
  144. border-radius: 0 2px 2px 0;
  145. }
  146. .media-library-menu__link.active:hover::before {
  147. background: none;
  148. }
  149. .media-library-content {
  150. width: 100%;
  151. padding: 1em;
  152. outline: none;
  153. }
  154. .media-library-menu + .media-library-content {
  155. z-index: 0;
  156. border-left: 1px solid #dedfe4; /* LTR */
  157. box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  158. }
  159. [dir="rtl"] .media-library-menu + .media-library-content {
  160. border-right: 1px solid #dedfe4;
  161. border-left: 0;
  162. }
  163. /* Generic media add form styles. */
  164. .media-library-add-form--without-input .form-item {
  165. margin-right: 1rem;
  166. }
  167. /**
  168. * Remove outline from added media list.
  169. *
  170. * The added media list receives focus after adding new media, but since it is
  171. * not an interactive element, it does not need an outline.
  172. */
  173. .media-library-add-form__added-media {
  174. margin: 0;
  175. padding: 0;
  176. outline: none;
  177. }
  178. /**
  179. * This Media Library form is an exception to the extrasmall button pattern.
  180. * Additional padding is needed to accommodate the remove button icon. The
  181. * margin is adjusted for alignment within the media library dialog.
  182. */
  183. .media-library-add-form__added-media .media-library-add-form__remove-button.button--extrasmall {
  184. margin: 0.5rem 0; /* LTR */
  185. /* Left padding is double the background size of the button icon. */
  186. padding: calc(0.25rem - 1px) calc(0.75rem - 1px) calc(0.25rem - 1px) 1.5rem;
  187. }
  188. /* This is needed to override the default extrasmall button left margin. */
  189. [dir="rtl"] .media-library-add-form__added-media .media-library-add-form__remove-button.button--extrasmall {
  190. margin-left: 0;
  191. }
  192. .media-library-add-form__input-wrapper {
  193. padding: 0.5rem 1.5rem 1.5rem 1.5rem;
  194. border: 1px solid #dedfe4;
  195. border-radius: 2px;
  196. background-color: #fff;
  197. box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  198. }
  199. /* Style the media add upload form. */
  200. .media-library-add-form--upload.media-library-add-form--without-input .form-item-upload {
  201. margin-bottom: 0;
  202. }
  203. .media-library-add-form--upload.media-library-add-form--with-input .form-managed-file__main,
  204. .media-library-add-form--upload.media-library-add-form--with-input .form-managed-file.no-upload {
  205. display: block;
  206. }
  207. /* Adjust the focus border on this element so it is not too close to buttons. */
  208. .media-library-add-form__added-media:focus {
  209. box-shadow: 0 0 0 4px #fff, 0 0 0 7px #26a769;
  210. }
  211. .media-library-add-form .file-upload-help {
  212. margin: 0.5rem 0 0;
  213. }
  214. /* Align remove buttons with Save button and compensate for IE scrollbar and focus padding. */
  215. @media all and (-ms-high-contrast: active), (-ms-high-contrast: none) {
  216. .ui-dialog > .ui-dialog-content {
  217. padding-right: calc(0.5625rem - 4px);
  218. }
  219. [dir="rtl"] .ui-dialog > .ui-dialog-content {
  220. padding-left: calc(0.5625rem - 4px);
  221. }
  222. }
  223. /* Style the media add oEmbed form. */
  224. .media-library-add-form--oembed .media-library-add-form__input-wrapper {
  225. display: flex;
  226. align-items: center;
  227. }
  228. @media screen and (max-width: 37.5em) {
  229. .media-library-add-form--oembed .media-library-add-form__input-wrapper {
  230. display: block;
  231. }
  232. }
  233. .media-library-add-form--oembed.media-library-add-form--without-input .form-item-url {
  234. margin-bottom: 0;
  235. }
  236. .media-library-add-form-oembed-url {
  237. width: 100%;
  238. }
  239. /* Media add form selection styles. */
  240. .media-library-add-form__selected-media {
  241. margin-top: 1em;
  242. }
  243. /* Change to padding to account for the negative margin for flex grid. */
  244. .media-library-add-form__selected-media .details-wrapper {
  245. padding: 0 0.625rem 1em 0.625rem;
  246. }
  247. .media-library-add-form__selected-media .media-library-item .field--name-thumbnail img {
  248. height: 6.25rem;
  249. }
  250. /* Generic media library view styles. */
  251. .media-library-select-all {
  252. flex-basis: 100%;
  253. width: 100%;
  254. margin: 0.625rem 0.5rem;
  255. }
  256. .media-library-select-all input {
  257. margin-right: 0.625rem;
  258. }
  259. [dir="rtl"] .media-library-select-all input {
  260. margin-left: 0.625rem;
  261. }
  262. .media-library-views-form,
  263. .media-library-selection,
  264. .media-library-add-form__selected-media .details-wrapper,
  265. .media-library-view .form--inline {
  266. display: flex;
  267. flex-wrap: wrap;
  268. }
  269. .media-library-views-form > .form-actions {
  270. flex-basis: 100%;
  271. }
  272. .media-library-views-form__header {
  273. flex-basis: 100%;
  274. }
  275. .media-library-views-form__header .form-item {
  276. margin-right: 0.5rem; /* @TODO RTL? */
  277. }
  278. .media-library-views-form__rows {
  279. display: flex;
  280. flex-wrap: wrap;
  281. flex-basis: 100%;
  282. margin: 0 -0.5rem;
  283. }
  284. /**
  285. * Override the table display of the visually hidden labels.
  286. *
  287. * The width, height and overflow properties in the styles for the
  288. * .visually-hidden class do not work correctly if the element has a table
  289. * display.
  290. */
  291. .media-library-item label {
  292. display: inline-block;
  293. }
  294. /* Media library widget view styles. */
  295. .media-library-wrapper .media-library-view {
  296. position: relative;
  297. display: flex;
  298. flex-wrap: wrap;
  299. justify-content: space-between;
  300. }
  301. .media-library-wrapper .view-header {
  302. align-self: flex-end;
  303. margin: 1em 0;
  304. text-align: right; /* LTR */
  305. }
  306. [dir="rtl"] .media-library-wrapper .view-header {
  307. text-align: left;
  308. }
  309. .media-library-wrapper .media-library-view .view-filters,
  310. .media-library-wrapper .media-library-view .view-content {
  311. flex: 0 0 100%;
  312. }
  313. .media-library-wrapper .views-display-link {
  314. margin: 0;
  315. padding-left: 1.375rem; /* LTR */
  316. color: #333;
  317. font-size: 0.9375rem;
  318. line-height: 1rem;
  319. }
  320. [dir="rtl"] .media-library-wrapper .views-display-link {
  321. padding-right: 1.375rem;
  322. padding-left: 0;
  323. }
  324. .media-library-wrapper .views-display-link.is-active {
  325. font-weight: bold;
  326. }
  327. .media-library-wrapper .views-display-link-widget {
  328. margin-right: 0.9375rem;
  329. background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3e%3cpath fill='%23333333' d='M10.5 9h3a1.5 1.5 0 0 1 1.5 1.5v3a1.5 1.5 0 0 1-1.5 1.5h-3A1.5 1.5 0 0 1 9 13.5v-3A1.5 1.5 0 0 1 10.5 9zm-8 0h3A1.5 1.5 0 0 1 7 10.5v3A1.5 1.5 0 0 1 5.5 15h-3A1.5 1.5 0 0 1 1 13.5v-3A1.5 1.5 0 0 1 2.5 9zm8-8h3A1.5 1.5 0 0 1 15 2.5v3A1.5 1.5 0 0 1 13.5 7h-3A1.5 1.5 0 0 1 9 5.5v-3A1.5 1.5 0 0 1 10.5 1zm-8 0h3A1.5 1.5 0 0 1 7 2.5v3A1.5 1.5 0 0 1 5.5 7h-3A1.5 1.5 0 0 1 1 5.5v-3A1.5 1.5 0 0 1 2.5 1z'/%3e%3c/svg%3e") left 0 no-repeat; /* LTR */
  330. }
  331. [dir="rtl"] .media-library-wrapper .views-display-link-widget {
  332. background-position: right 0;
  333. }
  334. .media-library-wrapper .views-display-link-widget_table {
  335. background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3e%3cpath fill='%23333333' d='M7 15a1.5 1.5 0 0 1 0-3h7a1.5 1.5 0 0 1 0 3H7zm-4.5 0a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zM7 9.5a1.5 1.5 0 0 1 0-3h7a1.5 1.5 0 0 1 0 3H7zm-4.5 0a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zM7 4a1.5 1.5 0 0 1 0-3h7a1.5 1.5 0 0 1 0 3H7zM2.5 4a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3z'/%3e%3c/svg%3e") left 0 no-repeat; /* LTR */
  336. }
  337. [dir="rtl"] .media-library-wrapper .views-display-link-widget_table {
  338. background-position: right 0;
  339. }
  340. /**
  341. * Style the media library grid items.
  342. */
  343. .media-library-item {
  344. position: relative;
  345. }
  346. /**
  347. * Ajax throbbers inside a media library item.
  348. */
  349. .media-library-item .ajax-progress.ajax-progress.ajax-progress {
  350. position: absolute;
  351. z-index: 1;
  352. top: 50%;
  353. left: 50%;
  354. box-sizing: border-box;
  355. width: 3rem; /* 56px */
  356. height: 3rem;
  357. margin: -1.5rem;
  358. border: 1px solid rgba(216, 217, 224, 0.8);
  359. border-radius: 3.5rem;
  360. background: #fff;
  361. box-shadow: 0 0.25rem 0.625rem rgba(34, 35, 48, 0.1);
  362. }
  363. .media-library-item .ajax-progress__throbber {
  364. position: absolute;
  365. top: 50%;
  366. left: 50%;
  367. width: 1.75rem;
  368. height: 1.75rem;
  369. margin: -0.875rem;
  370. border: 3px solid #003ecc;
  371. border-right: 3px dotted transparent;
  372. }
  373. .media-library-item .ajax-progress__message {
  374. display: none;
  375. }
  376. .media-library-item--grid {
  377. justify-content: center;
  378. box-sizing: border-box;
  379. width: 50%;
  380. padding: 0.5rem;
  381. vertical-align: top;
  382. outline: none;
  383. background: #fff;
  384. }
  385. .media-library-item--grid:before {
  386. position: absolute;
  387. top: 0.4375rem;
  388. left: 0.4375rem;
  389. width: calc(100% - 1rem);
  390. height: calc(100% - 1rem);
  391. content: "";
  392. transition: border-color 0.2s, color 0.2s, background 0.2s;
  393. pointer-events: none;
  394. border: 1px solid #dbdbdb;
  395. border-radius: 2px;
  396. box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  397. }
  398. /**
  399. * The media library grid item focus border is moved to a child element to
  400. * improve padding.
  401. */
  402. .media-library-item--grid:focus {
  403. outline: none;
  404. box-shadow: none;
  405. }
  406. .media-library-item--grid:focus .media-library-item__preview-wrapper {
  407. outline: 2px dotted transparent;
  408. box-shadow: 0 0 0 2px #fff, 0 0 0 5px #26a769;
  409. }
  410. /* Media library widget weight field styles. */
  411. .media-library-item--grid .form-item {
  412. margin: 0.75em;
  413. }
  414. /* The selected items in the add form should be shown a bit smaller. */
  415. .media-library-add-form__selected-media .media-library-item--small {
  416. width: 33.3%;
  417. }
  418. .media-library-widget-modal .ui-dialog-buttonpane {
  419. display: flex;
  420. align-items: center;
  421. }
  422. .media-library-widget-modal .ui-dialog-buttonpane .form-actions {
  423. flex: 1;
  424. }
  425. /**
  426. * By default, the dialog is too narrow to be usable.
  427. * @see Drupal.ckeditor.openDialog()
  428. */
  429. .ui-dialog--narrow.media-library-widget-modal {
  430. max-width: 75%;
  431. }
  432. @media screen and (min-width: 45em) {
  433. .media-library-item--grid {
  434. width: 33.3%;
  435. }
  436. /* Change the width for the modal and widget since there is less space. */
  437. .media-library-widget-modal .media-library-item--grid,
  438. .media-library-selection .media-library-item--grid {
  439. width: 50%;
  440. }
  441. /* The selected items in the add form should be shown a bit smaller. */
  442. .media-library-add-form__selected-media .media-library-item--small {
  443. width: 25%;
  444. }
  445. }
  446. @media screen and (min-width: 60em) {
  447. .media-library-item--grid {
  448. width: 25%;
  449. }
  450. /* Change the width for the modal and widget since there is less space. */
  451. .media-library-widget-modal .media-library-item--grid,
  452. .media-library-selection .media-library-item--grid {
  453. width: 33.3%;
  454. }
  455. /* The selected items in the add form should be shown a bit smaller. */
  456. .media-library-add-form__selected-media .media-library-item--small {
  457. width: 16.6%;
  458. }
  459. }
  460. @media screen and (min-width: 77em) {
  461. .media-library-item--grid {
  462. width: 16.6%;
  463. }
  464. /* Change the width for the modal and widget since there is less space. */
  465. .media-library-widget-modal .media-library-item--grid,
  466. .media-library-selection .media-library-item--grid {
  467. width: 25%;
  468. }
  469. /* The selected items in the add form should be shown a bit smaller. */
  470. .media-library-add-form__selected-media .media-library-item--small {
  471. width: 16.6%;
  472. }
  473. }
  474. .media-library-item--grid .field--name-thumbnail {
  475. overflow: hidden;
  476. text-align: center;
  477. background-color: #ebebeb;
  478. }
  479. .media-library-item--grid .field--name-thumbnail img {
  480. height: 11.25rem;
  481. object-fit: contain;
  482. object-position: center center;
  483. }
  484. .media-library-item--grid.is-hover:before,
  485. .media-library-item--grid.checked:before,
  486. .media-library-item--grid.is-focus:before {
  487. top: 0.3125rem;
  488. left: 0.3125rem;
  489. border-width: 3px;
  490. border-radius: 0.1875rem;
  491. }
  492. .media-library-item--grid.is-hover:before,
  493. .media-library-item--grid.checked.is-hover:before {
  494. border-color: #0036b1;
  495. }
  496. .media-library-item--grid.is-focus:before {
  497. border-color: #26a769;
  498. }
  499. .media-library-item--grid.checked:before {
  500. border-color: #6694ff;
  501. }
  502. .media-library-item--grid .form-boolean--type-checkbox:checked {
  503. border-color: #6694ff;
  504. background-color: #6694ff;
  505. }
  506. .media-library-item__click-to-select-checkbox {
  507. position: absolute;
  508. z-index: 1;
  509. top: 1rem;
  510. left: 1rem; /* LTR */
  511. display: block;
  512. }
  513. [dir="rtl"] .media-library-item__click-to-select-checkbox {
  514. right: 1rem;
  515. left: auto;
  516. }
  517. .media-library-item__click-to-select-checkbox input {
  518. width: 1.25rem;
  519. height: 1.25rem;
  520. }
  521. .media-library-item__click-to-select-checkbox .form-item {
  522. margin: 0;
  523. }
  524. .media-library-item__click-to-select-trigger {
  525. overflow: hidden;
  526. height: 100%;
  527. cursor: pointer;
  528. }
  529. /* Media library item table styles. */
  530. .media-library-item--table img {
  531. max-width: 6.25rem;
  532. height: auto;
  533. }
  534. /* Media library entity view display styles. */
  535. .media-library-item__preview {
  536. padding-bottom: 2.125rem;
  537. }
  538. .field--widget-media-library-widget .media-library-item__preview {
  539. cursor: move;
  540. }
  541. .field--widget-media-library-widget .media-library-item__preview img {
  542. border-top-left-radius: 2px;
  543. border-top-right-radius: 2px;
  544. }
  545. .field--widget-media-library-widget .js-media-library-item:only-child .media-library-item__preview {
  546. cursor: inherit;
  547. }
  548. .media-library-item__status {
  549. position: absolute;
  550. top: 2.5rem;
  551. left: 0.3125rem; /* LTR */
  552. padding: 0.3125rem 0.625rem;
  553. pointer-events: none;
  554. color: #e4e4e4;
  555. background: #666;
  556. font-size: 0.75rem;
  557. font-style: italic;
  558. }
  559. [dir="rtl"] .media-library-item__status {
  560. right: 0.3125rem;
  561. left: auto;
  562. }
  563. .media-library-item__attributes {
  564. position: absolute;
  565. bottom: 0;
  566. display: block;
  567. overflow: hidden;
  568. max-width: calc(100% - 0.625rem);
  569. max-height: calc(100% - 3.125rem);
  570. padding: 0.3125rem;
  571. background: white;
  572. }
  573. .media-library-item__name {
  574. display: block;
  575. overflow: hidden;
  576. margin: 0.25rem 0.5rem;
  577. white-space: nowrap;
  578. text-overflow: ellipsis;
  579. font-size: 0.875rem;
  580. }
  581. .media-library-item__attributes:hover .media-library-item__name,
  582. .media-library-item--grid.is-focus .media-library-item__name,
  583. .media-library-item--grid.checked .media-library-item__name {
  584. white-space: normal;
  585. }
  586. .media-library-item__type {
  587. color: #696969;
  588. font-size: 0.75rem;
  589. }
  590. .media-library-item--disabled {
  591. pointer-events: none;
  592. opacity: 0.5;
  593. }
  594. /* Media library widget styles. */
  595. .media-library-widget {
  596. position: relative;
  597. }
  598. .media-library-widget__toggle-weight.media-library-widget__toggle-weight {
  599. position: absolute;
  600. top: 0.75rem;
  601. right: 1rem; /* LTR */
  602. text-decoration: none;
  603. }
  604. [dir="rtl"] .media-library-widget__toggle-weight.media-library-widget__toggle-weight {
  605. right: auto;
  606. left: 1rem;
  607. }
  608. /* Add negative margin for flex grid. */
  609. .media-library-selection {
  610. margin: 1em -0.5rem;
  611. }
  612. /**
  613. * Media library widget edit and delete button styles.
  614. *
  615. * We have to override the .button styles since buttons make heavy use of
  616. * background and border property changes.
  617. */
  618. .media-library-item__edit,
  619. .media-library-item__edit:hover,
  620. .media-library-item__edit:focus,
  621. .media-library-item__remove,
  622. .media-library-item__remove:hover,
  623. .media-library-item__remove:focus,
  624. .media-library-item__remove.button,
  625. .media-library-item__remove.button:first-child,
  626. .media-library-item__remove.button:disabled,
  627. .media-library-item__remove.button:disabled:active,
  628. .media-library-item__remove.button:hover,
  629. .media-library-item__remove.button:focus {
  630. position: absolute;
  631. z-index: 1;
  632. top: 0.625rem;
  633. overflow: hidden;
  634. width: 1.5rem;
  635. height: 1.5rem;
  636. margin: 0.3125rem;
  637. padding: 0;
  638. transition: 0.2s border-color;
  639. color: transparent;
  640. background-size: 0.75rem;
  641. text-shadow: none;
  642. font-size: 0;
  643. }
  644. .media-library-item__edit {
  645. right: 2.5rem; /* LTR */
  646. }
  647. [dir="rtl"] .media-library-item__edit {
  648. right: auto;
  649. left: 2.5rem;
  650. }
  651. .media-library-item__remove {
  652. right: 0.625rem; /* LTR */
  653. }
  654. [dir="rtl"] .media-library-item__remove {
  655. right: auto;
  656. left: 0.625rem;
  657. }
  658. .media-library-item__edit {
  659. border: 1px solid #d3d4d9 !important;
  660. }
  661. .media-library-item__edit {
  662. /* !important to override button class border. */
  663. background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3e%3cg fill='%23545560'%3e%3cpath d='M14.545 3.042l-1.586-1.585a1.003 1.003 0 00-1.414 0L10.252 2.75l3 3 1.293-1.293a1.004 1.004 0 000-1.415zM5.25 13.751l-3-3 6.998-6.998 3 3zM.908 14.775c-.087.262.055.397.316.312l2.001-.667-1.65-1.646-.667 2.001z'/%3e%3c/g%3e%3c/svg%3e");
  664. background-repeat: no-repeat;
  665. background-position: center;
  666. background-size: 0.75rem;
  667. }
  668. .media-library-item__edit:active {
  669. background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3e%3cg%3e%3cpath fill='%23ffffff' d='M14.545 3.042l-1.586-1.585c-.389-.389-1.025-.389-1.414 0l-1.293 1.293 3 3 1.293-1.293c.389-.389.389-1.026 0-1.415z'/%3e%3crect fill='%23ffffff' x='5.129' y='3.8' transform='matrix(-.707 -.707 .707 -.707 6.189 20.064)' width='4.243' height='9.899'/%3e%3cpath fill='%23ffffff' d='M.908 14.775c-.087.262.055.397.316.312l2.001-.667-1.65-1.646-.667 2.001z'/%3e%3c/g%3e%3c/svg%3e");
  670. }
  671. .media-library-item__remove,
  672. .media-library-item__remove.button,
  673. .media-library-item__remove.button:first-child,
  674. .media-library-item__remove.button:disabled,
  675. .media-library-item__remove.button:disabled:active,
  676. .media-library-item__remove.button:hover,
  677. .media-library-item__remove.button:focus {
  678. border: 1px solid #d3d4d9 !important;
  679. }
  680. .media-library-item__remove,
  681. .media-library-item__remove.button,
  682. .media-library-item__remove.button:first-child,
  683. .media-library-item__remove.button:disabled,
  684. .media-library-item__remove.button:disabled:active,
  685. .media-library-item__remove.button:hover,
  686. .media-library-item__remove.button:focus {
  687. /* !important to override button class border. */
  688. background-image: url("data:image/svg+xml,%3csvg width='16' height='16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M2.344 2.343l11.313 11.313M2.344 13.657L13.657 2.343' stroke='%2355565B' stroke-width='3'/%3e%3c/svg%3e");
  689. background-repeat: no-repeat;
  690. background-position: center;
  691. background-size: 0.75rem;
  692. }
  693. .media-library-item__remove:active,
  694. .media-library-item__remove.button:active,
  695. .media-library-item__remove.button:disabled:active {
  696. border-color: #003ecc !important;
  697. }
  698. .media-library-item__remove:active,
  699. .media-library-item__remove.button:active,
  700. .media-library-item__remove.button:disabled:active {
  701. /* !important to override button class border. */
  702. background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3e%3cpath fill='%23ffffff' d='M3.51 13.925c.194.194.512.195.706.001l3.432-3.431c.194-.194.514-.194.708 0l3.432 3.431c.192.194.514.193.707-.001l1.405-1.417c.191-.195.189-.514-.002-.709l-3.397-3.4c-.192-.193-.192-.514-.002-.708l3.401-3.43c.189-.195.189-.515 0-.709l-1.407-1.418c-.195-.195-.513-.195-.707-.001l-3.43 3.431c-.195.194-.516.194-.708 0l-3.432-3.431c-.195-.195-.512-.194-.706.001l-1.407 1.417c-.194.195-.194.515 0 .71l3.403 3.429c.193.195.193.514-.001.708l-3.4 3.399c-.194.195-.195.516-.001.709l1.406 1.419z'/%3e%3c/svg%3e");
  703. }
  704. /* Style the added media item container. */
  705. .media-library-add-form__media {
  706. position: relative;
  707. display: flex;
  708. border-bottom: 1px solid #c0c0c0;
  709. }
  710. /* Do not show the bottom border and padding for the last item. */
  711. .media-library-add-form__media:last-child {
  712. padding-bottom: 0;
  713. border-bottom: 0;
  714. }
  715. .media-library-add-form__preview {
  716. display: flex;
  717. align-items: center;
  718. justify-content: center;
  719. width: 13.75rem;
  720. margin-right: 1.25rem; /* LTR */
  721. background: rgba(243, 244, 249, 0.4);
  722. }
  723. [dir="rtl"] .media-library-add-form__preview {
  724. margin-right: 0;
  725. margin-left: 1.25rem;
  726. }
  727. .media-library-add-form__fields {
  728. flex-grow: 1;
  729. }
  730. .media-library-add-form__remove-button {
  731. position: absolute;
  732. right: 0; /* LTR */
  733. background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3e%3cpath fill='%23000000' d='M3.51 13.925c.194.194.512.195.706.001l3.432-3.431c.194-.194.514-.194.708 0l3.432 3.431c.192.194.514.193.707-.001l1.405-1.417c.191-.195.189-.514-.002-.709l-3.397-3.4c-.192-.193-.192-.514-.002-.708l3.401-3.43c.189-.195.189-.515 0-.709l-1.407-1.418c-.195-.195-.513-.195-.707-.001l-3.43 3.431c-.195.194-.516.194-.708 0l-3.432-3.431c-.195-.195-.512-.194-.706.001l-1.407 1.417c-.194.195-.194.515 0 .71l3.403 3.429c.193.195.193.514-.001.708l-3.4 3.399c-.194.195-.195.516-.001.709l1.406 1.419z'/%3e%3c/svg%3e");
  734. background-repeat: no-repeat;
  735. background-position: 0.5rem center;
  736. background-size: 0.75rem;
  737. }
  738. [dir="rtl"] .media-library-add-form__remove-button {
  739. right: auto;
  740. left: 0;
  741. }
  742. .media-library-add-form__remove-button.button:disabled {
  743. background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3e%3cpath fill='%238e929c' d='M3.51 13.925c.194.194.512.195.706.001l3.432-3.431c.194-.194.514-.194.708 0l3.432 3.431c.192.194.514.193.707-.001l1.405-1.417c.191-.195.189-.514-.002-.709l-3.397-3.4c-.192-.193-.192-.514-.002-.708l3.401-3.43c.189-.195.189-.515 0-.709l-1.407-1.418c-.195-.195-.513-.195-.707-.001l-3.43 3.431c-.195.194-.516.194-.708 0l-3.432-3.431c-.195-.195-.512-.194-.706.001l-1.407 1.417c-.194.195-.194.515 0 .71l3.403 3.429c.193.195.193.514-.001.708l-3.4 3.399c-.194.195-.195.516-.001.709l1.406 1.419z'/%3e%3c/svg%3e");
  744. }
  745. /* @todo Remove in https://www.drupal.org/project/drupal/issues/3064914 */
  746. .views-live-preview .media-library-view div.views-row + div.views-row {
  747. margin-top: 0;
  748. }

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