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

[v4] HTTP (remote) imports #15231

Open
mbund opened this issue Nov 28, 2024 · 1 comment
Open

[v4] HTTP (remote) imports #15231

mbund opened this issue Nov 28, 2024 · 1 comment

Comments

@mbund
Copy link

mbund commented Nov 28, 2024

What version of Tailwind CSS are you using?

v4.0.0-beta.3

What build tool (or framework if it abstracts the build tool) are you using?

Standalone CLI (from https://github.com/tailwindlabs/tailwindcss/releases)

What version of Node.js are you using?

N/A (using standalone CLI)

What browser are you using?

Firefox

What operating system are you using?

Linux

Reproduction URL

Use @import on a remote source, like @import "https://pastebin.com/raw/ctzSxFsQ";

Here is a link to a Tailwind playground with what I expect to work:
https://play.tailwindcss.com/n1z6Daungc?file=css

I expect it to remotely import a pastebin I created, which contains the following:

@theme {
  --color-avocado-100: oklch(0.99 0 0);
  --color-avocado-200: oklch(0.98 0.04 113.22);
  --color-avocado-300: oklch(0.94 0.11 115.03);
  --color-avocado-400: oklch(0.92 0.19 114.08);
  --color-avocado-500: oklch(0.84 0.18 117.33);
  --color-avocado-600: oklch(0.53 0.12 118.34);
}

Describe your issue

In Tailwind v4, the docs suggest that the built in @import resolution works with @theme and other tailwind specific directives. And it does, with local file imports. However, it is missing support for remote url imports. Currently, nothing happens when you import from an http url. The compiled output just leaves the import in (like the line @import "https://example.com/styles.css"; is in the compiled output directly, and is not fetched and inlined in). Now that the configuration file is "just" a css file, it feels like this should be possible.

I'm not sure what the desired behavior would be here. If it is intended that remote imports do not work, I think it should be documented.

I do have a use case for this, where I want a "base" theme configuration which my custom plugins to "inherit" from. It would be great to have the build and intellisense work with my base theme, without copy/pasting in the "base" into every plugin. (note that by plugin, I do not mean a tailwind plugin, but rather a plugin for my own app which can add its own markup that may include tailwind styles which need to be compiled).

@harold07douglas

This comment was marked as spam.

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

2 participants