|
| 1 | +@use "nhsuk-frontend/dist/nhsuk/core" as *; |
| 2 | + |
| 3 | +// app/assets/sass/components/_mammogram-images.scss |
| 4 | +// Styles for mammogram image display - used across images, reading, and other views |
| 5 | + |
| 6 | +// Two-card flex layout for breast image cards - sizes to content not grid column |
| 7 | +.app-mammogram-cards { |
| 8 | + display: flex; |
| 9 | + flex-wrap: nowrap; |
| 10 | + @include nhsuk-responsive-margin(4, "bottom"); |
| 11 | +} |
| 12 | + |
| 13 | +.app-mammogram-card { |
| 14 | + // Size to content (thumbnail + card padding), but cap at 50% on narrow viewports |
| 15 | + width: fit-content; |
| 16 | + max-width: 50%; |
| 17 | + min-width: 0; |
| 18 | + |
| 19 | + &:first-child { |
| 20 | + @include nhsuk-responsive-margin(4, "right"); |
| 21 | + } |
| 22 | +} |
| 23 | + |
| 24 | +// View wrapper — one per standard mammogram view (e.g. RCC, RMLO) |
| 25 | +.app-mammogram-view--right, |
| 26 | +.app-mammogram-view--left { |
| 27 | + // Spacing between consecutive views |
| 28 | + &:not(:last-child) { |
| 29 | + @include nhsuk-responsive-margin(4, "bottom"); |
| 30 | + } |
| 31 | + |
| 32 | + // Spacing between multiple images of the same view |
| 33 | + .app-mammogram-thumbnail__image-wrapper + .app-mammogram-thumbnail__image-wrapper { |
| 34 | + @include nhsuk-responsive-margin(4, "top"); |
| 35 | + } |
| 36 | +} |
| 37 | + |
| 38 | +// Headings (view label text e.g. "1× RCC") align towards centre |
| 39 | +.app-mammogram-view--right h3 { |
| 40 | + text-align: right; |
| 41 | +} |
| 42 | + |
| 43 | +// Thumbnail grid for the reading opinion page |
| 44 | +.app-mammogram-thumbnails { |
| 45 | + display: inline-grid; |
| 46 | + grid-template-columns: auto auto; |
| 47 | + gap: 8px; |
| 48 | +} |
| 49 | + |
| 50 | +// Right and left breast thumbnail columns |
| 51 | +.app-mammogram-thumbnail--right { |
| 52 | + display: flex; |
| 53 | + flex-direction: column; |
| 54 | + align-items: flex-end; |
| 55 | +} |
| 56 | + |
| 57 | +.app-mammogram-thumbnail--left { |
| 58 | + display: flex; |
| 59 | + flex-direction: column; |
| 60 | + align-items: flex-start; |
| 61 | +} |
| 62 | + |
| 63 | +// Individual image wrapper |
| 64 | +.app-mammogram-thumbnail__image-wrapper { |
| 65 | + position: relative; |
| 66 | + // Scales to fill card width, up to the natural thumbnail size |
| 67 | + width: 100%; |
| 68 | + max-width: 120px; |
| 69 | + aspect-ratio: 4 / 5; |
| 70 | + background-color: #000; |
| 71 | + overflow: hidden; |
| 72 | + display: flex; |
| 73 | + align-items: flex-start; |
| 74 | +} |
| 75 | + |
| 76 | +// Right breast images align right (inwards), left breast align left (inwards) |
| 77 | +.app-mammogram-thumbnail--right .app-mammogram-thumbnail__image-wrapper { |
| 78 | + justify-content: flex-end; |
| 79 | +} |
| 80 | + |
| 81 | +.app-mammogram-thumbnail--left .app-mammogram-thumbnail__image-wrapper { |
| 82 | + justify-content: flex-start; |
| 83 | +} |
| 84 | + |
| 85 | +// Large size variant - used on dedicated image pages where thumbnails are primary content |
| 86 | +.app-mammogram-thumbnail__image-wrapper--large { |
| 87 | + max-width: 200px; |
| 88 | + |
| 89 | + .app-mammogram-thumbnail__label { |
| 90 | + font-size: 18px; |
| 91 | + padding: 3px 10px; |
| 92 | + } |
| 93 | +} |
| 94 | + |
| 95 | +.app-mammogram-thumbnail__image { |
| 96 | + max-width: 100%; |
| 97 | + max-height: 100%; |
| 98 | + display: block; |
| 99 | + cursor: default; |
| 100 | +} |
| 101 | + |
| 102 | +// Slight smoothing for diagram thumbnails to reduce moiré |
| 103 | +.app-mammogram-thumbnail__image--diagram { |
| 104 | + filter: blur(0.5px); |
| 105 | +} |
| 106 | + |
| 107 | +// Blue label badge overlaid on the image (e.g. "RCC") |
| 108 | +.app-mammogram-thumbnail__label { |
| 109 | + position: absolute; |
| 110 | + top: 4px; |
| 111 | + background-color: nhsuk-colour("blue"); |
| 112 | + color: #fff; |
| 113 | + padding: 2px 6px; |
| 114 | + font-size: 11px; |
| 115 | + font-weight: 600; |
| 116 | + z-index: 1; |
| 117 | +} |
| 118 | + |
| 119 | +// Labels align to outer edge - right breast labels on left, left breast labels on right |
| 120 | +.app-mammogram-thumbnail--right .app-mammogram-thumbnail__label { |
| 121 | + left: 4px; |
| 122 | +} |
| 123 | + |
| 124 | +.app-mammogram-thumbnail--left .app-mammogram-thumbnail__label { |
| 125 | + right: 4px; |
| 126 | +} |
| 127 | + |
| 128 | +// Missing image placeholder |
| 129 | +.app-mammogram-thumbnail__missing { |
| 130 | + width: 100%; |
| 131 | + height: 100%; |
| 132 | + border: 2px dashed nhsuk-colour("grey-2"); |
| 133 | + background-color: nhsuk-colour("grey-5"); |
| 134 | + display: flex; |
| 135 | + align-items: center; |
| 136 | + justify-content: center; |
| 137 | + box-sizing: border-box; |
| 138 | +} |
| 139 | + |
| 140 | +.app-mammogram-thumbnail__missing-text { |
| 141 | + font-size: 16px; |
| 142 | + color: nhsuk-colour("grey-2"); |
| 143 | +} |
| 144 | + |
| 145 | +// Zoom overlay for expanded thumbnail view |
| 146 | +.app-mammogram-zoom { |
| 147 | + position: fixed; |
| 148 | + top: 0; |
| 149 | + left: 0; |
| 150 | + right: 0; |
| 151 | + bottom: 0; |
| 152 | + background-color: rgba(0, 0, 0, 0.95); |
| 153 | + z-index: 9999; |
| 154 | + display: flex; |
| 155 | + align-items: center; |
| 156 | + justify-content: center; |
| 157 | + cursor: default; |
| 158 | +} |
| 159 | + |
| 160 | +.app-mammogram-zoom__image { |
| 161 | + max-width: 95%; |
| 162 | + max-height: 95%; |
| 163 | + object-fit: contain; |
| 164 | +} |
| 165 | + |
| 166 | +.app-mammogram-zoom__label { |
| 167 | + position: absolute; |
| 168 | + top: 16px; |
| 169 | + left: 16px; |
| 170 | + background-color: nhsuk-colour("blue"); |
| 171 | + color: #fff; |
| 172 | + padding: 8px 16px; |
| 173 | + font-size: 14px; |
| 174 | + font-weight: 600; |
| 175 | +} |
0 commit comments