Comments (3)
@KevinBatdorf is totally right. Just use customClass
with the desired classes:
Swal.fire({
title: 'Test modal with input',
input: 'text',
icon: 'success',
showCancelButton: true,
buttonsStyling: false,
customClass: {
popup: 'p-2 rounded-lg bg-gray-600 shadow-lg sm:p-3',
title: 'ml-3 font-medium text-white truncate',
input: 'bg-white text-center',
confirmButton: 'bg-blue-500 hover:bg-blue-400 text-white font-bold py-2 px-4 border-b-4 border-blue-700 hover:border-blue-500 rounded mx-2',
cancelButton: 'bg-gray-500 hover:bg-gray-400 text-white font-bold py-2 px-4 border-b-4 border-gray-700 hover:gray-blue-500 rounded mx-2',
}
})
Docs: https://sweetalert2.github.io/#custom-class
from sweetalert2-themes.
How would this work with Tailwind being a utility framework with no opinionated style default?
Probably better to just add your Tailwind generated class names directly, which I think can be done via customClass
in SweetAlert2?
from sweetalert2-themes.
@KevinBatdorf I won't lie I've never used themes with SweetAlert2, working on a new project which is my first time really using Tailwind CSS. and while yes there is no opinionated style, thats the important part, being able to add bg-gray-400
for example. little things like that. Maybe customClass would work. Will look into it more I just wanted to throw the idea out there incase anybody else had thoughts/ideas or already did it.
from sweetalert2-themes.
Related Issues (20)
- Dark theme doesn't work in angular HOT 2
- Dependency Dashboard
- success icon is bugged (dark mode theme) HOT 1
- [Feature Request] Nord theme.
- How to add an image with sweetalert2 working in a Next.js project?
- It doesn't have any effect in ViteJS project HOT 2
- This theming still up to date? HOT 1
- dark theme for material ui
- How to use themes HOT 2
- Bootstrap 4 Theme CSS Values alignment HOT 1
- Bootstrap 5 Theme HOT 6
- Do not use tilde ~ HOT 1
- SassError because of node_modules/ HOT 2
- Themes in NextJS doesn't work HOT 5
- Deprecation Warning
- Using themes HOT 1
- Showing a SweetAlert in fullscreen HOT 2
- Using themes
- Using themes
- Using themes HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sweetalert2-themes.