form-boolean.pcss.css

Same filename in other branches
  1. 9 core/themes/olivero/css/components/form-boolean.pcss.css
  2. 11.x core/themes/olivero/css/components/form-boolean.pcss.css

Checkbox and radio input elements.

File

core/themes/olivero/css/components/form-boolean.pcss.css

View source
  1. /**
  2. * @file
  3. * Checkbox and radio input elements.
  4. */
  5. @import "../base/media-queries.pcss.css";
  6. input[type="checkbox"],
  7. input[type="radio"] {
  8. display: inline-block;
  9. width: var(--sp1-5);
  10. height: var(--sp1-5);
  11. margin: 0;
  12. vertical-align: middle;
  13. border: 1px solid var(--color--gray-60);
  14. border-radius: 3px;
  15. background-color: var(--color--white);
  16. background-repeat: no-repeat;
  17. background-position: 50% 50%;
  18. background-size: var(--sp1) var(--sp1);
  19. appearance: none;
  20. &:focus {
  21. border: solid 2px var(--color--primary-50);
  22. outline: solid 2px var(--color--primary-50);
  23. @supports (outline-style: double) {
  24. border-width: 1px;
  25. outline-width: 6px;
  26. outline-style: double;
  27. outline-offset: -1px;
  28. }
  29. }
  30. &:hover {
  31. border-color: var(--color--primary-60);
  32. }
  33. &[disabled] {
  34. background-color: var(--color--gray-100);
  35. &:hover {
  36. border-color: var(--color--gray-60);
  37. }
  38. &:checked {
  39. border-width: 1px;
  40. }
  41. }
  42. &:checked {
  43. border-width: 2px;
  44. }
  45. &.error {
  46. border: solid 2px var(--color--red);
  47. &:focus {
  48. outline-color: var(--color--red);
  49. outline-offset: -2px;
  50. }
  51. }
  52. & + label {
  53. display: inline-block;
  54. padding-inline-start: var(--sp0-5);
  55. }
  56. }
  57. input[type="checkbox"] {
  58. &:checked {
  59. background-image: url("data:image/svg+xml,%3Csvg width='17px' height='13px' viewBox='0 0 17 13' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cpath d='M14.8232,0.176777 C14.9209,0.0791457 15.0791,0.0791455 15.1768,0.176777 L16.9445,1.94454 C17.0422,2.04217 17.0422,2.20047 16.9445,2.2981 L6.23744,13.0052 C6.13981,13.1028 5.98151,13.1028 5.88388,13.0052 L0.176777,7.2981 C0.0791456,7.20047 0.0791456,7.04218 0.176777,6.94454 L1.94454,5.17678 C2.04217,5.07915 2.20047,5.07915 2.2981,5.17678 L5.88388,8.76256 C5.98151,8.86019 6.13981,8.86019 6.23744,8.76256 L14.8232,0.176777 Z' id='Path' fill='%232494DB' fill-rule='nonzero'%3E%3C/path%3E%3C/svg%3E");
  60. }
  61. }
  62. input[type="radio"] {
  63. border-radius: 50%;
  64. &:checked {
  65. background-image: url("data:image/svg+xml,%3Csvg width='17' height='17' viewBox='0 0 17 17' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='8.5' cy='8.5' r='8.5' fill='%232494DB'/%3E%3C/svg%3E%0A");
  66. background-size: 17px;
  67. }
  68. &:focus {
  69. border-width: 2px;
  70. border-color: var(--color--primary-50);
  71. outline-color: transparent;
  72. box-shadow:
  73. 0 0 0 2px white,
  74. 0 0 0 4px var(--color--primary-50);
  75. }
  76. &.error:focus {
  77. outline-color: transparent;
  78. box-shadow:
  79. 0 0 0 2px white,
  80. 0 0 0 4px var(--color--red);
  81. }
  82. }
  83. .form-type-boolean {
  84. margin-block: var(--sp1);
  85. }

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