Are this "*" mean anything like "." or ".." when we define path? I am not getting what those means. Why can't I specify the path in the usual way? I wanted to use paths like "../../XYZ" or something like that. But where is this asterisk coming from and what does it mean? Can I define the path in tailwind without using the asterisk?
If anyone can help I would be most glad. I am new to tailwind CSS so a little bit confused. Thank you.
CodePudding user response:
you can use * to match anything except slashes and hidden files, and use ** to match zero or more directories.
check this site it will help you:
https://tailwindcss.com/docs/content-configuration
CodePudding user response:
The asteriks are used for dynamic imports for if you want Tailwinds to scan for content in any folder that is under ./src/
(asuming you are using ./src/**/*.{html,js}
as content in tailwinds.config.js
file. That means if you use ./src/**/*.{html,js}
, the first two **
will look for any folder inside ./src
, including subfolders.
So, for example, file path in your configuration file will most likely look like:
./src/**/*.{html,js}
./something-else/**/*.{html,js}
And these configured paths will "translate" to something like:
./src/folder1/file.html
./src/folder1/file.js
./src/folder1/subfolder/file.js
./something-else/folder1/file.html
./something-else/folder1/file.js
etc..
Which means if you add a file with the .js
or .html
extension in the specified folder(s), Tailwinds will automatically include these files in your project.
According to the documentation, you don't want to use really broad path configurations like /**/*.{html,js}'
but rather use something like:
./components/**/*.{html,js}
See the Tailwinds content configuration documentation for more examples.