Skip to content

Commit

Permalink
[Button] Fix disabled button text color (#11067)
Browse files Browse the repository at this point in the history
### WHY are these changes introduced?

Fixes disabled button text color that was flagged on `ContextualSaveBar`
during v12 bug hunt.

### WHAT is this pull request doing?

Updates disabled button styles in `ContextualSaveBar`.
    <details>
      <summary>ContextualSaveBar — before</summary>
<img
src="https://github.com/Shopify/polaris/assets/26749317/ed54d30a-2888-48d9-8f73-ec4caced2fea"
alt="ContextualSaveBar — before">
    </details>
    <details>
      <summary>ContextualSaveBar — after</summary>
<img
src="https://github.com/Shopify/polaris/assets/26749317/66b3e9c3-0e2e-4f32-a763-2e5a81bd7dea"
alt="ContextualSaveBar — after">
    </details>

### How to 🎩


[Storybook](https://5d559397bae39100201eedc1-tcijtkhntq.chromatic.com/?path=/story/all-components-contextualsavebar--disabled)

🖥 [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, Frame, ContextualSaveBar} from '../src';

export function Playground() {
  return (
    <Page title="Playground">
      {/* Add the code you want to test in here */}
      <div style={{height: '250px'}}>
        <Frame
          logo={{
            width: 86,
            contextualSaveBarSource:
              'https://cdn.shopify.com/s/files/1/2376/3301/files/Shopify_Secondary_Inverted.png',
          }}
        >
          <ContextualSaveBar
            message="Unsaved changes"
            saveAction={{
              onAction: () => console.log('add form submit logic'),
              loading: false,
              disabled: true,
            }}
            discardAction={{
              onAction: () => console.log('add clear form logic'),
            }}
          />
        </Frame>
      </div>
    </Page>
  );
}
```

</details>

### 🎩 checklist

- [ ] Tested on
[mobile](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md#cross-browser-testing)
- [x] 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
  • Loading branch information
laurkim authored Oct 31, 2023
1 parent 38ed8a9 commit a1cff35
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/rich-hats-dream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/polaris': patch
---

Fixed disabled button styling on `ContextualSaveBar` component
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,32 @@ export function Default() {
);
}

export function Disabled() {
return (
<div style={{height: '250px'}}>
<Frame
logo={{
width: 86,
contextualSaveBarSource:
'https://cdn.shopify.com/s/files/1/2376/3301/files/Shopify_Secondary_Inverted.png',
}}
>
<ContextualSaveBar
message="Unsaved changes"
saveAction={{
onAction: () => console.log('add form submit logic'),
loading: false,
disabled: true,
}}
discardAction={{
onAction: () => console.log('add clear form logic'),
}}
/>
</Frame>
</div>
);
}

export function WithFlushContents() {
return (
<div style={{height: '250px'}}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@

&[class*='Polaris-Button--disabled'],
&[class*='Button-disabled'] {
--pc-button-text: var(--p-color-text-secondary);
background: var(--pc-button-color-disabled);
color: var(--p-color-text-secondary);
}
}

Expand Down

0 comments on commit a1cff35

Please sign in to comment.