I have app.css
like this:
@import 'tailwindcss';
@source '../../vendor/laravel/framework/src/Illuminate/Pagination/resources/views/*.blade.php'; @source '../../storage/framework/views/*.php'; @source '../**/*.blade.php'; @source '../**/*.js';
@import 'tailwindcss/preflight'; @tailwind utilities;
.catpc {
width: 100px; height: 125px; margin: 0 auto; object-fit: contain; background-image: url('https://res.cloudinary.com/cloudinarymen/image/upload/v1743358609/makotodecor/backgrounds/catpc_y5dnxd.png');
-webkit-animation: moveXpc 1s steps(32) infinite; -moz-animation: moveXpc 1s steps(32) infinite; -o-animation: moveXpc 1s steps(32) infinite; animation: moveXpc 1s steps(32) infinite;
}
.catmobile {
width: 50px; height: 63px; margin: 0 auto; object-fit: contain; background-image: url('https://res.cloudinary.com/cloudinarymen/image/upload/v1743358607/makotodecor/backgrounds/catmobile_jmmbjw.png');
-webkit-animation: moveXmobile 1s steps(32) infinite; -moz-animation: moveXmobile 1s steps(32) infinite; -o-animation: moveXmobile 1s steps(32) infinite; animation: moveXmobile 1s steps(32) infinite;
}
and component like this:
import React from 'react'
const Cat = () => {
return <div className="catmobile sm:catpc"></div>
}
export default Cat
- The problem is
.catmobile
and.catpc
work perfectly but.sm:catpc
don't. sm:text-xl
work also so maybe problem not insm
.
@import tailwindcss
, you don't need@import tailwindcss/preflight
. Also,@tailwind utilities
doesn't work from v4 onwards. For more details, see here: Removed@tailwind
directives and Preflight from TailwindCSS v4 and When you import tailwindcss; what injected automatically