You are here

action-link.pcss.css in Drupal 10

Styles for action links.

Contains Action link component and the action-links layout styles.

File

core/themes/claro/css/components/action-link.pcss.css
View source
  1. /**
  2. * @file
  3. * Styles for action links.
  4. *
  5. * Contains Action link component and the action-links layout styles.
  6. */
  7. /**
  8. * Action links layout.
  9. */
  10. .action-links,
  11. [dir="rtl"] .action-links {
  12. margin: var(--space-l) 0;
  13. list-style: none;
  14. }
  15. .action-links__item {
  16. display: inline-block;
  17. }
  18. .action-links__item + .action-links__item > .action-link {
  19. margin-left: var(--space-s); /* LTR */
  20. }
  21. [dir="rtl"] .action-links__item + .action-links__item > .action-link {
  22. margin-right: var(--space-s);
  23. margin-left: 0;
  24. }
  25. .action-links__item + .action-links__item > .action-link--small {
  26. margin-left: var(--space-xs); /* LTR */
  27. }
  28. [dir="rtl"] .action-links__item + .action-links__item > .action-link--small {
  29. margin-right: var(--space-xs);
  30. margin-left: 0;
  31. }
  32. /**
  33. * The action link component.
  34. */
  35. .action-link {
  36. display: inline-block;
  37. padding: calc(var(--space-m) - ((var(--space-l) - var(--space-m)) / 2)) var(--space-m);
  38. cursor: pointer;
  39. text-decoration: none;
  40. color: var(--color-gray-800);
  41. border-radius: var(--button-border-radius-size);
  42. background-color: var(--color-bg);
  43. font-size: var(--font-size-base);
  44. font-weight: 700;
  45. line-height: var(--space-l); /* Bigger line-height needed to prevent the icon from increasing the height */
  46. -webkit-font-smoothing: antialiased;
  47. }
  48. /* Small variant. */
  49. .no-touchevents .action-link--small {
  50. padding: calc(var(--space-s) - ((var(--space-l) - var(--space-s)) / 2)) var(--space-s);
  51. font-size: var(--font-size-s);
  52. }
  53. /* Extra small variant. */
  54. .no-touchevents .action-link--extrasmall {
  55. padding: 0 var(--space-xs);
  56. font-size: var(--font-size-s);
  57. }
  58. .action-link + .action-link {
  59. margin-left: var(--space-s); /* LTR */
  60. }
  61. [dir="rtl"] .action-link + .action-link {
  62. margin-right: var(--space-s);
  63. margin-left: 0;
  64. }
  65. .no-touchevents .action-link--small + .action-link--small,
  66. .no-touchevents .action-link--extrasmall + .action-link--extrasmall {
  67. margin-left: var(--space-xs); /* LTR */
  68. }
  69. [dir="rtl"] .no-touchevents .action-link--small + .action-link--small,
  70. [dir="rtl"] .no-touchevents .action-link--extrasmall + .action-link--extrasmall {
  71. margin-right: var(--space-xs);
  72. margin-left: 0;
  73. }
  74. /**
  75. * Action links inside form-actions.
  76. *
  77. * Add the same margin for action-link inside form-actions as button has.
  78. */
  79. .form-actions .action-link {
  80. margin-right: var(--space-s); /* LTR */
  81. margin-left: 0; /* LTR */
  82. }
  83. [dir="rtl"] .form-actions .action-link {
  84. margin-right: 0;
  85. margin-left: var(--space-s);
  86. }
  87. /* Action link states */
  88. .action-link:hover {
  89. text-decoration: none;
  90. color: var(--color-absolutezero-hover);
  91. background-color: var(--color-bgblue-hover);
  92. }
  93. .action-link:focus {
  94. position: relative;
  95. z-index: 1;
  96. text-decoration: none;
  97. }
  98. .action-link:active {
  99. color: var(--color-absolutezero-active);
  100. background-color: var(--color-bgblue-active);
  101. }
  102. /**
  103. * Action link variants.
  104. */
  105. /* Danger. */
  106. .action-link--danger {
  107. color: var(--color-maximumred);
  108. }
  109. .action-link--danger:hover {
  110. color: var(--color-maximumred-hover);
  111. background-color: var(--color-bgred-hover);
  112. }
  113. .action-link--danger:active {
  114. color: var(--color-maximumred-active);
  115. background-color: var(--color-bgred-active);
  116. }
  117. /**
  118. * Action link icons with states.
  119. *
  120. * We use parent-relative units here to follow the .action-link's font size.
  121. */
  122. /* Defaults for icons */
  123. .action-link::before {
  124. position: relative;
  125. top: 0.125rem; /* Set the proper vertical alignment */
  126. display: inline-block;
  127. width: 1em;
  128. height: 1em;
  129. margin-right: 0.5em; /* LTR */
  130. margin-left: calc(var(--space-s) - var(--space-m)); /* LTR */
  131. background-repeat: no-repeat;
  132. background-position: center;
  133. background-size: contain;
  134. }
  135. [dir="rtl"] .action-link::before {
  136. margin-right: calc(var(--space-s) - var(--space-m));
  137. margin-left: 0.5em;
  138. }
  139. .no-touchevents .action-link--small::before,
  140. .no-touchevents .action-link--extrasmall::before {
  141. top: 0.0625rem; /* Set the proper vertical alignment */
  142. width: var(--space-s);
  143. height: var(--space-s);
  144. }
  145. .no-touchevents .action-link--extrasmall::before {
  146. margin-right: 0.4em; /* LTR */
  147. margin-left: -0.125rem; /* LTR */
  148. }
  149. [dir="rtl"].no-touchevents .action-link--extrasmall::before {
  150. margin-right: -0.125rem;
  151. margin-left: 0.4em;
  152. }
  153. /**
  154. * Hide action link icons for IE11.
  155. *
  156. * IE 11 does not display inline svg backgrounds
  157. */
  158. @media screen and (-ms-high-contrast: active) {
  159. /* stylelint-disable-next-line selector-type-no-unknown */
  160. _:-ms-fullscreen,
  161. .action-link::before {
  162. display: none;
  163. }
  164. }
  165. /* Plus */
  166. .action-link--icon-plus::before {
  167. content: "";
  168. background-image: url(../../images/icons/545560/plus.svg);
  169. }
  170. .action-link--icon-plus:hover::before {
  171. background-image: url(../../images/icons/0036b1/plus.svg);
  172. }
  173. .action-link--icon-plus:active::before {
  174. background-image: url(../../images/icons/002e9a/plus.svg);
  175. }
  176. /* Plus — danger */
  177. .action-link--icon-plus.action-link--danger::before {
  178. background-image: url(../../images/icons/d72222/plus.svg);
  179. }
  180. .action-link--icon-plus.action-link--danger:hover::before {
  181. background-image: url(../../images/icons/c11f1f/plus.svg);
  182. }
  183. .action-link--icon-plus.action-link--danger:active::before {
  184. background-image: url(../../images/icons/ab1b1b/plus.svg);
  185. }
  186. @media screen and (-ms-high-contrast: active) {
  187. .action-link--icon-plus.action-link--icon-plus.action-link--icon-plus::before {
  188. background-image: url(../../images/icons/windowText/plus.svg);
  189. }
  190. }
  191. @media (forced-colors: active) {
  192. .action-link--icon-plus::before {
  193. background: linktext !important;
  194. mask-repeat: no-repeat;
  195. mask-image: url(../../images/icons/d72222/plus.svg);
  196. }
  197. }
  198. /* Trash */
  199. .action-link--icon-trash::before {
  200. content: "";
  201. background-image: url(../../images/icons/545560/trash.svg);
  202. }
  203. .action-link--icon-trash:hover::before {
  204. background-image: url(../../images/icons/0036b1/trash.svg);
  205. }
  206. .action-link--icon-trash:active::before {
  207. background-image: url(../../images/icons/002e9a/trash.svg);
  208. }
  209. /* Trash — danger */
  210. .action-link--icon-trash.action-link--danger::before {
  211. background-image: url(../../images/icons/d72222/trash.svg);
  212. }
  213. .action-link--icon-trash.action-link--danger:hover::before {
  214. background-image: url(../../images/icons/c11f1f/trash.svg);
  215. }
  216. .action-link--icon-trash.action-link--danger:active::before {
  217. background-image: url(../../images/icons/ab1b1b/trash.svg);
  218. }
  219. @media screen and (-ms-high-contrast: active) {
  220. .action-link--icon-trash.action-link--icon-trash.action-link--icon-trash::before {
  221. background-image: url(../../images/icons/windowText/trash.svg) !important;
  222. }
  223. }
  224. @media (forced-colors: active) {
  225. .action-link--icon-trash::before {
  226. background: linktext !important;
  227. mask-repeat: no-repeat;
  228. mask-image: url(../../images/icons/d72222/trash.svg);
  229. }
  230. }
  231. /* Ex */
  232. .action-link--icon-ex::before {
  233. content: "";
  234. background-image: url(../../images/icons/545560/ex.svg);
  235. }
  236. .action-link--icon-ex:hover::before {
  237. background-image: url(../../images/icons/0036b1/ex.svg);
  238. }
  239. .action-link--icon-ex:active::before {
  240. background-image: url(../../images/icons/002e9a/ex.svg);
  241. }
  242. /* Ex — danger */
  243. .action-link--icon-ex.action-link--danger::before {
  244. background-image: url(../../images/icons/d72222/ex.svg);
  245. }
  246. .action-link--icon-ex.action-link--danger:hover::before {
  247. background-image: url(../../images/icons/c11f1f/ex.svg);
  248. }
  249. .action-link--icon-ex.action-link--danger:active::before {
  250. background-image: url(../../images/icons/ab1b1b/ex.svg);
  251. }
  252. @media screen and (-ms-high-contrast: active) {
  253. .action-link--icon-ex.action-link--icon-ex.action-link--icon-ex::before {
  254. background-image: url(../../images/icons/windowText/ex.svg) !important;
  255. }
  256. }
  257. @media (forced-colors: active) {
  258. .action-link--icon-ex::before {
  259. background: linktext !important;
  260. mask-repeat: no-repeat;
  261. mask-image: url(../../images/icons/d72222/ex.svg);
  262. }
  263. }
  264. /* Checkmark */
  265. .action-link--icon-checkmark::before {
  266. content: "";
  267. background-image: url(../../images/icons/545560/checkmark.svg);
  268. }
  269. .action-link--icon-checkmark:hover::before {
  270. background-image: url(../../images/icons/0036b1/checkmark.svg);
  271. }
  272. .action-link--icon-checkmark:active::before {
  273. background-image: url(../../images/icons/002e9a/checkmark.svg);
  274. }
  275. /* Checkmark — danger */
  276. .action-link--icon-checkmark.action-link--danger::before {
  277. background-image: url(../../images/icons/d72222/checkmark.svg);
  278. }
  279. .action-link--icon-checkmark.action-link--danger:hover::before {
  280. background-image: url(../../images/icons/c11f1f/checkmark.svg);
  281. }
  282. .action-link--icon-checkmark.action-link--danger:active::before {
  283. background-image: url(../../images/icons/ab1b1b/checkmark.svg);
  284. }
  285. @media screen and (-ms-high-contrast: active) {
  286. .action-link--icon-checkmark.action-link--icon-checkmark.action-link--icon-checkmark::before {
  287. background-image: url(../../images/icons/windowText/checkmark.svg) !important;
  288. }
  289. }
  290. @media (forced-colors: active) {
  291. .action-link--icon-checkmark::before {
  292. background: linktext !important;
  293. mask-repeat: no-repeat;
  294. mask-image: url(../../images/icons/d72222/checkmark.svg);
  295. }
  296. }
  297. /* Cog */
  298. .action-link--icon-cog::before {
  299. content: "";
  300. background-image: url(../../images/icons/545560/cog.svg);
  301. }
  302. .action-link--icon-cog:hover::before {
  303. background-image: url(../../images/icons/0036b1/cog.svg);
  304. }
  305. .action-link--icon-cog:active::before {
  306. background-image: url(../../images/icons/002e9a/cog.svg);
  307. }
  308. /* Cog — danger */
  309. .action-link--icon-cog.action-link--danger::before {
  310. background-image: url(../../images/icons/d72222/cog.svg);
  311. }
  312. .action-link--icon-cog.action-link--danger:hover::before {
  313. background-image: url(../../images/icons/c11f1f/cog.svg);
  314. }
  315. .action-link--icon-cog.action-link--danger:active::before {
  316. background-image: url(../../images/icons/ab1b1b/cog.svg);
  317. }
  318. @media screen and (-ms-high-contrast: active) {
  319. .action-link--icon-cog.action-link--icon-cog.action-link--icon-cog::before {
  320. background-image: url(../../images/icons/windowText/cog.svg) !important;
  321. }
  322. }
  323. @media (forced-colors: active) {
  324. .action-link--icon-cog::before {
  325. background: linktext !important;
  326. mask-repeat: no-repeat;
  327. mask-image: url(../../images/icons/d72222/cog.svg);
  328. }
  329. }
  330. /* Show */
  331. .action-link--icon-show::before {
  332. content: "";
  333. background-image: url(../../images/icons/545560/show.svg);
  334. }
  335. .action-link--icon-show:hover::before {
  336. background-image: url(../../images/icons/0036b1/show.svg);
  337. }
  338. .action-link--icon-show:active::before {
  339. background-image: url(../../images/icons/002e9a/show.svg);
  340. }
  341. /* Show - danger */
  342. .action-link--icon-show.action-link--danger::before {
  343. background-image: url(../../images/icons/d72222/show.svg);
  344. }
  345. .action-link--icon-show.action-link--danger:hover::before {
  346. background-image: url(../../images/icons/c11f1f/show.svg);
  347. }
  348. .action-link--icon-show.action-link--danger:active::before {
  349. background-image: url(../../images/icons/ab1b1b/show.svg);
  350. }
  351. @media screen and (-ms-high-contrast: active) {
  352. .action-link--icon-show.action-link--icon-show.action-link--icon-show::before {
  353. background-image: url(../../images/icons/windowText/show.svg) !important;
  354. }
  355. }
  356. @media (forced-colors: active) {
  357. .action-link--icon-show::before {
  358. background: linktext !important;
  359. mask-repeat: no-repeat;
  360. mask-image: url(../../images/icons/d72222/show.svg);
  361. }
  362. }
  363. /* Hide */
  364. .action-link--icon-hide::before {
  365. content: "";
  366. background-image: url(../../images/icons/545560/hide.svg);
  367. }
  368. .action-link--icon-hide:hover::before {
  369. background-image: url(../../images/icons/0036b1/hide.svg);
  370. }
  371. .action-link--icon-hide:active::before {
  372. background-image: url(../../images/icons/002e9a/hide.svg);
  373. }
  374. /* Hide - danger */
  375. .action-link--icon-hide.action-link--danger::before {
  376. background-image: url(../../images/icons/d72222/hide.svg);
  377. }
  378. .action-link--icon-hide.action-link--danger:hover::before {
  379. background-image: url(../../images/icons/c11f1f/hide.svg);
  380. }
  381. .action-link--icon-hide.action-link--danger:active::before {
  382. background-image: url(../../images/icons/ab1b1b/hide.svg);
  383. }
  384. @media screen and (-ms-high-contrast: active) {
  385. .action-link--icon-hide.action-link--icon-hide.action-link--icon-hide::before {
  386. background-image: url(../../images/icons/windowText/hide.svg);
  387. }
  388. }
  389. @media (forced-colors: active) {
  390. .action-link--icon-hide::before {
  391. background: linktext !important;
  392. mask-repeat: no-repeat;
  393. mask-image: url(../../images/icons/d72222/hide.svg);
  394. }
  395. }
  396. /* Key */
  397. .action-link--icon-key::before {
  398. content: "";
  399. background-image: url("../../images/icons/545560/key.svg");
  400. }
  401. .action-link--icon-key:hover::before {
  402. background-image: url("../../images/icons/0036b1/key.svg");
  403. }
  404. .action-link--icon-key:active::before {
  405. background-image: url("../../images/icons/002e9a/key.svg");
  406. }
  407. /* Key — danger */
  408. .action-link--icon-key.action-link--danger::before {
  409. background-image: url("../../images/icons/d72222/key.svg");
  410. }
  411. .action-link--icon-key.action-link--danger:hover::before {
  412. background-image: url("../../images/icons/c11f1f/key.svg");
  413. }
  414. .action-link--icon-key.action-link--danger:active::before {
  415. background-image: url("../../images/icons/ab1b1b/key.svg");
  416. }
  417. @media screen and (-ms-high-contrast: active) {
  418. .action-link--icon-key.action-link--icon-key.action-link--icon-key::before {
  419. background-image: url("../../images/icons/windowText/key.svg") !important;
  420. }
  421. }
  422. @media (forced-colors: active) {
  423. .action-link--icon-key::before {
  424. background: linktext !important;
  425. mask-repeat: no-repeat;
  426. mask-image: url(../../images/icons/d72222/key.svg);
  427. }
  428. }
  429. /* Question Mark */
  430. .action-link--icon-questionmark::before {
  431. content: "";
  432. background-image: url("../../images/icons/545560/questionmark.svg");
  433. }
  434. .action-link--icon-questionmark:hover::before {
  435. background-image: url("../../images/icons/0036b1/questionmark.svg");
  436. }
  437. .action-link--icon-questionmark:active::before {
  438. background-image: url("../../images/icons/002e9a/questionmark.svg");
  439. }
  440. /* Question Mark - danger */
  441. .action-link--icon-questionmark.action-link--danger::before {
  442. background-image: url("../../images/icons/d72222/questionmark.svg");
  443. }
  444. .action-link--icon-questionmark.action-link--danger:hover::before {
  445. background-image: url("../../images/icons/c11f1f/questionmark.svg");
  446. }
  447. .action-link--icon-questionmark.action-link--danger:active::before {
  448. background-image: url("../../images/icons/ab1b1b/questionmark.svg");
  449. }
  450. @media screen and (-ms-high-contrast: active) {
  451. .action-link--icon-questionmark.action-link--icon-questionmark.action-link--icon-questionmark::before {
  452. background-image: url("../../images/icons/windowText/questionmark.svg") !important;
  453. }
  454. }
  455. @media (forced-colors: active) {
  456. .action-link--icon-questionmark::before {
  457. background: linktext !important;
  458. mask-repeat: no-repeat;
  459. mask-image: url(../../images/icons/d72222/questionmark.svg);
  460. }
  461. }