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

added hover and focus for interactive element (header/footer) #217

Merged
merged 5 commits into from
Oct 24, 2019

Conversation

MSakamaki
Copy link
Contributor

#210
A unified hover/focus has been applied to the interactive elements of the header and footer.

@MSakamaki MSakamaki requested a review from rviscomi October 22, 2019 04:23
@@ -235,6 +260,12 @@ footer .nav-items *:last-child {
.social-media img:hover {
Copy link
Member

Choose a reason for hiding this comment

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

Combine the selectors to avoid repeating the same styles.

Suggested change
.social-media img:hover {
.social-media img:hover,
.social-media a:focus img {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok, fix it.

filter: brightness(0) saturate(100%) invert(86%) sepia(4%) saturate(4357%) hue-rotate(16deg) brightness(136%) contrast(94%);
}

header.alt-bg a.interactive:hover, footer.alt-bg a.interactive:hover,
Copy link
Member

Choose a reason for hiding this comment

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

Why is a.interactive:hover needed and not simply a:hover? Are there some anchors that shouldn't inherit these interactive styles?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Certainly, this is simple text a hover/focus, so this useless selector (interactive) can be removed.
I agree and fix it.

Comment on lines 56 to 61
a.navigation-logo img:hover {
filter: brightness(0) saturate(100%) invert(86%) sepia(4%) saturate(4357%) hue-rotate(16deg) brightness(136%) contrast(94%);
}
a.navigation-logo:focus img {
filter: brightness(0) saturate(100%) invert(86%) sepia(4%) saturate(4357%) hue-rotate(16deg) brightness(136%) contrast(94%);
}
Copy link
Member

Choose a reason for hiding this comment

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

Combine

Suggested change
a.navigation-logo img:hover {
filter: brightness(0) saturate(100%) invert(86%) sepia(4%) saturate(4357%) hue-rotate(16deg) brightness(136%) contrast(94%);
}
a.navigation-logo:focus img {
filter: brightness(0) saturate(100%) invert(86%) sepia(4%) saturate(4357%) hue-rotate(16deg) brightness(136%) contrast(94%);
}
a.navigation-logo img:hover,
a.navigation-logo:focus img {
filter: brightness(0) saturate(100%) invert(86%) sepia(4%) saturate(4357%) hue-rotate(16deg) brightness(136%) contrast(94%);
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok, fix it.

@rviscomi rviscomi added the development Building the Almanac tech stack label Oct 22, 2019
@rviscomi rviscomi added this to the Infrastructure complete milestone Oct 22, 2019
@rviscomi rviscomi added the enhancement New feature or request label Oct 22, 2019
@rviscomi rviscomi changed the title added hover and focus for interactive element (header/fotter) added hover and focus for interactive element (header/footer) Oct 22, 2019
header.alt-bg a.interactive:hover::after, footer.alt-bg a.interactive:hover::after,
header.alt-bg a.interactive:focus::after, footer.alt-bg a.interactive:focus::after {
content: '';
border-bottom: solid 1px #F7F779;
Copy link
Member

Choose a reason for hiding this comment

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

What's the advantage of a border on the ::after pseudo-element versus text- decoration: underline on the anchor itself?

Underline:
image

Border:
image

I also noticed with the border, the link shifts vertically by a few px on hover. Is that intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rviscomi
I'm sorry, there was no deep thought in this, it was my mistake.
(This is a remnant of trying out focus decorations)
I agree this should fix be text-underlined.

Copy link
Member

Choose a reason for hiding this comment

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

No worries! This is looking great! 🙌

@rviscomi
Copy link
Member

One question about border vs underline, otherwise this looks great. Thanks for working on it!

Copy link
Member

@rviscomi rviscomi left a comment

Choose a reason for hiding this comment

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

Just one minor style fix, then this is good to go. Thanks again for working on this!

filter: brightness(0) saturate(100%) invert(86%) sepia(4%) saturate(4357%) hue-rotate(16deg) brightness(136%) contrast(94%);
}

header.alt-bg a:hover, footer.alt-bg a:hover,
Copy link
Member

Choose a reason for hiding this comment

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

The "Start Exploring" button in the header appears to have an underline when hovered/focused, which I like:

image

But the same button in the intro section does not:

image

Could you make sure this behavior is consistent for all buttons and an underline is shown?

Copy link
Member

Choose a reason for hiding this comment

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

To clarify, I do like the underline for buttons, I just want to make sure they're shown consistently 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rviscomi
I will start this task!
Try to underline the button explicitly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rviscomi
During the focus test, I found problem in my environment (chrome and firefox for mac os).

At a certain resolution(width: 1480px), when there is a overflow content of position: relative/absolute, can not touch it, so the button to disabled focus.

Setting z-index: 1 to button avoids the problem, but do you know a smarter way?

スクリーンショット 2019-10-24 2 12 51

Copy link
Contributor Author

Choose a reason for hiding this comment

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

notebook:
Even if width 599px, can not press some of Contributors buttons.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah I noticed that too. I have a fix in #212: https://github.com/HTTPArchive/almanac.httparchive.org/pull/212/files#diff-dcfbc15530630ce0591f21b62fbb1237R217 (disabling pointer events for the "91" text)

Copy link
Member

Choose a reason for hiding this comment

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

^ That PR was just merged so this should be fixed for you now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rviscomi
I was saved!
this I good experience and I will complete the rest of the tasks.

color: #F7F779;
outline: none;
}
header.alt-bg a.interactive:hover, footer.alt-bg a.interactive:hover,
Copy link
Member

Choose a reason for hiding this comment

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

I think this can be simplified to a:hover, a:focus { text-decoration: underline; }

Are there any cases where we don't want a link to have an underline?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agreed 👍
Yes, I working on it now.

@rviscomi
Copy link
Member

Looks great! Thanks for working on this @MSakamaki!

@rviscomi rviscomi merged commit cd9edd6 into master Oct 24, 2019
@rviscomi rviscomi deleted the hover-focus-4-interactive-elements branch October 24, 2019 01:18
@MSakamaki
Copy link
Contributor Author

Thank @rviscomi for checking at the code details!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
development Building the Almanac tech stack enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants