Skip to content

Commit

Permalink
feat: Bootstrap 4 theme (#23)
Browse files Browse the repository at this point in the history
* created theme files via `npm run create-new-theme *`

* added default bs4 colors

* changed colors to theme variables (ability to override easily the colors)

* updated colors (added primary & updated secondary)

* added buttons
- override swal2 box model vars (padding, border-radius, button colors & disabled focus outline)
- added custom style to override button styles, incl :hover & :active

* added modal base style
- added bootstrap-border-color
- changed border-radius to .3rem
- changed backdrop & background-transition
- added custom css to override popup, header, title, content & footer

* enhanced buttons & inputs
- added bootstrap-gray-700 variable
- override input & close-button variables
- added custom style for actions, close & input + file & textarea (only focus)

* textarea
- updated textarea style
- changed swal2-input-padding

* enhanced toast style
- added bootstrap-gray-600 variable
- added toast custom css for base, header, title, content, actions & styled

* enhanced select style
- added str-replace function
- added all remaining gray colors
- added & renamed theme variables
- added custom css for select

* added custom radio style

* fixed linting errors

* fixed linting errors

* enhanced radio style & added checkbox style

* fixed transition & removed `.swal2-file` style

* added range style

* added validation message style & added button missing transition

* added toast style

* fixed radio dot issue

* fixed button focus and button border

* fixed focus on inputerror
  • Loading branch information
REJack authored and limonte committed Aug 9, 2019
1 parent d8c9154 commit a802ed3
Show file tree
Hide file tree
Showing 3 changed files with 743 additions and 0 deletions.
34 changes: 34 additions & 0 deletions bootstrap-4/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# @sweetalert2/theme-bootstrap-4 - Bootstrap 4 Theme for [SweetAlert2](https://github.com/sweetalert2/sweetalert2)

[![npm version](https://img.shields.io/npm/v/@sweetalert2/theme-bootstrap-4.svg)](https://www.npmjs.com/package/@sweetalert2/theme-bootstrap-4)

Installation
------------

```sh
npm install --save sweetalert2 @sweetalert2/theme-bootstrap-4
```

Usage
-----

With CSS:

```html
<!-- Include the Bootstrap 4 theme -->
<link rel="stylesheet" href="@sweetalert2/theme-bootstrap-4/bootstrap-4.css">

<script src="sweetalert2/dist/sweetalert2.min.js"></script>
```

With SASS:

`your-app.js`:
```js
import Swal from 'sweetalert2/src/sweetalert2.js'
```

`your-app.scss`:
```scss
@import '~@sweetalert2/theme-bootstrap-4/bootstrap-4.scss';
```
Loading

0 comments on commit a802ed3

Please sign in to comment.