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

Cant use some Tailwind classes #2

Closed
fungayimakoni opened this issue Jun 10, 2021 · 4 comments
Closed

Cant use some Tailwind classes #2

fungayimakoni opened this issue Jun 10, 2021 · 4 comments
Assignees
Labels
good first issue Good for newcomers question Further information is requested

Comments

@fungayimakoni
Copy link

Hi, Im new to Tailwind css but I'm loving this theme its great since I was already used to underscores starter theme for all my projects. However for some reason I can't use some of the Tailwind classes. Not sure if its a me problem or theme related. Is there anything I can adjust to make all classes applicable. e.g all background image classes, w-1/3, flex-1 etc

@fungayimakoni fungayimakoni changed the title Cant use some classes Cant use some taiwind classes Jun 10, 2021
@fungayimakoni fungayimakoni changed the title Cant use some taiwind classes Cant use some Tailwind classes Jun 10, 2021
@pixeldevsio
Copy link
Owner

pixeldevsio commented Jun 10, 2021

Hey! Thanks for sending this feedback. I tested out the classes you mentioned and it seems to be working on my install. Can you post your code so I can see how you're adding it? also, can you include your tailwind.config.js so I can see if there's an issue with it?

image

@pixeldevsio pixeldevsio self-assigned this Jun 10, 2021
@pixeldevsio pixeldevsio added the question Further information is requested label Jun 10, 2021
@fungayimakoni
Copy link
Author

Hey! Thanks for sending this feedback. I tested out the classes you mentioned and it seems to be working on my install. Can you post your code so I can see how you're adding it? also, can you include your tailwind.config.js so I can see if there's an issue with it?

image

Thanks for quick response. I have managed to fix the problem. The templates failing to read the mentioned classes are in tailpress/template-parts/articles/latest-articles.php for example

Then I looked into the tailwind.config.js under purge option
purge: {
content: [
'./.php',
'./
/*.php',
'./safelist.txt'
],
},

Added an extra line with './//.php', to become
purge: {
content: [
'./
.php',
'.//.php',
'.///*.php',
'./safelist.txt'
],
},

Now its working. all the Tailwind classes referenced from these template parts are showing.
I'm not sure if what I have added is a good practice. I would appreciate appreciate your advice.

@pixeldevsio
Copy link
Owner

Ah gotcha. Yeah I didn't include nested / nested folder structures as the initial theme isn't set up that way. Good call. Wanna submit a pull request and I'll merge it in?

@pixeldevsio pixeldevsio added the good first issue Good for newcomers label Jun 10, 2021
@pixeldevsio
Copy link
Owner

pixeldevsio commented Jun 10, 2021

As @fungayimakoni referenced above, if you want to have nested folder structures in your PHP, make sure to modify the PurgeCSS structure in tailwind.config.js

content: [
'./.php',
'.//.php',
'.///*.php',
'./safelist.txt'
],
},```

@pixeldevsio pixeldevsio pinned this issue Jun 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants