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
3 changes: 1 addition & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,10 @@ trunk check
- Install required dependencies:

```sh
npm install @fontsource-variable/figtree @fontsource/ibm-plex-mono @oddbird/css-anchor-positioning
npm install @fontsource-variable/figtree @fontsource/ibm-plex-mono
```

- Import `styles.css` using your framework’s standard method.
- Conditionally load the [`@oddbird/css-anchor-positioning` polyfill](https://github.com/oddbird/css-anchor-positioning?tab=readme-ov-file#getting-started).

3. **Match the HTML structure**
- Follow the general HTML structure used by existing examples to stay consistent.
Expand Down
62 changes: 0 additions & 62 deletions examples/astro/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion examples/astro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"@astrojs/node": "9.5.4",
"@fontsource-variable/figtree": "5.2.10",
"@fontsource/ibm-plex-mono": "5.2.7",
"@oddbird/css-anchor-positioning": "0.9.0",
"astro": "5.18.1"
},
"devDependencies": {
Expand Down
7 changes: 0 additions & 7 deletions examples/astro/src/layouts/Main.astro
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,6 @@ import "../styles/styles.css";
<meta name="viewport" content="width=device-width" />
<meta name="generator" content={Astro.generator} />
<title>Arcjet Astro example app</title>
<script>
// Polyfill Anchor Positioning
// https://github.com/oddbird/css-anchor-positioning?tab=readme-ov-file#getting-started
if (!("anchorName" in document.documentElement.style)) {
await import("@oddbird/css-anchor-positioning");
}
</script>
</head>
<body class="layout">
<header class="header">
Expand Down
1 change: 0 additions & 1 deletion examples/astro/src/styles/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,6 @@
line-height: 1.75rem;
padding: 0;

/* Explicit anchor-name required for polyfill */
anchor-name: --navigation-popover-anchor;

&:hover {
Expand Down
1 change: 0 additions & 1 deletion examples/nextjs-bot-protection/styles/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,6 @@
line-height: 1.75rem;
padding: 0;

/* Explicit anchor-name required for polyfill */
anchor-name: --navigation-popover-anchor;

&:hover {
Expand Down
36 changes: 0 additions & 36 deletions examples/nextjs-fly/components/PopoverTarget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,6 @@

import { type ComponentProps, useEffect, useRef } from "react";

const POLYFILL_APPLIED: unique symbol = Symbol.for(
"@oddbird/css-anchor-positioning",
);

declare global {
interface Window {
[POLYFILL_APPLIED]?: boolean;
}
}

async function polyfillAnchorPositioning() {
const { default: polyfill } = await import(
"@oddbird/css-anchor-positioning/fn"
);
await polyfill(true);
}

type Props = {
id: string;
closeAtWidthPx: number;
Expand Down Expand Up @@ -47,24 +30,5 @@ export function PopoverTarget({ closeAtWidthPx, ...props }: Props) {
};
}, [closeAtWidthPx]);

useEffect(() => {
if (typeof window === "undefined") {
return;
}

// https://github.com/oddbird/css-anchor-positioning?tab=readme-ov-file#getting-started
if (
!window[POLYFILL_APPLIED] &&
!("anchorName" in document.documentElement.style)
) {
polyfillAnchorPositioning().catch((error: unknown) => {
console.error(
"Failed to load @oddbird/css-anchor-positioning polyfill:",
error,
);
});
}
}, []);

return <nav ref={popover} popover="auto" {...props} />;
}
81 changes: 0 additions & 81 deletions examples/nextjs-fly/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion examples/nextjs-fly/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
"@fontsource/ibm-plex-mono": "5.2.7",
"@hookform/resolvers": "5.2.2",
"@nosecone/next": "1.3.0",
"@oddbird/css-anchor-positioning": "0.9.0",
"next": "16.2.1",
"next-themes": "0.4.6",
"react": "19.2.4",
Expand Down
1 change: 0 additions & 1 deletion examples/nextjs-fly/styles/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,6 @@
line-height: 1.75rem;
padding: 0;

/* Explicit anchor-name required for polyfill */
anchor-name: --navigation-popover-anchor;

&:hover {
Expand Down
1 change: 0 additions & 1 deletion examples/nextjs-form/styles/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,6 @@
line-height: 1.75rem;
padding: 0;

/* Explicit anchor-name required for polyfill */
anchor-name: --navigation-popover-anchor;

&:hover {
Expand Down
1 change: 0 additions & 1 deletion examples/nextjs-server-action/styles/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,6 @@
line-height: 1.75rem;
padding: 0;

/* Explicit anchor-name required for polyfill */
anchor-name: --navigation-popover-anchor;

&:hover {
Expand Down
Loading
Loading