form-boolean.pcss.css

Same filename in other branches
  1. 10 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/variables.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-30);
  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--blue-50);
  22. outline: solid 2px var(--color--blue-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--blue-70);
  32. }
  33. &[disabled] {
  34. background-color: var(--color--gray-90);
  35. &:hover {
  36. border-color: var(--color--gray-30);
  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. /* Specific pseudo-element to apply red borders for IE11 bool elements in case of error */
  53. &.error::-ms-check {
  54. border: 1px solid var(--color--red);
  55. }
  56. & + label {
  57. display: inline-block;
  58. padding-inline-start: var(--sp0-5);
  59. }
  60. }
  61. input[type="checkbox"] {
  62. &:checked {
  63. 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");
  64. }
  65. }
  66. input[type="radio"] {
  67. border-radius: 50%;
  68. &:checked {
  69. 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");
  70. background-size: 17px;
  71. }
  72. &:focus {
  73. border-width: 2px;
  74. border-color: var(--color--blue-50);
  75. outline-color: transparent;
  76. box-shadow: 0 0 0 2px white, 0 0 0 4px var(--color--blue-50);
  77. }
  78. &.error:focus {
  79. outline-color: transparent;
  80. box-shadow: 0 0 0 2px white, 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.