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

Add example headers to patterns demos. #660

Merged
merged 2 commits into from
Jul 22, 2024
Merged

Conversation

richard-to
Copy link
Collaborator

@richard-to richard-to commented Jul 22, 2024

A common use case to have a header for the app. This example was extracted from the prompt tuner console app that I've been working on.

Also think it will be useful for the Mesop AI stuff.

Ref: #338

Full width

Screenshot 2024-07-22 at 1 25 51 PM

Mobile

Screenshot 2024-07-22 at 1 25 59 PM

A common use case to have a header for the app. This example was
extracted from the prompt tuner console app that I've been working on.
with header(max_width=None):
with header_section():
me.text(
"Mesop", type="headline-6", style=me.Style(margin=me.Margin(bottom=0))
Copy link
Collaborator

Choose a reason for hiding this comment

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

side-note: I've wondered whether we should just reset the default margins for headings to 0. I find it quite annoying to set it to margin 0, and it would improve cross-browser consistency.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah that's an interesting idea. On one hand, I definitely agree that the default headline margins are kind of absurdly large.

I think having some sensible margin bottom is kind of good, so it doesn't always need to be tweaked. Since 0 probably wouldn't be great in all cases.

Copy link
Collaborator

@wwwillchen wwwillchen left a comment

Choose a reason for hiding this comment

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

nice!

me.slot()


def merge_styles(
Copy link
Collaborator

Choose a reason for hiding this comment

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

this is interesting :)

@richard-to richard-to merged commit ce41f76 into google:main Jul 22, 2024
3 checks passed
@richard-to richard-to deleted the headers branch July 24, 2024 20:13
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.

2 participants