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

Fixes component info font size #9651

Merged
merged 8 commits into from
Oct 23, 2024
Merged

Fixes component info font size #9651

merged 8 commits into from
Oct 23, 2024

Conversation

dawoodkhan82
Copy link
Collaborator

@dawoodkhan82 dawoodkhan82 commented Oct 10, 2024

Description

  • Fixes css applied to markdown in info.
Screenshot 2024-10-10 at 11 55 23 AM

Closes: #9642

🎯 PRs Should Target Issues

Before your create a PR, please check to see if there is an existing issue for this change. If not, please create an issue before you create this PR, unless the fix is very small.

Not adhering to this guideline will result in the PR being closed.

Tests

  1. PRs will only be merged if tests pass on CI. To run the tests locally, please set up your Gradio environment locally and run the tests: bash scripts/run_all_tests.sh

  2. You may need to run the linters: bash scripts/format_backend.sh and bash scripts/format_frontend.sh

@gradio-pr-bot
Copy link
Collaborator

gradio-pr-bot commented Oct 10, 2024

🪼 branch checks and previews

Name Status URL
Spaces ready! Spaces preview
Storybook ready! Storybook preview
🦄 Changes detected! Details

Install Gradio from this PR

pip install https://gradio-pypi-previews.s3.amazonaws.com/fcce787cfa7dafb0f8acd39bd28e2cc30185bd5a/gradio-5.3.0-py3-none-any.whl

Install Gradio Python Client from this PR

pip install "gradio-client @ git+https://github.com/gradio-app/gradio@fcce787cfa7dafb0f8acd39bd28e2cc30185bd5a#subdirectory=client/python"

Install Gradio JS Client from this PR

npm install https://gradio-npm-previews.s3.amazonaws.com/fcce787cfa7dafb0f8acd39bd28e2cc30185bd5a/gradio-client-1.7.0.tgz

Use Lite from this PR

<script type="module" src="https://gradio-lite-previews.s3.amazonaws.com/fcce787cfa7dafb0f8acd39bd28e2cc30185bd5a/dist/lite.js""></script>

@gradio-pr-bot
Copy link
Collaborator

gradio-pr-bot commented Oct 10, 2024

🦄 change detected

This Pull Request includes changes to the following packages.

Package Version
@gradio/atoms patch
gradio patch
  • Maintainers can select this checkbox to manually select packages to update.

With the following changelog entry.

Fixes component info font size

Maintainers or the PR author can modify the PR title to modify this entry.

Something isn't right?

  • Maintainers can change the version label to modify the version bump.
  • If the bot has failed to detect any changes, or if this pull request needs to update multiple packages to different versions or requires a more comprehensive changelog entry, maintainers can update the changelog file directly.

js/atoms/src/Info.svelte Outdated Show resolved Hide resolved
@abidlabs
Copy link
Member

Font size looks good @dawoodkhan82 but previously, we would also use a subdued color for the info text. Compare 4 (top) vs. 5 (bottom), which would be nice to bring back:

image image

I also think there should be slightly more padding underneath the info text

js/atoms/src/Info.svelte Outdated Show resolved Hide resolved
@aliabid94
Copy link
Collaborator

Use this instead:

	div > :global(.md.prose) {
		color: var(--block-info-text-color);
		font-weight: var(--block-info-text-weight);
		font-size: var(--block-info-text-size);
		line-height: var(--line-sm);
	}
	div {
		margin-bottom: var(--spacing-md);
	}

Avoids the use of !important, scopes the :global, and the margin bottom wasn't being applied to a span since it's display: inline, so apply it to the div.

@aliabid94
Copy link
Collaborator

Honestly passing in the style configuration as parameters to the Markdown svelte component is also a fine approach, and is less likely to break in case we change class names in Markdown.svelte.

Copy link
Collaborator

@aliabid94 aliabid94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I think in the future it'd be great to have a SimpleMarkdown svelte component, that maybe only accepts bold, italics, and url links. We don't want all the complexity of markdown in BlockInfo, which is what's causing this issue, and I'm sure there are other places too we only want limited markdown.

@dawoodkhan82 dawoodkhan82 merged commit 1163a37 into main Oct 23, 2024
23 of 24 checks passed
@dawoodkhan82 dawoodkhan82 deleted the info-font branch October 23, 2024 05:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Component info font size not smaller in v5
4 participants