form--checkbox-radio.css

Same filename in other branches
  1. 9 core/themes/claro/css/components/form--checkbox-radio.css
  2. 8.9.x core/themes/claro/css/components/form--checkbox-radio.css
  3. 10 core/themes/claro/css/components/form--checkbox-radio.css

Checkbox and radio input elements.

File

core/themes/claro/css/components/form--checkbox-radio.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. * Checkbox and radio input elements.
  10. */
  11. /**
  12. * Form item modifiers.
  13. */
  14. .form-type--boolean {
  15. margin-inline-start: var(--input--label-spacing);
  16. line-height: var(--space-l);
  17. }
  18. /**
  19. * Radio and checkbox items that are the child of a form item.
  20. */
  21. .form-type--boolean .form-boolean {
  22. position: relative;
  23. inset-block-start: calc(var(--space-l) / 2);
  24. float: left; /* LTR */
  25. margin-inline-start: calc(var(--input--label-spacing) * -1);
  26. transform: translateY(-50%);
  27. }
  28. [dir="rtl"] :is(.form-type--boolean .form-boolean) {
  29. float: right;
  30. }
  31. .form-type--boolean.form-item--no-label {
  32. margin-inline-start: 0;
  33. }
  34. .form-type--boolean.form-item--no-label .form-boolean {
  35. position: static;
  36. float: none;
  37. margin-inline: 0;
  38. transform: none;
  39. }
  40. /**
  41. * When form items are nested in radios or checkboxes group, reduce the default
  42. * space between them.
  43. */
  44. .form-boolean-group .form-type--boolean {
  45. margin-block: 0.4em;
  46. }
  47. /**
  48. * Input appearance.
  49. */
  50. .form-boolean {
  51. display: inline-block;
  52. box-sizing: border-box;
  53. width: 1.125rem;
  54. height: 1.125rem;
  55. vertical-align: text-bottom;
  56. border: 1px solid var(--input-border-color);
  57. border-radius: 2px;
  58. background: var(--input-bg-color) no-repeat 50% 50%;
  59. background-size: 100% 100%;
  60. box-shadow: 0 0 0 4px transparent;
  61. appearance: none;
  62. }
  63. .form-boolean:active,
  64. .form-boolean:hover {
  65. border-color: var(--input-fg-color);
  66. box-shadow: inset 0 0 0 1px var(--input-fg-color);
  67. }
  68. .form-boolean:focus:active,
  69. .form-boolean:focus:hover {
  70. box-shadow:
  71. 0 0 0 2px var(--color-white),
  72. 0 0 0 5px var(--color-focus),
  73. inset 0 0 0 1px var(--input-fg-color);
  74. }
  75. @media (forced-colors: active) {
  76. .form-boolean {
  77. appearance: auto;
  78. }
  79. }
  80. .form-boolean--type-radio {
  81. width: 1.1875rem;
  82. height: 1.1875rem;
  83. border-radius: 1.1875rem;
  84. }
  85. .form-boolean--type-radio:checked {
  86. border-color: var(--input--focus-border-color);
  87. background-image: url("data:image/svg+xml,%3csvg width='17' height='17' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle r='4.5' cx='8.5' cy='8.5' fill='%23003ecc'/%3e%3c/svg%3e");
  88. box-shadow: inset 0 0 0 1px var(--input--focus-border-color);
  89. }
  90. .form-boolean--type-radio:checked:focus {
  91. box-shadow:
  92. 0 0 0 2px var(--color-white),
  93. 0 0 0 5px var(--color-focus),
  94. inset 0 0 0 1px var(--input--focus-border-color);
  95. }
  96. .form-boolean--type-radio:checked:focus:active,
  97. .form-boolean--type-radio:checked:focus:hover {
  98. box-shadow:
  99. 0 0 0 2px var(--color-white),
  100. 0 0 0 5px var(--color-focus),
  101. inset 0 0 0 1px var(--input-fg-color);
  102. }
  103. .form-boolean--type-radio:checked:active,
  104. .form-boolean--type-radio:checked:hover {
  105. border-color: var(--input-fg-color);
  106. background-image: url("data:image/svg+xml,%3csvg width='17' height='17' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle r='4.5' cx='8.5' cy='8.5' fill='%23000f33'/%3e%3c/svg%3e");
  107. box-shadow: inset 0 0 0 1px var(--input-fg-color);
  108. }
  109. .form-boolean--type-checkbox:checked {
  110. border-color: var(--input--focus-border-color);
  111. background-color: var(--input--focus-border-color);
  112. background-image: url("data:image/svg+xml,%3csvg width='16' height='16' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M3.795 7.096l2.387 2.506 6.023-6.327 1.484 1.56-7.507 7.89L2.31 8.656z' fill='%23fff'/%3e%3c/svg%3e");
  113. }
  114. .form-boolean--type-checkbox:checked:active,
  115. .form-boolean--type-checkbox:checked:hover {
  116. border-color: var(--input-fg-color);
  117. background-color: var(--input-fg-color);
  118. }
  119. /**
  120. * Error states.
  121. */
  122. .form-boolean.error {
  123. border-color: var(--input--error-border-color);
  124. background-color: var(--input-bg-color);
  125. box-shadow: inset 0 0 0 1px var(--input--error-border-color);
  126. }
  127. .form-boolean.error:active,
  128. .form-boolean.error:hover {
  129. box-shadow: inset 0 0 0 1px var(--input--error-border-color);
  130. }
  131. .form-boolean.error:focus,
  132. .form-boolean.error:focus:active,
  133. .form-boolean.error:focus:hover {
  134. box-shadow:
  135. 0 0 0 2px var(--color-white),
  136. 0 0 0 5px var(--color-focus),
  137. inset 0 0 0 1px var(--input--error-border-color);
  138. }
  139. .form-boolean.error:checked:active,
  140. .form-boolean.error:checked:hover {
  141. border-color: var(--input--error-border-color);
  142. background-color: var(--input-bg-color);
  143. }
  144. .form-boolean--type-checkbox.error:checked,
  145. .form-boolean--type-checkbox.error:checked:active,
  146. .form-boolean--type-checkbox.error:checked:hover {
  147. background-color: var(--input--error-border-color);
  148. }
  149. .form-boolean--type-radio.error:checked,
  150. .form-boolean--type-radio.error:checked:active,
  151. .form-boolean--type-radio.error:checked:hover {
  152. background-image: url("data:image/svg+xml,%3csvg width='17' height='17' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle r='4.5' cx='8.5' cy='8.5' fill='%23d72222'/%3e%3c/svg%3e");
  153. }
  154. .form-boolean--type-radio.error:checked:focus {
  155. box-shadow:
  156. 0 0 0 2px var(--color-white),
  157. 0 0 0 5px var(--color-focus),
  158. inset 0 0 0 1px var(--input--error-border-color);
  159. }
  160. /**
  161. * Disabled states.
  162. */
  163. .form-boolean[disabled],
  164. .form-boolean[disabled]:hover,
  165. .form-boolean[disabled].error,
  166. .form-boolean[disabled].error:hover,
  167. .form-boolean--type-radio[disabled]:focus:active,
  168. .form-boolean--type-radio[disabled]:active:hover,
  169. .form-boolean--type-radio[disabled].error:active:hover {
  170. border-color: var(--input--disabled-border-color);
  171. background-color: var(--input--disabled-bg-color);
  172. background-image: none;
  173. box-shadow: none;
  174. }
  175. .form-boolean--type-checkbox[disabled]:checked {
  176. background-image: url("data:image/svg+xml,%3csvg width='16' height='16' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M3.795 7.096l2.387 2.506 6.023-6.327 1.484 1.56-7.507 7.89L2.31 8.656z' fill='%2382828c'/%3e%3c/svg%3e");
  177. }
  178. .form-boolean--type-radio[disabled]:checked,
  179. .form-boolean--type-radio[disabled].error:checked {
  180. background-image: url("data:image/svg+xml,%3csvg width='17' height='17' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle r='4.5' cx='8.5' cy='8.5' fill='%2382828c'/%3e%3c/svg%3e");
  181. }

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