Giter VIP home page Giter VIP logo

tailwindcss-jit-cdn's Introduction

Tailwind JIT CDN

Use the full power of Tailwind CSS' new JIT compiler by including one script tag to your HTML.

Usage:

Just include this script tag into your site:

<script src="https://unpkg.com/tailwindcss-jit-cdn"></script>

You can learn all about this package in our in-depth blog post.

Support Us

We spend a lot of time working on our free developer services or open source packages. You can support our work by buying one of our paid products.

Credits

License

The MIT License (MIT). Please see License File for more information.

tailwindcss-jit-cdn's People

Contributors

mpociot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tailwindcss-jit-cdn's Issues

Tailwind 2.2 + merge JIT with Tailwind with no direct CDN support in future?

Hello, I am little bit confused, so sorry for this issue.

Since this afternoon, my website, which uses your awesome tailwind-jit-cdn broke. I figured out that it was because Tailwind got updated and I also found out that you are planning to merge with Tailwind.

I have question, will this format of CDN "one simple script" without any tailwind files on my FTP be possible in future? Because I run on CMS and I don't really want to run node for Tailwind in my themes folder.

Sorry for taking your time, maybe it was answered elsewhere, otherwise, I am not able to run my script with new update of Tailwind anymore.

SyntaxError: No identifiers allowed directly after numeric literal in Safari

When adding the CDN and previewing my page in Safari I am seeing the following error:

SyntaxError: No identifiers allowed directly after numeric literal

This does not happen in Chrome or Firefox which leads me to think does something within the CDN need to be transpired?

Aside from that this is awesome!

image

c

It is really works in the client side..?

Hi! Thanks for this amazing script.

I am reading in your site the next:

https://beyondco.de/blog/tailwind-jit-compiler-via-cdn

"Of course all of the processing happens on the client side. No HTML is sent to a server to generate the CSS."

All is correct when the script is loaded from unpkg

<script src="https://unpkg.com/tailwindcss-jit-cdn"></script>

If I try to download the script to my localhost and work offline like:

<script src="js/tailwindcss-jit-cdn,js"></script>

next error is returned:

"Uncaught ReferenceError: tailwind is not defined at ..."

Why it is happening? You say that its works in the client side. (I need it because in my family holydays sometimes I cant connect to internet)

Thanks!

need to include tailwind css cdn ?

When I use this tool do I also need to include a Tailwind CSS cdn like
<link href="https://unpkg.com/tailwindcss@^2/dist/tailwind.min.css" rel="stylesheet"> <script src="https://unpkg.com/tailwindcss-jit-cdn"></script>

Extending theme.colors in tailwind config using default colors object and a core plugin

When I use the following config I get the expected results. Tailwind, classes containing "-secondary" use the purple palette.

<script type="tailwind-config">
  {
    theme: {
      extend: {
        colors: {
          primary: {
            "50":"#eff6ff","100":"#dbeafe","200":"#bfdbfe","300":"#93c5fd","400":"#60a5fa","500":"#3b82f6","600":"#2563eb","700":"#1d4ed8","800":"#1e40af","900":"#1e3a8a"
          },
          secondary: colors.purple
        }
      }
    }
  }
</script>

However, if I want to carry out the same extension whilst also using the Typography plugin as demonstrated in the docs, the "colors" object for the existing purple palette is not defined in that scope. e.g. "Uncaught ReferenceError: colors is not defined"

<script type="module" >
import tailwindcssTypography from 'https://cdn.skypack.dev/@tailwindcss/typography';

window.tailwindConfig = {
   plugins: [
     tailwindcssTypography,
   ],
  theme: {
    extend: {
      colors: {
        primary: {
        "50":"#eff6ff","100":"#dbeafe","200":"#bfdbfe","300":"#93c5fd","400":"#60a5fa","500":"#3b82f6","600":"#2563eb","700":"#1d4ed8","800":"#1e40af","900":"#1e3a8a"
        },
        secondary: colors.purple
      }
    }
  }
};

window.tailwindCSS.refresh();
</script>
<script type="tailwind-config">
window.tailwindConfig
</script>

One solution is to define a new variable containing the original colors from tailwind and reference this, however I wondered if there was a better way I hadn't thought of? Since the colors object is already available within the tailwind-config type script?

Thanks for all the work on this tool!

PostCSS for external stylesheets

This is a fantastic package and I'm really eager to use it!

One thing holds me back, and that's the fact that I've used @apply in external stylesheets. Do you think this is something that you can add to the library?

Thanks!

error with transform style

From today, a project that was working well yesterday, is giving me this error

"The transform class does not exist. If transform is a custom class, make sure it is defined within a @layer"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.