You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What version of Tailwind CSS are you using? v3.4.3
What build tool (or framework if it abstracts the build tool) are you using? using standalone tailwindcss binary.
What version of Node.js are you using? N/A
What browser are you using? Irrelevant
What operating system are you using? Alpine Linux x86_64
Reproduction URL Dockerfile to re-produce the environment and error:
Copy the following to a Dockerfile file
FROM alpine:3.19
RUN wget -qO /usr/local/bin/tailwindcss https://github.com/tailwindlabs/tailwindcss/releases/download/v3.4.3/tailwindcss-linux-x64 && \
chmod +x /usr/local/bin/tailwindcss
WORKDIR /workdir
# Create an input.css with an import to the base components
RUN echo'@tailwind utilities;'> input.css
# Create a tailwind.config.js file with *.html as its content
RUN printf"/** @type {import('tailwindcss').Config} */\nmodule.exports = {\ncontent: [\"*.html\"]\n}\n"> tailwind.config.js
# Create a simple HTML file using a Tailwind class
RUN echo'<div class="text-2xl">Test</div>'> index.html
# FAILURE: try to generate an output.css file from a directory where the tailwind config is NOT located.# /workdir/index.html is NOT detected and output.css is empty.
WORKDIR /workdir/subdirectory
RUN tailwindcss -c /workdir/tailwind.config.js -i /workdir/input.css -o /workdir/output.css
RUN cat /workdir/output.css
# Empty line# SUCCESS: generate an output.css file from the directory where the tailwind config is located.
WORKDIR /workdir
RUN tailwindcss -c /workdir/tailwind.config.js -i /workdir/input.css -o /workdir/output.css
RUN cat /workdir/output.css
# .text-2xl {# font-size: 1.5rem;# line-height: 2rem# }
Build it with docker build . and check results from RUN cat /workdir/output.css instructions
Describe your issue: Relative paths in the content array of the configuration file tailwind.config.js are relative to your CURRENT PATH and not to where the configuration file tailwind.config.js is located. The change needed is to make relative paths from the configuration file to be relative to the configuration file and NOT from the current path where tailwindcss is invoked. Note the --content flag should stay as it is, and have relative paths relative to the current directory, so be careful not to break this behavior.
For a more detailed context, I need this fixed in order to call tailwindcss from subdirectories, from Go //go:generate tailwindcss ... commands.
Thanks!
The text was updated successfully, but these errors were encountered:
What version of Tailwind CSS are you using? v3.4.3
What build tool (or framework if it abstracts the build tool) are you using? using standalone tailwindcss binary.
What version of Node.js are you using? N/A
What browser are you using? Irrelevant
What operating system are you using? Alpine Linux x86_64
Reproduction URL Dockerfile to re-produce the environment and error:
Copy the following to a
Dockerfile
fileBuild it with
docker build .
and check results fromRUN cat /workdir/output.css
instructionsDescribe your issue: Relative paths in the
content
array of the configuration filetailwind.config.js
are relative to your CURRENT PATH and not to where the configuration filetailwind.config.js
is located. The change needed is to make relative paths from the configuration file to be relative to the configuration file and NOT from the current path wheretailwindcss
is invoked. Note the--content
flag should stay as it is, and have relative paths relative to the current directory, so be careful not to break this behavior.For a more detailed context, I need this fixed in order to call
tailwindcss
from subdirectories, from Go//go:generate tailwindcss ...
commands.Thanks!
The text was updated successfully, but these errors were encountered: