Skip to content

Commit

Permalink
[Tabs] pressed state fix (#8990)
Browse files Browse the repository at this point in the history
<!--
  ☝️How to write a good PR title:
- Prefix it with [ComponentName] (if applicable), for example: [Button]
  - Start with a verb, for example: Add, Delete, Improve, Fix…
  - Give as much context as necessary and as little as possible
  - Prefix it with [WIP] while it’s a work in progress
-->

### WHY are these changes introduced?

The pressed state of tabs turned the highlight color bright green. This
was a little jarring and not an optimal designer experience.

<!--
  Context about the problem that’s being addressed.
-->

### WHAT is this pull request doing?
This PR simply changes the tokens used for both the hover and active
state. Both are now using a bg token since the css attribute being
targeted is `background-color`. The active state is also now remaining
gray to fix the jarring experience where it turned bright green.


<!--
  Summary of the changes committed.

Before / after screenshots are appreciated for UI changes. Make sure to
include alt text that describes the screenshot.

If you include an animated gif showing your change, wrapping it in a
details tag is recommended. Gifs usually autoplay, which can cause
accessibility issues for people reviewing your PR:

    <details>
      <summary>Summary of your gif(s)</summary>
      <img src="..." alt="Description of what the gif shows">
    </details>
-->

<!-- ℹ️ Delete the following for small / trivial changes -->

### How to 🎩

🖥 [Local development
instructions](https://github.com/Shopify/polaris/blob/main/README.md#local-development)
🗒 [General tophatting
guidelines](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md)
📄 [Changelog
guidelines](https://github.com/Shopify/polaris/blob/main/.github/CONTRIBUTING.md#changelog)

<!--
  Give as much information as needed to experiment with the component
  in the playground.
-->

<details>
<summary>Copy-paste this code in
<code>playground/Playground.tsx</code>:</summary>

```jsx
import React from 'react';
import {Page} from '../src';

export function Playground() {
  return (
    <Page title="Playground">
      {/* Add the code you want to test in here */}
    </Page>
  );
}
```

</details>

### 🎩 checklist

- [ ] Tested on
[mobile](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md#cross-browser-testing)
- [ ] Tested on [multiple
browsers](https://help.shopify.com/en/manual/shopify-admin/supported-browsers)
- [ ] Tested for
[accessibility](https://github.com/Shopify/polaris/blob/main/documentation/Accessibility%20testing.md)
- [ ] Updated the component's `README.md` with documentation changes
- [ ] [Tophatted
documentation](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting%20documentation.md)
changes in the style guide

---------

Co-authored-by: Alex Page <hi@alexpage.dev>
Co-authored-by: Aaron Casanova <32409546+aaronccasanova@users.noreply.github.com>
  • Loading branch information
3 people committed Apr 17, 2023
1 parent 91a9b77 commit 9674cc9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/healthy-emus-pump.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/polaris': patch
---

Update tokens for border of `Tabs` on hover and pressed state to create better quality interaction.
4 changes: 2 additions & 2 deletions polaris-react/src/components/Tabs/Tabs.scss
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ $item-vertical-padding: $item-min-height * 0.5;
background-color: transparent;
// stylelint-disable-next-line selector-max-specificity -- generated by polaris-migrator DO NOT COPY
&::before {
background-color: var(--p-color-border-hover);
background-color: var(--p-color-bg-strong-hover);
}
}
}
Expand All @@ -73,7 +73,7 @@ $item-vertical-padding: $item-min-height * 0.5;
background-color: transparent;
// stylelint-disable-next-line selector-max-specificity -- generated by polaris-migrator DO NOT COPY
&::before {
background: var(--p-color-bg-primary-subdued-active);
background-color: var(--p-color-bg-strong-active);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion polaris-react/src/components/Tag/Tag.scss
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ $button-size: 20px;
}

&:active {
background: var(--p-color-bg-strong-active);
background: var(--p-color-bg-strong-hover);
}

&:disabled {
Expand Down

0 comments on commit 9674cc9

Please sign in to comment.