-
-
Notifications
You must be signed in to change notification settings - Fork 462
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document remark/rehype #938
Conversation
|
✅ Deploy Preview for astro-starlight ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
size-limit report 📦
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @kevinzunigacuellar!
Not 100% sure if this approach will work or not. For example, not super obvious with the test example of 100px, but shrink the viewport narrow enough and you’ll see this distortion:
![image in content that is stretched because its height is 100px even though its width has shrunk with its narrow container](https://private-user-images.githubusercontent.com/357379/277370260-da4df640-6cd5-44e8-b8b9-81943685c47a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjIyMjIwNTMsIm5iZiI6MTcyMjIyMTc1MywicGF0aCI6Ii8zNTczNzkvMjc3MzcwMjYwLWRhNGRmNjQwLTZjZDUtNDRlOC1iOGI5LTgxOTQzNjg1YzQ3YS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzI5JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDcyOVQwMjU1NTNaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0wZmE0MWE4MjA1Mjg1YjcyYzQ0NWIwYWExODNhMDBmOTJhYTFkMmRhY2JlMWMzMTliZWQ4Zjc2N2I1YzVhNGMyJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.j5sHddo5_BLqIUJA0drNUDetIMtuxvj65O1ylGqhWg0)
This would be more obvious for larger image sizes.
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
I am not very happy with this solution either 😓 |
Could we move this to a rehype plugin? |
Yeah I also considered this. I’d honestly love it if Starlight added zero custom rehype plugins to give users a clean slate for their own customisations. Maybe a good opportunity for a third-party plugin that we could recommend? Similar to Edit: Definitely not exactly that — it’s using |
I think that is a valid point and wise idea 👍 Tried quickly right now to see if something like that already existed, I'm a bit surprised it is not (or I did not find it easily) but would be fairly easy to setup and publish for someone (and yeah, definitely without cheerio). |
I think a rehype plugin it's a good idea but what about the support for markdoc files? |
Does Markdoc even allow HTML in markup? I think users would need a custom Markdoc tag for an iframe so the tag could also handle this case at the same time I guess? |
To get the ball rolling I added a small section to the end of the authoring content page about plugins. |
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this looks good to me! Do you want to do anything else in this PR @kevinzunigacuellar?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love it! Thanks for adding this @kevinzunigacuellar!
(Pressing the green big button...) |
What kind of changes does this PR include?
Description
height: auto
to elements (iframe, img, ...) when height its not set.height: auto
to showcase card