rhys's avatar
Level 5

Moving To tailwind 2.0 TDD Application series

Hi, I have been learning new development techniques on a project that was based on one of the tutorials I completed on here. Since then I have tried updating the tailwind version which has caused issues. However when I compile now I get error's in the customer CSS classes Jeffrey used in the series.

The error (33:10) /var/www/html/resources/sass/app.scss The bg-button class does not exist, but bg-bottom does. If you're sure that bg-button exists, make sure that any @import statements are being properly processed before Tailwind CSS sees your CSS, as @apply can only be used for classes in the same CSS tree. 32 | .button {

33 | @apply bg-button no-underline rounded-lg text-sm py-2 px-2; | ^ 34 | color: white; 35 | }

Set up -

app.scss @import 'components/button'; button { @apply text-default; }

tailwind config - colours - button: 'var(--button-background-color)',

Any ideas would be hugely helpfully? I've removed the . infront of the bg-button as that what the tailwind upgrade documents state.

feature https://github.com/pandarhys/pac-master/tree/feature/20210901_upgrade_tailwind

0 likes
3 replies
rhys's avatar
Level 5

Hi Rob,

I have, I'm probably going to move everything into layered rather than external custom components.

I think the issue is deeper as the error i'm seeing is a result of mix not working. As below is the issue I got when trying the webpage.

Unable to locate Mix file: /css/app.css. (View: /var/www/html/resources/views/layouts/app.blade.php) (View: /var/www/html/resources/views/layouts/app.blade.php)

Just checking what else got changed during the tailwind upgrade that could have upset mix

rhys's avatar
Level 5

Ok, for some reason the mix-manifest.json had removed my css/app.css. Now when I run npm watch it changed it back to this { "/js/app.js": "/js/app.js?id=af4a3892b55a367ea05a" }

from { "/js/app.js": "/js/app.js" "/css/app.css": "/css/app.css" }

Please or to participate in this conversation.