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

TreeView: Fix focus styles in styled-components v5.2+ #2375

Merged
merged 5 commits into from Sep 26, 2022

Conversation

colebemis
Copy link
Contributor

@colebemis colebemis commented Sep 26, 2022

Problem

styled-components v5.2 introduced a bug that changed how it expands & in CSS selectors.

This bug affected TreeView's current and focused styles (see "before" pictures).

Solution

I had to get creative with our CSS selectors to work around this bug.

Screenshots

Before After
CleanShot 2022-09-26 at 15 12 05 CleanShot 2022-09-26 at 15 11 30
CleanShot 2022-09-26 at 15 12 42 CleanShot 2022-09-26 at 15 13 13

Closes https://github.com/github/primer/issues/1312

Merge checklist

  • Added/updated tests
  • Added/updated documentation
  • Tested in Chrome
  • Tested in Firefox
  • Tested in Safari
  • Tested in Edge

Take a look at the What we look for in reviews section of the contributing guidelines for more information on how we review PRs.

@changeset-bot
Copy link

changeset-bot bot commented Sep 26, 2022

🦋 Changeset detected

Latest commit: f0b3119

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

This PR includes changesets to release 1 package
Name Type
@primer/react Patch

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

@github-actions
Copy link
Contributor

github-actions bot commented Sep 26, 2022

size-limit report 📦

Path Size
dist/browser.esm.js 77.1 KB (0%)
dist/browser.umd.js 77.71 KB (0%)

@colebemis colebemis temporarily deployed to github-pages September 26, 2022 21:53 Inactive
@colebemis colebemis marked this pull request as ready for review September 26, 2022 22:18
@colebemis colebemis requested review from a team and siddharthkp September 26, 2022 22:18
@colebemis colebemis temporarily deployed to github-pages September 26, 2022 22:23 Inactive
src/TreeView/TreeView.tsx Show resolved Hide resolved
@colebemis colebemis temporarily deployed to github-pages September 26, 2022 23:15 Inactive
@colebemis colebemis merged commit 96f3b8a into main Sep 26, 2022
@colebemis colebemis deleted the treeview-fix-focus-styles branch September 26, 2022 23:32
@primer-css primer-css mentioned this pull request Sep 26, 2022
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.

None yet

2 participants