custom screens breakpoints
i have created a custom theme and add custom breakpoints.
i followed this instruction: "https://filamentphp.com/docs/3.x/panels/themes#creating-a-custom-theme"
but for some reason the custom breakpoint is not getting applied. i did run npm run build and npm run dev.
path: resources\css\filament\app\tailwind.config.js
2 Replies
1. Ensure the Correct Config Is Being Used
Make sure that resources/css/filament/app/tailwind.config.js is actually being referenced when you build your CSS. Sometimes Tailwind defaults to the root tailwind.config.js or one specified in postcss.config.js.
If you’re using Vite, check the vite.config.js to ensure it's using the correct Tailwind config.
If you're using Laravel Mix, the correct config must be explicitly used if it's not in the root.
2. Rebuild Fully
You mentioned running npm run build and npm run dev, which is great. However, make sure you:
Delete your node_modules and public/build (if applicable).
Then re-run:
rm -rf node_modules
rm -rf public/build
npm install
npm run build
3. Confirm the CSS Output
Open your generated CSS and search for classes or media queries with your custom breakpoints:
@media (min-width: 100rem) {
/* Should exist for 3xl */
}
Add a dummy use of the custom breakpoints in one of your Blade views to prevent them from being purged:
<!-- Prevent purging -->
<div class="3xl:bg-red-500 4xl:bg-green-500 5xl:bg-blue-500 hidden"></div>
If you’re still stuck, feel free to share:
How you're loading Tailwind (e.g., Vite, Mix, etc.)
Any errors or lack of generated media queries
A snippet of the HTML where you're trying to use the breakpoint
Let’s get this fixed together.
I appreciate the help. I only came here when AI cant help me. I know when something is written with AI. I've seen similar answers.