Skip to content

Commit b7d9f32

Browse files
committed
going extra with the glass effects
1 parent adebdd3 commit b7d9f32

File tree

4 files changed

+51
-8
lines changed

4 files changed

+51
-8
lines changed

packages/docs/src/components/layout/docs.tsx

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,6 @@ const layoutStyles = stylex.create({
8282
gap: {
8383
flexGrow: 1,
8484
},
85-
sidebarTrigger: {
86-
// md:hidden
87-
// display: { default: 'none', '@media (min-width: 768px)': 'block' },
88-
},
8985
main: {
9086
// flex flex-1 flex-row [--fd-nav-height:56px]
9187
display: 'flex',
@@ -143,6 +139,8 @@ function Sidebar() {
143139
<aside {...stylex.props(sidebarStyles.base)} ref={sidebarRef}>
144140
{children}
145141
</aside>
142+
143+
<div {...stylex.props(sidebarStyles.overlayBlur)} />
146144
</div>
147145
);
148146
}
@@ -186,6 +184,18 @@ const sidebarStyles = stylex.create({
186184
bottom: 0,
187185
backdropFilter: 'blur(32px) saturate(800%)',
188186
},
187+
overlayBlur: {
188+
position: 'absolute',
189+
inset: 9,
190+
pointerEvents: 'none',
191+
overflow: 'hidden',
192+
borderRadius: 19,
193+
cornerShape: 'squircle',
194+
zIndex: 1,
195+
backdropFilter: 'blur(32px) saturate(600%)',
196+
maskImage:
197+
'linear-gradient(to right, white, transparent 8%, transparent 92%, white)',
198+
},
189199
base: {
190200
display: 'flex',
191201
flexDirection: 'column',
@@ -202,7 +212,7 @@ const sidebarStyles = stylex.create({
202212
borderStyle: 'solid',
203213
borderColor: 'var(--color-fd-border)',
204214
boxShadow: '0 4px 16px rgba(0, 0, 0, 0.06)',
205-
zIndex: 10,
215+
zIndex: 1,
206216
},
207217
});
208218

packages/docs/src/components/layout/home/client.tsx

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ export function Navbar({ xstyle, ...props }: StyleXComponentProps<'div'>) {
4545
>
4646
<nav {...stylex.props(navbarStyles.nav)}>{props.children}</nav>
4747
</NavigationMenuList>
48+
<div {...stylex.props(navbarStyles.overlayBlur)} />
4849
</header>
4950
</>
5051
</NavigationMenu>
@@ -86,13 +87,12 @@ const navbarStyles = stylex.create({
8687
position: 'absolute',
8788
inset: -8,
8889
bottom: -32,
89-
backdropFilter: 'blur(16px) saturate(800%)',
90+
backdropFilter: 'blur(16px) saturate(400%)',
9091
},
9192
gradientBlur: {
9293
position: 'absolute',
9394
inset: -8,
9495
bottom: -32,
95-
// backgroundColor: 'var(--color-fd-background)',
9696
backdropFilter: 'blur(32px)',
9797
maskImage: 'linear-gradient(to bottom, white 30%, transparent)',
9898
},
@@ -101,7 +101,21 @@ const navbarStyles = stylex.create({
101101
inset: -8,
102102
bottom: -32,
103103
backgroundColor: 'var(--color-fd-background)',
104-
maskImage: 'linear-gradient(to bottom, white 50%, transparent)',
104+
maskImage:
105+
'linear-gradient(to bottom, rgba(255, 255, 255, 0.8) 50%, transparent)',
106+
},
107+
overlayBlur: {
108+
position: 'absolute',
109+
pointerEvents: 'none',
110+
inset: 9,
111+
borderRadius: 19,
112+
cornerShape: 'squircle',
113+
overflow: 'hidden',
114+
backdropFilter: 'blur(20px) saturate(1000%)',
115+
backgroundColor: 'transparent',
116+
maskImage:
117+
'linear-gradient(to bottom, white, transparent 8%, transparent 92%, white)',
118+
zIndex: 10,
105119
},
106120
headerWithVals: {
107121
// 'max-lg:shadow-lg max-lg:rounded-b-2xl'

packages/docs/src/components/mdx/index.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import Heading from './Heading';
88
import { HTMLAttributes } from 'react';
99
import { StyleXStyles } from '@stylexjs/stylex';
1010
import MDXLink from './Link';
11+
import * as stylex from '@stylexjs/stylex';
1112

1213
type StyleXHTMLProps<T extends HTMLElement = HTMLElement> = Omit<
1314
HTMLAttributes<T>,
@@ -37,9 +38,19 @@ export const mdxComponents = {
3738
h6: (props: StyleXHTMLProps<HTMLHeadingElement>) => (
3839
<Heading as="h6" {...props} />
3940
),
41+
code: (props: StyleXHTMLProps<HTMLElement>) => (
42+
<code {...props} {...stylex.props(styles.code)} />
43+
),
4044
TabItem,
4145
Tabs,
4246
Dial,
4347
DevInstallExample,
4448
WhenDemo: Card,
4549
};
50+
51+
const styles = stylex.create({
52+
code: {
53+
// color: `hsl(var(--cyan-h), var(--cyan-s), var(--cyan-l))`,
54+
color: 'light-dark(hsl(146, 55%, 45%), hsl(146, 52%, 68%))',
55+
},
56+
});

packages/docs/waku.config.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ import * as MdxConfig from './source.config.js';
44
import tailwindcss from '@tailwindcss/vite';
55
import tsconfigPaths from 'vite-tsconfig-paths';
66
import stylex from '@stylexjs/unplugin';
7+
// import lightningcss from 'lightningcss';
8+
import { browserslistToTargets } from 'lightningcss';
9+
import browserslist from 'browserslist';
710

811
export default defineConfig({
912
vite: {
@@ -18,6 +21,11 @@ export default defineConfig({
1821
devMode: 'css-only',
1922
devPersistToDisk: true,
2023
runtimeInjection: false,
24+
lightningcssOptions: {
25+
minify: process.env.NODE_ENV !== 'development',
26+
27+
targets: browserslistToTargets(browserslist('>= 5%')),
28+
},
2129
}),
2230
// @ts-ignore
2331
tailwindcss(),

0 commit comments

Comments
 (0)