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

UnderlineNav :focus styles #1764

Merged
merged 22 commits into from
Dec 7, 2021
Merged

UnderlineNav :focus styles #1764

merged 22 commits into from
Dec 7, 2021

Conversation

langermank
Copy link
Contributor

@langermank langermank commented Nov 23, 2021

In testing global focus styles #1744 we've discovered that UnderlineNav overrides outline styles for focus, and also is structured in such a way that the default focus outline will appear cutoff. This PR makes some style changes to improve how each nav item behaves, which is really only noticeable on hover or focus.

The goal with this is to not introduce any breaking changes (no markup changes) and keep the sizing as close to current prod as possible.

  • Adds a height declaration to .UnderlineNav instead of relying on .UnderlineNav-item to provide height with padding
  • Introduces a new mixin that extends the touch target which visually allows .UnderlineNav-item to be smaller. This creates more room for a focus outline
  • Minor spacing change for icons/counters inline with nav labels

I also added the focus styles directly to UnderlineNav which can be removed when global focus styles are introduced. I can remove that if we prefer to just use this PR as prep for global focus.

image

image

⚠️ Followup PR in dotcom to remove UnderlineNav hacks https://github.com/github/primer/issues/513

/cc @primer/css-reviewers

@changeset-bot
Copy link

changeset-bot bot commented Nov 23, 2021

🦋 Changeset detected

Latest commit: 759a925

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/css Minor

Not sure what this means? Click here to learn what changesets are.

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

@langermank
Copy link
Contributor Author

@simurai I'd like to deploy this to a lab one more time before merging, but for some reason the version release number is missing from the checks 🤔 I hoped maybe it would remain the same and a re-deploy to the lab would work, but no such luck. Any ideas?

@simurai
Copy link
Contributor

simurai commented Dec 2, 2021

for some reason the version release number is missing from the checks

Hmm.. weird.

I hoped maybe it would remain the same and a re-deploy to the lab would work, but no such luck.

Yeah, I think every push generates a new npm version. So that would need to be updated on dotcom again.

@simurai
Copy link
Contributor

simurai commented Dec 3, 2021

Ok, I merged another PR and then updated this branch. Which seemed to kick off another "Release / Canary (push)". New Canary version is:

0.0.0-20211130510

No idea what caused this hiccup? Maybe related to #1805. 🤷

@langermank
Copy link
Contributor Author

Thanks @simurai! I'm planning to deploy late on Monday so we can have some overlap testing time 😄 will let you know!

@mperrotti
Copy link
Contributor

I like your hover state treatment because it matches what ActionList does when we use it like vertical tabs for navigation. Great attention to detail 👏

@mperrotti
Copy link
Contributor

I also added the focus styles directly to UnderlineNav which can be removed when global focus styles are introduced. I can remove that if we prefer to just use this PR as prep for global focus.

I think it's safer to leave the focus styles in until we do the global focus styles.

@langermank
Copy link
Contributor Author

@simurai & co, here's the latest lab deploy (will expire in 4 hours) https://primer-underlinenav-test-2.review-lab.github.com/

Copy link
Contributor

@simurai simurai left a comment

Choose a reason for hiding this comment

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

here's the latest lab deploy (will expire in 4 hours) https://primer-underlinenav-test-2.review-lab.github.com/

Gave it a quick try. Haven't noticed anything unusual, except that the org nav item's height is different.

Screen Shot 2021-12-07 at 13 15 41

But I think that will be fixed by removing the hx_UnderlineNav class. I usually add a ⚠️ note in the PR description so that we don't forget it when updating dotcom with the PCSS version.

@langermank langermank merged commit cdd9728 into main Dec 7, 2021
@langermank langermank deleted the underline-nav-focus-state branch December 7, 2021 20:13
@primer-css primer-css mentioned this pull request Dec 7, 2021
jonrohan pushed a commit that referenced this pull request Dec 8, 2021
* add pseudo selectors

* adjustments

* add stories, cleanup

* update mixin

* fix mixin

* lint

* add back overflow styles

* adjust focus for better overflow state, scrollsnap

* post test adjustments, move hacks to primer css

* Stylelint auto-fixes

* hover state desktop only

* document data-content hack

* Create nice-days-jog.md

Co-authored-by: Actions Auto Build <actions@github.com>
Co-authored-by: simurai <simurai@github.com>
jonrohan added a commit that referenced this pull request Dec 8, 2021
* Updating and autofixing stylelint

* Moving config to primer/stylelint-config

* Removing unused disables from css

* Stylelint auto-fixes

* @primer/stylelint-config@12.2.0

* Remove these from workfow

* Use reusable release_canary workflow (#1811)

* Use reusable release_canary workflow

* Install with yarn

Co-authored-by: Jon Rohan <yes@jonrohan.codes>

* Use counter-border for LHC (#1792)

* Use counter-border for LHC

* Create orange-ties-sin.md

* Remove fallback

* UnderlineNav `:focus` styles (#1764)

* add pseudo selectors

* adjustments

* add stories, cleanup

* update mixin

* fix mixin

* lint

* add back overflow styles

* adjust focus for better overflow state, scrollsnap

* post test adjustments, move hacks to primer css

* Stylelint auto-fixes

* hover state desktop only

* document data-content hack

* Create nice-days-jog.md

Co-authored-by: Actions Auto Build <actions@github.com>
Co-authored-by: simurai <simurai@github.com>

* Add note about loading the "latest" Primer CSS version (#1784)

* Add stashing

* Stylelint auto-fixes

Co-authored-by: Actions Auto Build <actions@github.com>
Co-authored-by: Cole Bemis <colebemis@github.com>
Co-authored-by: simurai <simurai@github.com>
Co-authored-by: Katie Langerman <langermank@github.com>
jonrohan added a commit that referenced this pull request Dec 8, 2021
@jonrohan jonrohan restored the underline-nav-focus-state branch December 8, 2021 20:06
jonrohan added a commit that referenced this pull request Dec 8, 2021
* Revert "UnderlineNav `:focus` styles (#1764)"

This reverts commit cdd9728.

* Stylelint auto-fixes

Co-authored-by: Actions Auto Build <actions@github.com>
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.

4 participants