PD
🧩 Plasmo Developerscholebhature7887

Shadcn dosnt seem to work in content script ui

I have been trying to get Shadcn to work with CSUI. I followed almost everything from this server as well as the documentation, but it just doesn't seem to work. tailwind seems to work fine. am attaching some code can someone please help me out index.tsx
import cssText from "data-text:~/contents/style.css"
import type { PlasmoCSConfig } from "plasmo"

import { Button } from "../components/button"

export const config: PlasmoCSConfig = {
matches: ["https://www.plasmo.com/*"]
}

export const getStyle = () => {
const style = document.createElement("style")
style.textContent = cssText.replaceAll(":root", ":host")
return style
}

const PlasmoContent = () => {
return (
<div className="fixed inset-5">
<button className="py-2.5 px-5 mr-2 mb-2 text-sm font-medium text-gray-900 focus:outline-none bg-white rounded-full border border-gray-200 hover:bg-gray-100 hover:text-blue-700">
HELLO WORLD
</button>

<Button size="lg" variant="destructive">
Demo Button
</Button>
</div>
)
}

export default PlasmoContent
import cssText from "data-text:~/contents/style.css"
import type { PlasmoCSConfig } from "plasmo"

import { Button } from "../components/button"

export const config: PlasmoCSConfig = {
matches: ["https://www.plasmo.com/*"]
}

export const getStyle = () => {
const style = document.createElement("style")
style.textContent = cssText.replaceAll(":root", ":host")
return style
}

const PlasmoContent = () => {
return (
<div className="fixed inset-5">
<button className="py-2.5 px-5 mr-2 mb-2 text-sm font-medium text-gray-900 focus:outline-none bg-white rounded-full border border-gray-200 hover:bg-gray-100 hover:text-blue-700">
HELLO WORLD
</button>

<Button size="lg" variant="destructive">
Demo Button
</Button>
</div>
)
}

export default PlasmoContent
css
@config "./tailwind.config.js";

@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
:root {
--background: 0 0% 100%;
--foreground: 222.2 47.4% 11.2%;
/* ...rest shadcn vars */
@config "./tailwind.config.js";

@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
:root {
--background: 0 0% 100%;
--foreground: 222.2 47.4% 11.2%;
/* ...rest shadcn vars */
tailwind config
const { fontFamily } = require("tailwindcss/defaultTheme")
// /** @type {import('tailwindcss').Config} */
module.exports = {
content: ["./contents/*.{ts,tsx}"], // your content-script files
theme: {
container: {
center: true,
padding: "2rem",
screens: {
"2xl": "1400px"
}
},
extend: {
colors: {
border: "hsl(var(--border))",
input: "hsl(var(--input))",
ring: "hsl(var(--ring))",
background: "hsl(var(--background))",
foreground: "hsl(var(--foreground))",
primary: {
DEFAULT: "hsl(var(--primary))",
// rest of the theme
}
const { fontFamily } = require("tailwindcss/defaultTheme")
// /** @type {import('tailwindcss').Config} */
module.exports = {
content: ["./contents/*.{ts,tsx}"], // your content-script files
theme: {
container: {
center: true,
padding: "2rem",
screens: {
"2xl": "1400px"
}
},
extend: {
colors: {
border: "hsl(var(--border))",
input: "hsl(var(--input))",
ring: "hsl(var(--ring))",
background: "hsl(var(--background))",
foreground: "hsl(var(--foreground))",
primary: {
DEFAULT: "hsl(var(--primary))",
// rest of the theme
}
cholebhature7887
cholebhature788768d ago
dir looks like this
No description
cholebhature7887
cholebhature788768d ago
output demo button should have red bg and other styles
No description
Tamir
Tamir31d ago
Hi @cholebhature7887 did you ever manage to fix this? Experiencing the same issue
cholebhature7887
cholebhature78877d ago
Yes I have fixed it
Arcane
Arcane7d ago
@cholebhature7887 has reached level 3. GG!
cholebhature7887
cholebhature78877d ago
Yes I have fixed it
Want results from more Discord servers?
Add your server
More Posts
with-message exampleHow can I get with-message example to fully work? Including communication between tabs and content wHow to mock storageHey guys, im fairly new with plasmo. currently writing e2e tests with playwright. How can i properlytab page works with pnpm run dev but is blocked when i run pnpm build and pnpm packageWhen I upload my zipfile to plasmo itero, none of my users can access the tab page. however It workssupport for multiple assetstrying to do a simple toggle icon extension (click extension to toggle icon) but it seems like only Supabase url and anon key exposedI am a newbie exploring Plasmo for supabase authentication. The public url and anon keys are added iSupabase url and anon key exposedI am a newbie exploring Plasmo for supabase authentication. The public url and anon keys are added iFirefox dev server manifest warningsThe ```json { "content_security_policy": { "extension_pages": "script-src 'self' http://localhimport url no longer workingHey folks 👋🏻 just upgraded our extension at Attio to the latest version of Plasmo (0.85). It seemsCan't figure out how to navigate from my extention to my auth pageI'm trying to test a popup extension I made that has a button that is supposed to navigate to `http:Parallel dev serversI need to both run `plasmo dev --verbose` and `plasmo dev --verbose --target=firefox-mv3`, but when Absolutely! In Plasmo, to send a messageAbsolutely! In Plasmo, to send a message from a side panel to a content script in the main world, yoHow to sendToBackground from main worldi've try all of messaging method but background still not receive anythingHow to fetch current tab localStorage?How to use this storage Api in plasmo to to fetch the localStorage of the current open tab?. And whHow can I open the side panel programmatically?I am interested in opening the side panel programmatically by messaging the background script from t