action-link.css

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

Styles for action links.

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

File

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

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