Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions UNRELEASED.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
### Enhancements

- Removed `max-height` property from `Tooltip` ([#2908](https://github.com/Shopify/polaris-react/pull/2908))
- Update `TopBar.Menu` to be properly themed in active, hover and focused state ([#2928](https://github.com/Shopify/polaris-react/pull/2928))

### Bug fixes

Expand Down
9 changes: 6 additions & 3 deletions src/components/TopBar/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -322,9 +322,11 @@ function TopBarExample() {
const theme = {
colors: {
topBar: {
background: '#357997',
backgroundLighter: '#6192a9',
color: '#FFFFFF',
background: '#fff',
backgroundLighter: '#F4F6F8',
backgroundDarker: '#DFE3E8',
border: '#C4CDD5',
color: '#212B36',
},
},
logo: {
Expand Down Expand Up @@ -370,6 +372,7 @@ function TopBarExample() {
onChange={handleSearchChange}
value={searchValue}
placeholder="Search"
showFocusBorder
Copy link
Member

Choose a reason for hiding this comment

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

To make it easier for the plus team, I updated the example to use their white theme.

/>
);

Expand Down
18 changes: 10 additions & 8 deletions src/components/TopBar/components/Menu/Menu.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@

$activator-variables: (
min-width: rem(36px),
border-left: 1px solid rgba(color('black'), 0.42),
transition: background-color 0.1s,
focus-background-color: rgba(color('white'), 0.16),
hover-background-color: rgba(color('white'), 0.08),
active-background-color: rgba(color('black'), 0.28),
Comment on lines -7 to -9
Copy link
Member

Choose a reason for hiding this comment

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

These values are used once and blocked multiple theme overrides.

focus-opacity: 0.85,
);

Expand Down Expand Up @@ -39,19 +35,25 @@ $activator-variables: (
&:focus {
@include focus-ring($style: 'focused');
background-color: var(
--p-override-transparent,
menu(focus-background-color)
--top-bar-background-lighter,
var(--p-override-transparent, rgba(color('white'), 0.16))
);
outline: none;
}

&:hover {
background-color: var(--p-surface-hovered, menu(hover-background-color));
background-color: var(
--top-bar-background-lighter,
var(--p-surface-hovered, rgba(color('white'), 0.08))
);
}

&:active,
&[aria-expanded='true'] {
background-color: var(--p-surface-pressed, menu(active-background-color));
background-color: var(
--top-bar-background-darker,
var(--p-surface-pressed, rgba(color('black'), 0.28))
);
outline: none;
transition: none;

Expand Down
1 change: 1 addition & 0 deletions src/utilities/custom-properties/custom-properties.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export const nonDesignLangaugeCustomProperties = [
'--Polaris-RangeSlider-output-factor',
'--top-bar-color',
'--top-bar-background-lighter',
'--top-bar-background-darker',
'--top-bar-border',
'--p-frame-offset',
];
Expand Down