| --- |
| interface Props { |
| source?: string; |
| } |
|
|
| const { source } = Astro.props; |
| --- |
|
|
| <blockquote class="quote"> |
| <div class="quote__text"> |
| <slot /> |
| </div> |
| { |
| source && ( |
| <footer class="quote__footer"> |
| <span class="quote__source" set:html={source} /> |
| </footer> |
| ) |
| } |
| </blockquote> |
|
|
| <style> |
| .quote { |
| font-family: var(--default-font-family); |
| margin: 32px 0; |
| max-width: 600px; |
| text-align: left; |
| position: relative; |
| padding: 0; |
| border: none; |
| background: none; |
| box-shadow: none; |
| white-space: normal; |
| } |
| |
| .quote::before { |
| content: '"'; |
| position: absolute; |
| top: -24px; |
| left: -30px; |
| font-size: 8rem; |
| font-family: var(--default-font-family); |
| font-weight: 400; |
| color: var(--text-color); |
| opacity: 0.05; |
| z-index: -1; |
| line-height: 1; |
| pointer-events: none; |
| } |
| |
| .quote__text { |
| font-size: 1.5rem; |
| line-height: 1.4; |
| font-style: normal; |
| font-weight: 400; |
| font-family: |
| "SF Pro Text", |
| -apple-system, |
| BlinkMacSystemFont, |
| "Segoe UI", |
| sans-serif; |
| color: var(--text-color); |
| margin-bottom: 12px; |
| padding: 0; |
| letter-spacing: -0.01em; |
| } |
| |
| .quote__text p { |
| margin: 0; |
| } |
| |
| .quote__footer { |
| font-size: 0.875rem; |
| color: var(--muted-color); |
| display: flex; |
| justify-content: flex-start; |
| align-items: center; |
| gap: 6px; |
| margin-top: 0; |
| font-family: |
| "SF Pro Text", |
| -apple-system, |
| BlinkMacSystemFont, |
| "Segoe UI", |
| sans-serif; |
| } |
| |
| .quote__source { |
| font-weight: 500; |
| opacity: 0.85; |
| font-style: italic; |
| color: var(--text-color); |
| } |
| |
| .quote__source::before { |
| content: "— "; |
| font-style: normal; |
| } |
| |
| @media (max-width: 640px) { |
| .quote { |
| margin: 24px 0; |
| max-width: 100%; |
| } |
| |
| .quote::before { |
| font-size: 6rem; |
| top: -18px; |
| left: -16px; |
| } |
| |
| .quote__text { |
| font-size: 1.25rem; |
| line-height: 1.45; |
| padding: 0; |
| } |
| |
| .quote__footer { |
| flex-direction: row; |
| gap: 6px; |
| font-size: 0.8rem; |
| } |
| } |
| </style> |
|
|