Skip to content
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

Merged
merged 13 commits into from
Oct 27, 2023
Merged

Document remark/rehype #938

merged 13 commits into from
Oct 27, 2023

Conversation

kevinzunigacuellar
Copy link
Sponsor Member

@kevinzunigacuellar kevinzunigacuellar commented Oct 20, 2023

What kind of changes does this PR include?

Description

  • Only applies height: auto to elements (iframe, img, ...) when height its not set.
  • Added height: auto to showcase card

@changeset-bot
Copy link

changeset-bot bot commented Oct 20, 2023

⚠️ No Changeset found

Latest commit: bb822f9

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@netlify
Copy link

netlify bot commented Oct 20, 2023

Deploy Preview for astro-starlight ready!

Name Link
🔨 Latest commit bb822f9
🔍 Latest deploy log https://app.netlify.com/sites/astro-starlight/deploys/653bf5e5f10c0e0008b11465
😎 Deploy Preview https://deploy-preview-938--astro-starlight.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 100 (no change from production)
Accessibility: 100 (no change from production)
Best Practices: 100 (no change from production)
SEO: 100 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

@github-actions github-actions bot added 📚 docs Documentation website changes 🌟 core Changes to Starlight’s main package labels Oct 20, 2023
@astrobot-houston
Copy link
Collaborator

astrobot-houston commented Oct 20, 2023

size-limit report 📦

Path Size
/index.html 5.13 KB (0%)
/_astro/*.js 19.27 KB (0%)
/_astro/*.css 9.68 KB (0%)

Copy link
Member

@delucis delucis left a 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

This would be more obvious for larger image sizes.

docs/src/content/docs/reference/test.mdx Outdated Show resolved Hide resolved
kevinzunigacuellar and others added 2 commits October 23, 2023 09:09
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
@kevinzunigacuellar
Copy link
Sponsor Member Author

I am not very happy with this solution either 😓

@HiDeoo
Copy link
Member

HiDeoo commented Oct 24, 2023

I am not very happy with this solution either 😓

Could we move this to a rehype plugin?

@delucis
Copy link
Member

delucis commented Oct 24, 2023

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 gatsby-remark-responsive-iframe maybe?

Edit: Definitely not exactly that — it’s using cheerio to parse stuff???

@HiDeoo
Copy link
Member

HiDeoo commented Oct 24, 2023

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?

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).

@kevinzunigacuellar
Copy link
Sponsor Member Author

I think a rehype plugin it's a good idea but what about the support for markdoc files?

@HiDeoo
Copy link
Member

HiDeoo commented Oct 24, 2023

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?

@github-actions github-actions bot removed the 🌟 core Changes to Starlight’s main package label Oct 24, 2023
@kevinzunigacuellar
Copy link
Sponsor Member Author

To get the ball rolling I added a small section to the end of the authoring content page about plugins.

@delucis delucis changed the title fix: remove height auto when height attribute is set Document remark/rehype Oct 25, 2023
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
Copy link
Member

@delucis delucis left a 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?

Copy link
Member

@ElianCodes ElianCodes left a 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!

@kevinzunigacuellar
Copy link
Sponsor Member Author

(Pressing the green big button...)

@kevinzunigacuellar kevinzunigacuellar merged commit ba70635 into main Oct 27, 2023
9 checks passed
@kevinzunigacuellar kevinzunigacuellar deleted the css-height-fix branch October 27, 2023 17:46
vasfvitor added a commit to vasfvitor/astro-starlight that referenced this pull request Nov 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📚 docs Documentation website changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Height and width of Embed element are not correct.
5 participants