Replies: 3 comments 9 replies
-
Just want to note a workaround I resorted to using. Instead of adding custom CSS in a tailwind.config = {
plugins: [
// Loads site's CSS into Tailwind to avoid having inline <style>.
plugin.withOptions(function siteCSS(options) {
const {
css = "",
} = options;
return async function({ addBase, addComponents, addUtilities, addUserCss, theme, postcss }) {
const root = postcss.parse(await css);
root.walkAtRules("layer", rule => {
const { params, nodes } = rule;
if (params === "base") {
addBase(nodes);
rule.remove();
}
if (params === "components") {
addComponents(nodes);
rule.remove();
}
if (params === "utilities") {
addUtilities(nodes);
rule.remove();
}
});
// At this point it is safe to include all the left-over css from the
// user's css file. This is because the `@tailwind` and `@layer` directives
// will already be handled and will be removed from the css tree.
root.walkRules(rule => {
addUserCss(rule);
});
};
})({
css: fetch("/css/app.css").then(response => response.text()),
}),
],
} It mostly works (except the ones added by @import "tailwindcss/base";
@import "tailwindcss/components";
@import "tailwindcss/utilities";
@layer base {
...
} However, it'd be better if the Play CDN script handles it directly. I mean, it's probably doing something similar on the content of the |
Beta Was this translation helpful? Give feedback.
-
Initially Standalone CLI seem to work, i was rejoicing. The sadly the version 3.1.6 seems to be broken. I have posted the full details under discussion: #8852 I may be doing something wrong but the documentation was not very helpful for me to debug it. I really want to use the Standalone CLI which is great innovative solution. Appreciate any help. |
Beta Was this translation helpful? Give feedback.
-
This seemingly basic functionality is greatly needed, and as you pointed out, would be a HUGE improvement over the current tedious task of moving from CDN development to production! I too spent quite some time testing the Fingers crossed this gets implemented SOON. 🤞 In the meantime, I have been unable to get your (above) posted workaround code working. Does it still work for you? If so, am I missing something from a separate post? I can see the css file being successfully loaded in DevTools, but it still doesn't get applied. 😔 Thanks! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
In an effort of reducing the effort moving from development with Play CDN to production, it would be nice to be able to link to external CSS file instead of inline. For example,
instead of:
It would be more flexible with this:
Or at least:
At the time to switch, we just point Tailwind CLI to that CSS file.
Beta Was this translation helpful? Give feedback.
All reactions