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

feat(docs): backdrop filter the navbar #9

Merged
merged 1 commit into from
May 9, 2023
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
39 changes: 22 additions & 17 deletions darc-docs/src/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,30 @@

/* You can override the default Infima variables here. */
:root {
--ifm-color-primary: #2e8555;
--ifm-color-primary-dark: #29784c;
--ifm-color-primary-darker: #277148;
--ifm-color-primary-darkest: #205d3b;
--ifm-color-primary-light: #33925d;
--ifm-color-primary-lighter: #359962;
--ifm-color-primary-lightest: #3cad6e;
--ifm-code-font-size: 95%;
--docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.1);
--ifm-color-primary: #2e8555;
--ifm-color-primary-dark: #29784c;
--ifm-color-primary-darker: #277148;
--ifm-color-primary-darkest: #205d3b;
--ifm-color-primary-light: #33925d;
--ifm-color-primary-lighter: #359962;
--ifm-color-primary-lightest: #3cad6e;
--ifm-code-font-size: 95%;
--docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.1);
}

/* For readability concerns, you should choose a lighter palette in dark mode. */
[data-theme='dark'] {
--ifm-color-primary: #25c2a0;
--ifm-color-primary-dark: #21af90;
--ifm-color-primary-darker: #1fa588;
--ifm-color-primary-darkest: #1a8870;
--ifm-color-primary-light: #29d5b0;
--ifm-color-primary-lighter: #32d8b4;
--ifm-color-primary-lightest: #4fddbf;
--docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.3);
--ifm-color-primary: #25c2a0;
--ifm-color-primary-dark: #21af90;
--ifm-color-primary-darker: #1fa588;
--ifm-color-primary-darkest: #1a8870;
--ifm-color-primary-light: #29d5b0;
--ifm-color-primary-lighter: #32d8b4;
--ifm-color-primary-lightest: #4fddbf;
--docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.3);
}

.navbar {
backdrop-filter: blur(30px);
background: transparent;
}
8 changes: 7 additions & 1 deletion darc-docs/src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
} from "react-icons/all";
import {useCopyToClipboard} from "react-use";
import Link from "@docusaurus/Link";
import {customTheme} from "../theme";

// styled docusaurus link without underline and default color
const PlainLink = styled(Link)(({theme}) => ({
Expand Down Expand Up @@ -67,6 +68,11 @@ function HomepageHeader() {
<Stack direction={'row'} spacing={2}>
<Button size={'lg'} endDecorator={<FiChevronRight/>}
component={PlainLink} to={'/docs/Overview/'}
sx={{
'&:hover': {
color: 'var(--joy-palette-common-white, #FFF)',
},
}}
>Get started</Button>
<Box sx={{
cursor: 'pointer',
Expand Down Expand Up @@ -154,7 +160,7 @@ export default function Home() {
<Layout
title={`Hello from ${siteConfig.title}`}
description="Description will go into a meta tag in <head />">
<CssVarsProvider>
<CssVarsProvider disableTransitionOnChange theme={customTheme}>
<Box sx={{
my: 10
}}>
Expand Down
68 changes: 68 additions & 0 deletions darc-docs/src/theme.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import {extendTheme} from '@mui/joy/styles';

export const customTheme = extendTheme({
colorSchemes: {
light: {
palette: {
background: {
body: 'var(--joy-palette-neutral-50)',
},
},
},
dark: {
palette: {
neutral: {
outlinedBorder: 'var(--joy-palette-neutral-700)',
},
},
},
},
components: {
JoyAutocomplete: {
styleOverrides: {
root: {
boxShadow: 'var(--joy-shadow-xs)',
},
},
},
JoyButton: {
styleOverrides: {
root: {
boxShadow: 'var(--joy-shadow-xs)',
transition: 'all 0.2s ease-in-out',
'&:hover': {
transform: 'scale(1.05)',
},
'&:active': {
transform: 'scale(0.95)',
},
},
},
},
JoyInput: {
styleOverrides: {
root: {
boxShadow: 'var(--joy-shadow-xs)',
},
},
},
JoyTextarea: {
styleOverrides: {
root: {
boxShadow: 'var(--joy-shadow-xs)',
},
},
},
JoySelect: {
styleOverrides: {
root: {
boxShadow: 'var(--joy-shadow-xs)',
},
},
},
},
fontFamily: {
display: "'Inter', var(--joy-fontFamily-fallback)",
body: "'Inter', var(--joy-fontFamily-fallback)",
},
});