action-link.pcss.css

Same filename in this branch
  1. main core/themes/claro/css/components/action-link.pcss.css
  2. main core/themes/admin/css/components/action-link.pcss.css
Same filename and directory in other branches
  1. 10 core/themes/claro/css/components/action-link.pcss.css
  2. 11.x core/themes/claro/css/components/action-link.pcss.css
  3. 9 core/themes/claro/css/components/action-link.pcss.css
  4. 8.9.x core/themes/claro/css/components/action-link.pcss.css
  5. 11.x core/themes/admin/css/components/action-link.pcss.css
  6. 11.x core/themes/default_admin/css/components/action-link.pcss.css

Styles for action links.

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

File

core/themes/default_admin/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. margin: var(--space-l) 0;
  12. list-style: none;
  13. }
  14. .action-links__item {
  15. display: inline-block;
  16. & + .action-links__item {
  17. & > .action-link {
  18. margin-inline-start: var(--space-s);
  19. }
  20. & > .action-link--small {
  21. margin-inline-start: var(--space-xs);
  22. }
  23. }
  24. }
  25. /**
  26. * The action link component.
  27. */
  28. .action-link {
  29. display: inline-block;
  30. padding: calc(var(--space-m) - ((var(--space-l) - var(--space-m)) / 2)) var(--space-m);
  31. cursor: pointer;
  32. text-decoration: none;
  33. color: var(--gin-color-primary);
  34. border-radius: var(--gin-border-s);
  35. background: transparent;
  36. font-size: var(--font-size-base);
  37. font-weight: 700;
  38. line-height: var(--space-l);
  39. /* Bigger line-height needed to prevent the icon from increasing the height */
  40. -webkit-font-smoothing: antialiased;
  41. /* Action link states */
  42. &:hover {
  43. text-decoration: none;
  44. color: var(--gin-color-primary-hover);
  45. background: var(--gin-bg-item-hover);
  46. }
  47. &:focus {
  48. position: relative;
  49. z-index: 1;
  50. text-decoration: none;
  51. color: var(--gin-color-primary-active);
  52. background: var(--gin-color-primary-light-hover);
  53. }
  54. &:active {
  55. color: var(--color-absolutezero-active);
  56. background-color: var(--color-bgblue-active);
  57. }
  58. &.action-link--extrasmall {
  59. font-size: var(--gin-font-size-xxs);
  60. }
  61. /**
  62. * Action link icons with states.
  63. *
  64. * We use parent-relative units here to follow the .action-link's font size.
  65. */
  66. /* Defaults for icons */
  67. &::before {
  68. position: relative;
  69. inset-block-start: 0.125rem;
  70. /* Set the proper vertical alignment */
  71. display: inline-block;
  72. width: 1em;
  73. height: 1em;
  74. margin-inline: calc(var(--space-s) - var(--space-m)) 0.5em;
  75. background: currentColor;
  76. background-image: none;
  77. mask-size: contain;
  78. mask-repeat: no-repeat;
  79. mask-position: center;
  80. }
  81. & + .action-link {
  82. margin-inline-start: var(--space-s);
  83. }
  84. /**
  85. * Action links inside form-actions.
  86. *
  87. * Add the same margin for action-link inside form-actions as button has.
  88. */
  89. .form-actions &,
  90. .field-actions
  91. @media (forced-colors: active) {
  92. &::before {
  93. background: linktext;
  94. }
  95. }
  96. }
  97. .no-touchevents {
  98. /* Small variant. */
  99. & .action-link--small {
  100. padding: calc(var(--space-s) - ((var(--space-l) - var(--space-s)) / 2)) var(--space-s);
  101. font-size: var(--font-size-s);
  102. }
  103. /* Extra small variant. */
  104. & .action-link--extrasmall {
  105. padding: 0 var(--space-xs);
  106. font-size: var(--gin-font-size-xxs);
  107. }
  108. & .action-link--small + .action-link--small,
  109. & .action-link--extrasmall + .action-link--extrasmall {
  110. margin-inline-start: var(--space-xs);
  111. }
  112. }
  113. /**
  114. * Action link variants.
  115. */
  116. /* Danger. */
  117. .action-link--danger {
  118. color: var(--color-maximumred);
  119. &:hover {
  120. color: var(--gin-bg-layer);
  121. background-color: var(--gin-color-danger);
  122. }
  123. }
  124. .no-touchevents .action-link--small::before,
  125. .no-touchevents .action-link--extrasmall::before {
  126. inset-block-start: 0.0625rem;
  127. width: var(--space-s);
  128. height: var(--space-s);
  129. margin-inline: -0.125rem 0.4em;
  130. }
  131. .action-link--icon-trash {
  132. &::before {
  133. content: "";
  134. mask-image: url(../../images/icons/545560/trash.svg);
  135. }
  136. /* Trash action link rendered as a button. */
  137. &.action-link--danger {
  138. border: 2px solid var(--gin-color-danger);
  139. border-radius: var(--gin-border-m);
  140. font-size: var(--gin-font-size-s);
  141. line-height: 1;
  142. padding-block: calc(var(--gin-spacing-s) - 2px);
  143. padding-inline: var(--gin-spacing-m);
  144. &::before {
  145. content: none;
  146. }
  147. }
  148. }
  149. .action-link--icon-plus::before {
  150. content: "";
  151. mask-image: var(--admin-icon-add);
  152. }
  153. .action-link--icon-ex::before {
  154. content: "";
  155. mask-image: var(--admin-icon-remove);
  156. }
  157. .action-link--icon-checkmark::before {
  158. content: "";
  159. mask-image: var(--admin-icon-checkmark);
  160. }
  161. .action-link--icon-cog::before {
  162. content: "";
  163. mask-image: var(--admin-icon-config);
  164. }
  165. .action-link--icon-show::before {
  166. content: "";
  167. mask-image: var(--admin-icon-show);
  168. }
  169. .action-link--icon-hide::before {
  170. content: "";
  171. mask-image: var(--admin-icon-hide);
  172. }
  173. .action-link--icon-key::before {
  174. content: "";
  175. mask-image: var(--admin-icon-devel);
  176. }
  177. .action-link--icon-questionmark::before {
  178. content: "";
  179. mask-image: var(--admin-icon-help);
  180. }
  181. .action-link--icon-chevron-left::before {
  182. content: "";
  183. mask-image: url("../../images/icons/545560/pager-prev.svg");
  184. }
  185. /* @todo Maybe move these styles over to button. */
  186. .button.button--danger {
  187. min-height: 0;
  188. color: var(--gin-color-danger);
  189. border-color: var(--gin-color-danger);
  190. box-shadow: 0 1px 2px var(--gin-color-danger-lightest);
  191. &:hover,
  192. &:focus,
  193. &:active {
  194. color: var(--gin-bg-layer);
  195. background-color: var(--gin-color-danger);
  196. }
  197. }

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