FR: small link preview option #279
jasikpark
started this conversation in
Feature Requests
Replies: 1 comment
-
|
Just noting that you can get something like this style using a little CSS: .link-preview {
--link-preview-width: 100%;
flex-direction: row-reverse;
column-gap: 1rem;
}
.link-preview :is(img, video) {
width: 12rem;
max-width: 40%;
}Not quite the same as your example screenshot but places the media at the start and the rest to the right. The component doesn’t currently accept a Right now you’d need to do something like this and target <div class="small">
<LinkPreview id="..." />
</div>Would be nice to simplify that to: <LinkPreview class="small" id="..." />You could then wrap that up into a component for as many variants as you needed: ---
import { LinkPreview } from '@astro-community/astro-embed-link-preview';
import type { ComponentProps } from "astro/types";
type Props = ComponentProps<typeof LinkPreview> & {
size: 'small' | 'default' | 'large';
}
const { size, ...props } = Astro.props;
---
<LinkPreview class={size} {...props} />
<style>
.small :global(.link-preview) {
/* small styles */
}
.large :global(.link-preview) {
/* large styles */
}
</style> |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
^ https://craft.do open graph embed
It'd be great to have a smaller format link preview that places the image at the beginning of the preview.
For example:
Beta Was this translation helpful? Give feedback.
All reactions