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

Fix 456/unblurred menu bar firefox #460

Merged
merged 2 commits into from
May 8, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 6 additions & 2 deletions apps/docs/src/components/hero/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,12 @@ const Hero: React.FC = () => {
transition: 'opacity 0.3s ease-in-out',
dflex: 'center',
boxShadow: '$sm',
bf: 'saturate(180%) blur(10px)',
bg: '$backgroundBlur',
bg: '$backgroundContrast',
'@supports ((-webkit-backdrop-filter: none) or (backdrop-filter: none))':
{
bf: 'saturate(180%) blur(10px)',
bg: '$backgroundBlur'
},
'@xsMax': {
width: '100%'
}
Expand Down
13 changes: 10 additions & 3 deletions apps/docs/src/components/mobile-navigation/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,16 @@ const MobileNavigation: React.FC<Props> = ({
display: none;
width: 100%;
min-height: 100%;
background: var(--nextui-colors-menuBackground);
backdrop-filter: saturate(180%) blur(10px);
--webkit-backdrop-filter: saturate(180%) blur(10px);
background: var(--nextui-colors-background);
}
@supports (
(-webkit-backdrop-filter: none) or (backdrop-filter: none)
) {
.mobile-navigation__wrapper {
background: var(--nextui-colors-menuBackground);
backdrop-filter: saturate(180%) blur(10px);
--webkit-backdrop-filter: saturate(180%) blur(10px);
}
}
.mobile-navigation__list {
margin: 0;
Expand Down
7 changes: 5 additions & 2 deletions apps/docs/src/components/primitives/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,11 @@ export const StyledCardBlur = styled('div', {
display: 'flex',
flexDirection: 'column',
p: '$8',
bf: 'saturate(180%) blur(14px)',
bg: 'rgba(255, 255, 255, 0.05)'
bg: '$backgroundContrast',
'@supports ((-webkit-backdrop-filter: none) or (backdrop-filter: none))': {
bf: 'saturate(180%) blur(14px)',
bg: 'rgba(255, 255, 255, 0.05)'
}
});

export const StyledImg = styled('img', {});
13 changes: 11 additions & 2 deletions apps/docs/src/components/search/autocomplete.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -357,8 +357,17 @@ const Autocomplete: React.FC<Props> = ({ hits, refine, offsetTop }) => {
.search__input-container,
.react-autosuggest__suggestions-container,
.no-results {
backdrop-filter: saturate(180%) blur(10px) !important;
background: ${addColorAlpha(theme?.colors?.accents1?.value, 0.7)};
background: var(--nextui-colors-accents0);
}
@supports (
(-webkit-backdrop-filter: none) or (backdrop-filter: none)
) {
.search__input-container,
.react-autosuggest__suggestions-container,
.no-results {
backdrop-filter: saturate(180%) blur(10px) !important;
background: ${addColorAlpha(theme?.colors?.accents1?.value, 0.7)};
}
}
.search__input-container {
z-index: 9999;
Expand Down
6 changes: 5 additions & 1 deletion apps/docs/src/layouts/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ export const StyledNavContainer = styled('div', {
variants: {
showBlur: {
true: {
background: '$headerBackground'
background: '$background',
'@supports ((-webkit-backdrop-filter: none) or (backdrop-filter: none))':
{
background: '$headerBackground'
}
}
},
detached: {
Expand Down
14 changes: 10 additions & 4 deletions packages/react/src/backdrop/backdrop.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,16 @@ export const StyledBackdropLayer = styled('div', {
variants: {
blur: {
true: {
opacity: 1,
transition: 'background 0.35s cubic-bezier(0.4, 0, 0.2, 1)',
backdropFilter: 'saturate(180%) blur(20px)',
bg: 'rgba(0, 0, 0, 0.1)'
bg: '$black',
opacity: '$$backdropOpacity',
transition: 'opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1)',
'@supports ((-webkit-backdrop-filter: none) or (backdrop-filter: none))':
{
opacity: 1,
transition: 'background 0.35s cubic-bezier(0.4, 0, 0.2, 1)',
backdropFilter: 'saturate(180%) blur(20px)',
bg: 'rgba(0, 0, 0, 0.1)'
}
},
false: {
bg: '$black',
Expand Down
66 changes: 66 additions & 0 deletions packages/react/src/modal/modal.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -741,3 +741,69 @@ export const FullScreen = () => {
</div>
);
};

export const Blur = () => {
const [visible, setVisible] = React.useState(false);
const handler = () => setVisible(true);
const closeHandler = () => {
setVisible(false);
console.log('closed');
};
return (
<div>
<Button auto color="warning" shadow onClick={handler}>
Open modal
</Button>
<Modal
closeButton
blur
aria-labelledby="modal-title"
open={visible}
onClose={closeHandler}
>
<Modal.Header>
<Text id="modal-title" size={18}>
Welcome to
<Text b size={18}>
NextUI
</Text>
</Text>
</Modal.Header>
<Modal.Body>
<Input
clearable
bordered
fullWidth
color="primary"
size="lg"
placeholder="Email"
contentLeft={<Mail fill="currentColor" />}
/>
<Input
clearable
bordered
fullWidth
color="primary"
size="lg"
placeholder="Password"
contentLeft={<Password fill="currentColor" />}
/>
<Row justify="space-between">
<Checkbox>
<Text size={14}>Remember me</Text>
</Checkbox>
<Text size={14}>Forgot password?</Text>
</Row>
</Modal.Body>
<Modal.Footer>
<Button auto flat color="error" onClick={closeHandler}>
Close
</Button>
<Button auto onClick={closeHandler}>
Sign in
</Button>
</Modal.Footer>
</Modal>
</div>
);
};