Skip to content

Commit

Permalink
Format Menu
Browse files Browse the repository at this point in the history
  • Loading branch information
lxsmnsyc committed Jan 21, 2024
1 parent 20a9250 commit 113dd98
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 29 deletions.
25 changes: 14 additions & 11 deletions examples/menu/index.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="favicon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite App</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>

<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="favicon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite App</title>
</head>

<body>
<div id="app"></div>
<script type="module" src="/src/main.tsx"></script>
</body>

</html>
4 changes: 2 additions & 2 deletions examples/menu/postcss.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
}
};
},
};
35 changes: 25 additions & 10 deletions examples/menu/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import {
Menu,
MenuItem,
} from 'terracotta';
import { Menu, MenuItem } from 'terracotta';
import type { JSX } from 'solid-js';

function Separator(): JSX.Element {
Expand All @@ -16,24 +13,42 @@ export default function App(): JSX.Element {
return (
<div class="w-full flex items-center justify-center">
<Menu class="overflow-hidden w-64 rounded-lg shadow-lg ring-1 ring-black ring-opacity-5 bg-white flex flex-col space-y-1 p-1">
<MenuItem as="button" class="text-sm p-1 text-left rounded hover:bg-purple-600 hover:text-white focus:outline-none focus:bg-purple-600 focus:text-white">
<MenuItem
as="button"
class="text-sm p-1 text-left rounded hover:bg-purple-600 hover:text-white focus:outline-none focus:bg-purple-600 focus:text-white"
>
Open Link in New Tab
</MenuItem>
<MenuItem as="button" class="text-sm p-1 text-left rounded hover:bg-purple-600 hover:text-white focus:outline-none focus:bg-purple-600 focus:text-white">
<MenuItem
as="button"
class="text-sm p-1 text-left rounded hover:bg-purple-600 hover:text-white focus:outline-none focus:bg-purple-600 focus:text-white"
>
Open Link in New Window
</MenuItem>
<MenuItem as="button" class="text-sm p-1 text-left rounded hover:bg-purple-600 hover:text-white focus:outline-none focus:bg-purple-600 focus:text-white">
<MenuItem
as="button"
class="text-sm p-1 text-left rounded hover:bg-purple-600 hover:text-white focus:outline-none focus:bg-purple-600 focus:text-white"
>
Open Link in New Incognito Window
</MenuItem>
<Separator />
<MenuItem as="button" class="text-sm p-1 text-left rounded hover:bg-purple-600 hover:text-white focus:outline-none focus:bg-purple-600 focus:text-white">
<MenuItem
as="button"
class="text-sm p-1 text-left rounded hover:bg-purple-600 hover:text-white focus:outline-none focus:bg-purple-600 focus:text-white"
>
Save Link As...
</MenuItem>
<MenuItem as="button" class="text-sm p-1 text-left rounded hover:bg-purple-600 hover:text-white focus:outline-none focus:bg-purple-600 focus:text-white">
<MenuItem
as="button"
class="text-sm p-1 text-left rounded hover:bg-purple-600 hover:text-white focus:outline-none focus:bg-purple-600 focus:text-white"
>
Copy Link Address
</MenuItem>
<Separator />
<MenuItem as="button" class="text-sm p-1 text-left rounded hover:bg-purple-600 hover:text-white focus:outline-none focus:bg-purple-600 focus:text-white">
<MenuItem
as="button"
class="text-sm p-1 text-left rounded hover:bg-purple-600 hover:text-white focus:outline-none focus:bg-purple-600 focus:text-white"
>
Inspect
</MenuItem>
</Menu>
Expand Down
9 changes: 3 additions & 6 deletions examples/menu/tailwind.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
module.exports = {
mode: 'jit',
content: [
'./src/**/*.tsx',
],
content: ['./src/**/*.tsx'],
darkMode: 'class', // or 'media' or 'class'
variants: {},
plugins: [
],
};
plugins: [],
};

0 comments on commit 113dd98

Please sign in to comment.