action-link.pcss.css

Same filename in other branches
  1. 8.9.x core/themes/claro/css/components/action-link.pcss.css
  2. 10 core/themes/claro/css/components/action-link.pcss.css
  3. 11.x core/themes/claro/css/components/action-link.pcss.css

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

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