Skip to content

Commit 114a42f

Browse files
committed
wip
1 parent a94c097 commit 114a42f

7 files changed

Lines changed: 1358 additions & 19 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"typecheck": "vue-tsc --noEmit"
1212
},
1313
"dependencies": {
14-
"@5stack/ui": "^0.1.1",
14+
"@5stack/ui": "^0.2.0",
1515
"class-variance-authority": "^0.7.1",
1616
"clsx": "^2.1.1",
1717
"lucide-vue-next": "^0.508.0",

src/App.vue

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@ defineProps<{
1010
</script>
1111

1212
<template>
13-
<!-- data-hello-plugin anchors the Tailwind `important` selector, so this
14-
plugin's utilities can never leak onto the panel's own chrome.
15-
display:contents keeps the wrapper from adding a layout box. -->
16-
<div data-hello-plugin style="display: contents">
13+
<!-- data-5stack-plugin anchors the `important` selector from
14+
@5stack/ui/tailwind-plugin-preset, so this plugin's utilities and base
15+
rules can never leak onto the panel's own chrome. Required on the root of
16+
every custom page. display:contents keeps the wrapper from adding a
17+
layout box. -->
18+
<div data-5stack-plugin style="display: contents">
1719
<div
1820
class="flex min-h-hero flex-col items-center justify-center gap-4 p-8 text-center"
1921
>

src/main.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22
import { createApp } from "vue";
33
import App from "./App.vue";
44

5+
// Global preflight for standalone dev only — outside the panel nothing has
6+
// reset UA styles. The panel applies its own when embedded, and shipping
7+
// preflight is what damages the host chrome, so the guard keeps it out of the
8+
// production bundle entirely.
9+
if (import.meta.env.DEV) {
10+
import("@5stack/ui/standalone.css");
11+
}
12+
513
createApp(App, {
614
user: { steam_id: "76561197960265728", name: "Dev User", role: "administrator" },
715
}).mount("#app");

src/shims-vue.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ declare module "*.vue" {
33
const component: DefineComponent<Record<string, unknown>, Record<string, unknown>, unknown>;
44
export default component;
55
}
6-
declare module "@5stack/ui/tokens.css";
6+
declare module "@5stack/ui/plugin.css";
7+
declare module "@5stack/ui/standalone.css";

src/style.css

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1-
@import "@5stack/ui/tokens.css";
1+
/* Everything this plugin needs: tokens, components, utilities, and the scoped
2+
base rules. Deliberately no `@tailwind` directives of your own — plugin.css
3+
is the Tailwind entrypoint, and adding `@tailwind base` here would emit
4+
global preflight that repaints the panel's chrome. */
5+
@import "@5stack/ui/plugin.css";

tailwind.config.js

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,10 @@
11
/** @type {import('tailwindcss').Config} */
22
module.exports = {
3-
darkMode: ["class"],
4-
// This plugin's CSS is injected at runtime AFTER the panel's stylesheet, so an
5-
// unscoped utility like `.hidden` would override the host's `hidden md:flex`
6-
// sidebar pattern and nuke the panel nav. Scoping every generated utility
7-
// under the plugin root makes that impossible. Rename this alongside `scope`.
8-
important: "[data-hello-plugin]",
9-
presets: [require("@5stack/ui/tailwind-preset")],
10-
content: [
11-
"./index.html",
12-
"./src/**/*.{vue,ts}",
13-
"./node_modules/@5stack/ui/src/**/*.{vue,ts}",
14-
],
3+
// The plugin preset scopes every generated utility under [data-5stack-plugin]
4+
// and adds the @5stack/ui content glob, so a plugin can never leak CSS onto
5+
// the panel's chrome. Anchor the attribute on your root element (see App.vue).
6+
presets: [require("@5stack/ui/tailwind-plugin-preset")],
7+
content: ["./index.html", "./src/**/*.{vue,ts}"],
158
theme: {
169
extend: {
1710
// Named tokens instead of arbitrary values like `min-h-[60vh]`. Escaped

0 commit comments

Comments
 (0)