media-library-item.css

Style the media library items.

File

core/themes/default_admin/css/components/media-library-item.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. * Style the media library items.
  11. */
  12. .media-library-item {
  13. position: relative;
  14. background: none;
  15. /* Ajax throbbers inside a media library item. */
  16. .ajax-progress {
  17. position: absolute;
  18. z-index: calc(var(--vertical-tabs-menu--z-index) + 1);
  19. box-sizing: border-box;
  20. width: 3.5rem;
  21. height: 3.5rem;
  22. margin: -1.5rem;
  23. transform: translateY(-50%);
  24. border: var(--input-border-size) solid var(--jui-dropdown-border-color);
  25. border-radius: 3.5rem;
  26. background: var(--color-white);
  27. box-shadow: 0 0.25rem 0.625rem var(--jui-dropdown-shadow-color);
  28. inset-block-start: 50%;
  29. inset-inline-start: 50%;
  30. }
  31. .ajax-progress__throbber {
  32. position: absolute;
  33. inset-block-start: 50%;
  34. inset-inline-start: 50%;
  35. width: 1.75rem;
  36. height: 1.75rem;
  37. margin: -0.875rem;
  38. border: 3px solid var(--color-absolutezero);
  39. border-inline-end: 0.1875rem dotted transparent;
  40. }
  41. label {
  42. display: inline-block;
  43. }
  44. .ajax-progress__message {
  45. display: none;
  46. }
  47. .form-item {
  48. margin: var(--space-xs);
  49. }
  50. }
  51. .media-library-item__preview-wrapper {
  52. position: relative;
  53. .media-library-item:focus
  54. }
  55. .media-library-item--grid {
  56. justify-content: center;
  57. box-sizing: border-box;
  58. padding: 0.5rem;
  59. vertical-align: top;
  60. border-radius: var(--gin-border-xl);
  61. outline: none;
  62. /**
  63. * The media library grid item focus border is moved to a child element to
  64. * improve padding.
  65. */
  66. &:focus {
  67. outline: none;
  68. box-shadow: none;
  69. .media-library-item__preview-wrapper {
  70. outline: var(--focus-outline);
  71. box-shadow: var(--focus-box-shadow);
  72. }
  73. }
  74. /* Media library widget weight field styles. */
  75. .form-item {
  76. margin: 0.75em;
  77. }
  78. .form-boolean--type-checkbox:checked {
  79. border-color: var(--button--focus-border-color);
  80. background-color: var(--button--focus-border-color);
  81. }
  82. }
  83. /* Edit/remove button base appearance. */
  84. .media-library-edit__link,
  85. .media-library-item__edit,
  86. .media-library-item__edit.button,
  87. .media-library-item__remove,
  88. .media-library-item__remove.button {
  89. border-color: var(--gin-border-color);
  90. &:focus {
  91. outline: var(--focus-outline);
  92. }
  93. }
  94. .media-library-edit__link,
  95. .media-library-item__edit {
  96. inset-block-start: 0.625rem;
  97. inset-inline-end: 3.125rem;
  98. background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3e %3cg fill='none' stroke='currentColor' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3e %3cpath d='M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z'%3e%3c/path%3e %3c/g%3e%3c/svg%3e");
  99. background-size: 0.75rem 0.75rem;
  100. }
  101. .media-library-item__remove,
  102. .media-library-item__remove.button {
  103. background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3e %3cg fill='none' stroke='currentColor' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3e %3cpath d='M20 4L4 20' /%3e %3cpath d='M4 4L20 20' /%3e %3c/g%3e%3c/svg%3e");
  104. background-size: 0.75rem 0.75rem;
  105. }
  106. .media-library-item__click-to-select-checkbox {
  107. position: absolute;
  108. z-index: 1;
  109. inset-block-start: 1rem;
  110. inset-inline-start: 1rem;
  111. display: block;
  112. input {
  113. width: 1.25rem;
  114. height: 1.25rem;
  115. }
  116. .form-item {
  117. margin: 0;
  118. }
  119. .form-boolean {
  120. width: 1.8125rem;
  121. height: 1.8125rem;
  122. border-radius: var(--gin-border-xs);
  123. box-shadow: 0 2px 4px rgb(0, 0, 0, 0.15);
  124. &:hover,
  125. &:active {
  126. border-color: transparent;
  127. }
  128. &:checked {
  129. border-color: var(--gin-color-primary);
  130. background-color: var(--gin-color-primary);
  131. }
  132. }
  133. }
  134. .media-library-item__click-to-select-trigger {
  135. cursor: pointer;
  136. }
  137. /* Media library item table styles. */
  138. .media-library-item--table img {
  139. max-width: 6.25rem;
  140. height: auto;
  141. }
  142. /* Media library entity view display styles. */
  143. .media-library-item__preview {
  144. position: relative;
  145. overflow: clip;
  146. border: 1px solid var(--gin-border-color);
  147. border-radius: var(--gin-border-xl);
  148. aspect-ratio: 1;
  149. background-color: var(--gin-pattern-fallback);
  150. background-image: linear-gradient(-45deg, var(--gin-pattern) 25%, transparent 26%), linear-gradient(-45deg, var(--gin-pattern) 25%, transparent 26%), linear-gradient(135deg, var(--gin-pattern) 25%, transparent 26%), linear-gradient(135deg, var(--gin-pattern) 25%, transparent 26%);
  151. background-position:
  152. 0 0,
  153. var(--gin-pattern-square) var(--gin-pattern-square),
  154. var(--gin-pattern-square) var(--gin-pattern-square),
  155. 0 0;
  156. background-size: calc(var(--gin-pattern-square) * 2) calc(var(--gin-pattern-square) * 2);
  157. svg,
  158. img {
  159. position: absolute;
  160. max-width: 100%;
  161. max-height: 100%;
  162. margin: auto;
  163. object-fit: cover;
  164. inset: 0;
  165. }
  166. .media-library-item.is-hover
  167. }
  168. .media-library-item.checked &,
  169. .media-library-item.is-active
  170. }
  171. /*
  172. * Status overlay shown during media processing; only fires for transient
  173. * states.
  174. */
  175. .media-library-item__status {
  176. position: absolute;
  177. inset-block-start: 2.5rem;
  178. inset-inline-start: 0.3125rem;
  179. padding: 0.3125rem 0.625rem;
  180. pointer-events: none;
  181. color: #e4e4e4;
  182. background: #666;
  183. font-size: 0.75rem;
  184. font-style: italic;
  185. }
  186. .media-library-item__attributes {
  187. padding: var(--space-xs);
  188. }
  189. .media-library-item__name {
  190. text-wrap: pretty;
  191. color: var(--gin-color-text);
  192. font-size: 0.875rem;
  193. }
  194. .media-library-item__content {
  195. display: flex;
  196. height: 100%;
  197. article {
  198. width: 100%;
  199. }
  200. }
  201. .media-library-item__type {
  202. color: #696969;
  203. font-size: 0.75rem;
  204. }
  205. .media-library-item--disabled {
  206. pointer-events: none;
  207. opacity: 0.5;
  208. }
  209. /**
  210. * Media library widget edit and delete button styles.
  211. *
  212. * We have to override the .button styles since buttons make heavy use of
  213. * background and border property changes.
  214. */
  215. .media-library-item__edit,
  216. .media-library-item__edit:hover,
  217. .media-library-item__edit:focus,
  218. .media-library-item__remove,
  219. .media-library-item__remove:hover,
  220. .media-library-item__remove:focus,
  221. .media-library-item__remove.button,
  222. .media-library-item__remove.button:first-child,
  223. .media-library-item__remove.button:disabled,
  224. .media-library-item__remove.button:disabled:active,
  225. .media-library-item__remove.button:hover,
  226. .media-library-item__remove.button:focus {
  227. position: absolute;
  228. z-index: 1;
  229. inset-block-start: 0.625rem;
  230. overflow: hidden;
  231. width: 1.5rem;
  232. height: 1.5rem;
  233. margin: 0.3125rem;
  234. padding: 0;
  235. transition: 0.2s border-color;
  236. color: transparent;
  237. background-size: 0.75rem;
  238. text-shadow: none;
  239. font-size: 0;
  240. }
  241. .media-library-item__edit {
  242. inset-inline-end: 2.5rem;
  243. border: 1px solid var(--color-gray-200);
  244. 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");
  245. background-repeat: no-repeat;
  246. background-position: center;
  247. background-size: 0.75rem;
  248. &:active {
  249. 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");
  250. }
  251. }
  252. .media-library-item__remove,
  253. .media-library-item__remove.button,
  254. .media-library-item__remove.button:first-child,
  255. .media-library-item__remove.button:disabled,
  256. .media-library-item__remove.button:disabled:active,
  257. .media-library-item__remove.button:hover,
  258. .media-library-item__remove.button:focus {
  259. inset-inline-end: 0.625rem;
  260. border: 1px solid var(--color-gray-200);
  261. 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");
  262. background-repeat: no-repeat;
  263. background-position: center;
  264. background-size: 0.75rem;
  265. }
  266. .media-library-item__remove:active,
  267. .media-library-item__remove.button:active,
  268. .media-library-item__remove.button:disabled:active {
  269. border-color: var(--color-absolutezero);
  270. 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");
  271. }

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