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

feat: update themes for header and footer #3654

Merged
merged 15 commits into from
Apr 11, 2022

Conversation

jouni
Copy link
Member

@jouni jouni commented Apr 8, 2022

Header and footer styles

I updated the dev page to include examples of the new functionality.

Lumo

Screen Shot 2022-04-08 at 12 02 07

When scrolled:

Screen Shot 2022-04-08 at 12 02 32

Material

Screen Shot 2022-04-08 at 12 03 10

When scrolled:

Screen Shot 2022-04-08 at 12 03 53

When scrolled to the end:

Screen Shot 2022-04-08 at 12 03 38

@jouni
Copy link
Member Author

jouni commented Apr 8, 2022

Ah, forgot that I need to update the screen shots…

@@ -10,29 +10,94 @@ const dialogOverlay = css`
max-width: 560px;
min-width: 280px;
-webkit-tap-highlight-color: transparent;
border-radius: 8px;
Copy link
Member

Choose a reason for hiding this comment

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

I'd like to extract this change to separate PR as well, to have a separate entry in the release notes.

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually, let’s not even introduce this change. I just checked, and the previous Material Design spec has 4px radius on dialogs. I think I had been looking at the updated specs, where the radius is something like 16px, and somehow thought this change was needed.

@web-padawan web-padawan changed the title Dialog header footer themes feat: update themes for header and footer Apr 8, 2022

<script type="module">
const dialog1 = document.querySelector('vaadin-dialog');
dialog1.headerTitle = 'Title';
dialog1.draggable = true;
dialog1.resizable = true;

dialog1.renderer = (root) => {
Copy link
Contributor

@vursen vursen Apr 11, 2022

Choose a reason for hiding this comment

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

thought: I wonder if it would make sense to use Lit at least for the renderers for readability purposes? The more sophisticated dialog becomes, the harder to follow its source code.

Copy link
Member

Choose a reason for hiding this comment

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

I'm going to add Lit helpers to my CF project later: https://github.com/web-padawan/lit-vaadin-helpers

We'll eventually move them to the monorepo at some point, as part of #266

Copy link
Contributor

@vursen vursen Apr 11, 2022

Choose a reason for hiding this comment

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

OK, sure 👍 my point was mainly about the current dialog dev page where Lit could be considered to make the renderers more declarative.

Copy link
Member

@web-padawan web-padawan left a comment

Choose a reason for hiding this comment

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

Let's merge #3663 first and then update this PR using overflow attribute instead of current hacks.

@web-padawan
Copy link
Member

web-padawan commented Apr 11, 2022

Pushed a commit to use overflow attribute into a separate branch: 4abe774

@knoobie
Copy link
Contributor

knoobie commented Apr 11, 2022

Looking at the screenshot diff: should the header be right aligned even with no title? I would suggest to align the header to the left by default and align it to the right if used in conjunction with the title.

@web-padawan
Copy link
Member

should the header be right aligned even with no title?

I might be wrong, but it feels like the reason for making it right aligned is the often requested "close button" use case.

@knoobie
Copy link
Contributor

knoobie commented Apr 11, 2022

I might be wrong, but it feels like the reason for making it right aligned is the often requested "close button" use case.

I think you are right as well! That's why I would not change the right alignment if used with the title attribute where we can probably 99% agree that the added header information has to be right aligned.

My "problem" comes with the other cases where people wanna use the header with multiple components in a renderer like a flex layout with something like "icon, hx, right aligned buttons" where you don't use title on purpose to allow elements inside the header to be the title. Now you have to make sure to align it to the left on every Dialog you create

Copy link
Member

@web-padawan web-padawan left a comment

Choose a reason for hiding this comment

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

LGTM. Let's discuss header content alignment in a separate issue - see #3669.

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@vaadin-bot
Copy link
Collaborator

This ticket/PR has been released with Vaadin 23.1.0.alpha2 and is also targeting the upcoming stable 23.1.0 version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants