_chooser.scss 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. .chooser {
  2. margin-bottom: theme('spacing.[2.5]');
  3. &.blank .chosen {
  4. display: none;
  5. }
  6. &:not(.blank) .unchosen {
  7. display: none;
  8. }
  9. }
  10. // Very subdued button style specifically for choosers, as there can be a lot of
  11. // chooser fields left unused on a page editing form.
  12. .chooser__choose-button {
  13. display: flex;
  14. align-items: center;
  15. border-color: transparent;
  16. padding-inline-start: 0;
  17. // So the outline is slightly more separated from the text.
  18. padding-inline-end: $focus-outline-width;
  19. .icon {
  20. @include svg-icon(theme('spacing.5'), initial);
  21. color: inherit;
  22. margin-inline-end: 5px;
  23. }
  24. &:hover,
  25. &:focus {
  26. color: $color-button-hover;
  27. background-color: $color-white;
  28. }
  29. }
  30. .chosen {
  31. display: flex;
  32. gap: theme('spacing.4');
  33. align-items: center;
  34. }
  35. .chooser__preview {
  36. display: grid;
  37. align-items: center;
  38. justify-content: center;
  39. width: 60px;
  40. height: 60px;
  41. // Prevent this item from getting smaller if the title is long.
  42. flex-shrink: 0;
  43. background-color: theme('colors.grey.150');
  44. color: $color-white;
  45. border-radius: theme('borderRadius.sm');
  46. @media (forced-colors: active) {
  47. border: 1px solid transparent;
  48. }
  49. .icon {
  50. width: theme('spacing.7');
  51. height: theme('spacing.7');
  52. color: inherit;
  53. }
  54. }
  55. .chooser__title {
  56. @apply w-body-text-large;
  57. }
  58. .chooser__actions {
  59. display: flex;
  60. gap: theme('spacing.[1.5]');
  61. .button {
  62. // Subdued border as there can be a lot of chooser action buttons on a page.
  63. border-color: theme('colors.grey.150');
  64. }
  65. @media (hover: hover) {
  66. visibility: hidden;
  67. .chooser:hover & {
  68. visibility: visible;
  69. }
  70. }
  71. }
  72. .chooser__image {
  73. max-width: 200px;
  74. max-height: 140px;
  75. height: auto;
  76. width: auto;
  77. }