link-preview-card.css (6347B)
1 /** 2 * This Source Code Form is subject to the terms of the Mozilla Public 3 * License, v. 2.0. If a copy of the MPL was not distributed with this 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 */ 6 7 .og-card { 8 font: menu; 9 --og-main-font-size: 15px; 10 background-color: light-dark(rgba(0, 0, 0, 0.05), rgba(255, 255, 255, 0.05)); 11 font-size: 13px; 12 } 13 14 .og-card-img { 15 border-radius: var(--border-radius-small); 16 height: 100px; 17 object-fit: cover; 18 width: 100%; 19 } 20 21 .og-card-content { 22 background-color: var(--panel-background); 23 border-bottom: 1px solid var(--panel-border-color); 24 color: var(--text-color-deemphasized); 25 display: flex; 26 flex-direction: column; 27 gap: var(--space-large); 28 padding: var(--og-padding); 29 } 30 31 .og-card-title { 32 color: var(--panel-color); 33 font-size: var(--og-main-font-size); 34 font-weight: var(--heading-font-weight); 35 margin: 0; 36 overflow: hidden; 37 -webkit-line-clamp: 3; 38 } 39 40 .og-card-description { 41 color: var(--panel-color); 42 font-size: var(--og-main-font-size); 43 margin: 0; 44 overflow: hidden; 45 -webkit-line-clamp: 3; 46 } 47 48 .og-error-message { 49 font-size: var(--og-main-font-size); 50 margin-block: 0 var(--space-medium); 51 } 52 53 .ai-content { 54 position: relative; 55 padding: var(--og-padding); 56 57 .og-error-message-container { 58 font-size: var(--og-main-font-size); 59 margin: 0; 60 61 .og-error-message { 62 color: var(--text-color-deemphasized); 63 } 64 65 a { 66 color: var(--text-color-deemphasized); 67 } 68 } 69 70 .keypoints-header { 71 display: flex; 72 font-size: var(--og-main-font-size); 73 font-weight: var(--heading-font-weight); 74 gap: var(--space-xs); 75 margin: 0; 76 user-select: none; 77 } 78 .keypoints-header::before { 79 content: ""; 80 background-image: url("chrome://global/skin/icons/arrow-down.svg"); 81 background-position: center; 82 background-repeat: no-repeat; 83 background-size: contain; 84 display: inline-block; 85 fill: currentColor; 86 height: var(--icon-size); 87 margin-inline-end: var(--space-small); 88 -moz-context-properties: fill; 89 transform: rotateZ(0deg); 90 width: var(--icon-size); 91 } 92 93 @media (prefers-reduced-motion: no-preference) { 94 .keypoints-header::before { 95 transition: transform 0.3s ease; 96 } 97 } 98 99 .keypoints-header:has(+ .keypoints-content:not(.hidden))::before { 100 transform: rotateZ(-180deg); 101 } 102 103 &:dir(rtl) .keypoints-header:has(+ .keypoints-content:not(.hidden))::before { 104 transform: rotateZ(180deg); 105 } 106 107 img.icon { 108 fill: currentColor; 109 height: var(--icon-size); 110 margin-inline-start: var(--space-xlarge); 111 -moz-context-properties: fill; 112 pointer-events: none; 113 width: var(--icon-size); 114 } 115 116 .keypoints-content { 117 max-height: 1000px; 118 overflow: hidden; 119 padding-inline-start: 0.05rem; /* custom adjustment to align with chevron icon */ 120 transition: max-height 0.3s ease; 121 122 &.hidden { 123 max-height: 0; 124 overflow: hidden; 125 } 126 127 > ul { 128 font-size: var(--og-main-font-size); 129 line-height: 1.15; /* Design requires 18px line-height */ 130 list-style-type: square; 131 padding-inline: var(--space-xlarge) var(--space-xsmall); 132 } 133 134 li { 135 margin-block: var(--space-medium); 136 padding-inline-start: 5px; 137 &::marker { 138 color: var(--border-color-deemphasized); 139 } 140 } 141 142 .visit-link-container { 143 align-items: center; 144 display: flex; 145 justify-content: flex-end; 146 margin-top: var(--space-xlarge); 147 148 .visit-link { 149 align-items: center; 150 display: flex; 151 font-size: var(--og-main-font-size); 152 font-weight: var(--font-weight-semibold); 153 gap: var(--space-xs); 154 } 155 156 .visit-link::after { 157 content: ""; 158 background-image: url("chrome://browser/skin/forward.svg"); 159 background-position: center; 160 background-repeat: no-repeat; 161 background-size: contain; 162 display: inline-block; 163 fill: currentColor; 164 height: 16px; 165 margin-inline-start: 8px; 166 -moz-context-properties: fill; 167 width: 16px; 168 } 169 170 &:dir(rtl) .visit-link::after { 171 transform: scaleX(-1); 172 } 173 } 174 175 > hr { 176 border-color: var(--border-color-card); 177 margin-block: var(--space-xlarge); 178 } 179 180 > p { 181 margin-block: var(--space-medium) 0; 182 } 183 } 184 } 185 186 /** 187 * Defines the animation for the loading state of link preview keypoints 188 * Creates a smooth gradient animation that moves from right to left 189 * to indicate content is being loaded 190 */ 191 @keyframes link-preview-keypoints-loading { 192 0% { 193 background-position: 200% 0; 194 } 195 100% { 196 background-position: -200% 0; 197 } 198 } 199 200 .keypoints-list { 201 .content-item { 202 margin-bottom: var(--space-xlarge); 203 width: 100%; 204 205 &.loading { 206 div { 207 --skeleton-loader-background-color: var(--tab-group-suggestions-loading-animation-color-1); 208 --skeleton-loader-motion-element-color: var(--tab-group-suggestions-loading-animation-color-2); 209 animation: link-preview-keypoints-loading 3s infinite; 210 background: linear-gradient( 211 100deg, 212 var(--skeleton-loader-background-color) 30%, 213 var(--skeleton-loader-motion-element-color) 50%, 214 var(--skeleton-loader-background-color) 70% 215 ); 216 background-size: 200% 100%; 217 border-radius: 5px; 218 height: var(--og-main-font-size); 219 margin-bottom: 4px; 220 width: 100%; 221 /* Add non-impactful references to the CSS variables to satisfy the test browser_parsable_css */ 222 outline-color: var(--skeleton-loader-background-color); 223 border-color: var(--skeleton-loader-motion-element-color); 224 } 225 226 &.static div { 227 animation: none; 228 background: var(--skeleton-loader-background-color); 229 } 230 231 div:nth-of-type(1) { 232 max-width: 95%; 233 } 234 235 div:nth-of-type(2) { 236 max-width: 98%; 237 } 238 239 div:nth-of-type(3) { 240 max-width: 90%; 241 } 242 } 243 } 244 } 245 246 .reading-time-settings-container { 247 align-items: center; 248 display: flex; 249 justify-content: space-between; 250 } 251 252 model-optin { 253 --font-size-xxlarge: var(--og-main-font-size); 254 --optin-wrapper-box-shadow: 0 0 4px rgba(0, 0, 0, 0.25); 255 inset-inline: 0; 256 margin-inline: auto; 257 position: absolute; 258 top: 60px; 259 width: 75%; 260 z-index: 10; 261 }