Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use tailwind css CDN #111

Open
DsWebApp opened this issue Aug 9, 2022 · 3 comments
Open

How to use tailwind css CDN #111

DsWebApp opened this issue Aug 9, 2022 · 3 comments

Comments

@DsWebApp
Copy link

DsWebApp commented Aug 9, 2022

I am using tailwind in NUXT,
name: '_blank',
specs: [
'fullscreen=yes',
'titlebar=yes',
'scrollbars=yes'
],
styles: [
'https://cdn.tailwindcss.com',
],
timeout: 1000, // default timeout before the print window appears
autoClose: true, // if false, the window will not close after printing
}
not working

@kaungsandev
Copy link

kaungsandev commented Aug 21, 2022

CDN version for tailwindcss can't be added to styles because it should be call as script as shown in official documentation of tailwindcss.
My solution is generate tailwindcss with their standalone version Tailwindcss standalone version .
You should output your "output.css" in public folder so that CSS can be loaded when new window is pop up and load your whatever you want to print.

How to generate

I install tailwindcss as documented in their official website and I use Vite framework.
I use npm so I call it like

npx tailwindcss -i './src/index.css' -o './public/css/tailwind.css'

I call it like

styles:[ '../css/tailwind.css' ],

I am using it in vue3 and my folder structure is like
/pubilc/css/tailwind.css (This tailwind.css is output of standalone generation mentioned above.)
/src
/dist
/node_modules

@nency-gajjar
Copy link

I am using tailwind in NUXT, name: '_blank', specs: [ 'fullscreen=yes', 'titlebar=yes', 'scrollbars=yes' ], styles: [ 'https://cdn.tailwindcss.com', ], timeout: 1000, // default timeout before the print window appears autoClose: true, // if false, the window will not close after printing } not working

Facing the same issue.

@nency-gajjar
Copy link

CDN version for tailwindcss can't be added to styles because it should be call as script as shown in official documentation of tailwindcss. My solution is generate tailwindcss with their standalone version Tailwindcss standalone version . You should output your "output.css" in public folder so that CSS can be loaded when new window is pop up and load your whatever you want to print.

How to generate

I install tailwindcss as documented in their official website and I use Vite framework. I use npm so I call it like

npx tailwindcss -i './src/index.css' -o './public/css/tailwind.css'

I call it like

styles:[ '../css/tailwind.css' ],

I am using it in vue3 and my folder structure is like /pubilc/css/tailwind.css (This tailwind.css is output of standalone generation mentioned above.) /src /dist /node_modules

Can you please explain further how to use tailwind css CDN to print with styles in Nuxt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants