Skip to content

Commit 40beb58

Browse files
committed
Update documentation
1 parent 8e8b227 commit 40beb58

File tree

2 files changed

+58
-36
lines changed

2 files changed

+58
-36
lines changed

CONTRIBUTING.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1+
# Contributing
2+
13
Prerequisites:
24

3-
- Node and NPM
5+
- Node 14 and Yarn 1.22
46

57
Flow:
68

79
- Fork the repository and checkout `master` branch
8-
- Run `npm install` to get or update the dependencies
9-
- Run `npm start` to build `dist/` and `docs/` directories
10-
- Change JavaScript or LESS files in `src/` directories
11-
- Do not commit changes to dist/ or docs/. These will only be built on merge.
12-
- Once finished, submit a [Pull Request](https://github.com/nostalgiaz/bootstrap-switch/compare/master...master). Remember to target `master` as destination branch
10+
- Install or update dependencies running `yarn`
11+
- Build `dist/` and `docs/` directories running `yarn start`
12+
- Change files in `src/` directory
13+
- Do *not* change any files inside `dist/` or `docs/`. These are automatically generated on merge.
14+
- Once finished, submit a [Pull Request](https://github.com/Bttstrp/bootstrap-switch/compare/master...master). Remember to target `master` as destination branch
1315

1416
Thank you.

README.md

Lines changed: 50 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,77 @@
11
# Bootstrap Switch
2+
23
[![Dependency Status](https://david-dm.org/Bttstrp/bootstrap-switch.svg?style=flat)](https://david-dm.org/Bttstrp/bootstrap-switch)
34
[![devDependency Status](https://david-dm.org/Bttstrp/bootstrap-switch/dev-status.svg?style=flat)](https://david-dm.org/Bttstrp/bootstrap-switch#info=devDependencies)
45
[![NPM Version](http://img.shields.io/npm/v/bootstrap-switch.svg?style=flat)](https://www.npmjs.org/)
56

6-
Turn checkboxes and radio buttons into toggle switches. Created by [Mattia Larentis](http://github.com/nostalgiaz), maintained by [Emanuele Marchi](http://github.com/lostcrew) and [Peter Stein](http://www.bdmdesign.org) with the help of the community.
7-
Compatible with Bootstrap 4, Bootstrap 3 and Bootstrap 2.
7+
- Turn checkboxes and radio buttons into toggle switches.
8+
- Compatible with Bootstrap versions 4, 3 and 2 (legacy).
9+
- Use with or without bundlers/build tools
10+
- Supports IE9+ and all the other modern browsers.
11+
- [Quick Demo](https://jsfiddle.net/djibe89/vL87w0j8/).
12+
13+
## Getting started
14+
15+
### Installation
16+
17+
The library is available on various package managers:
18+
19+
- npm: `npm install bootstrap-switch`
20+
- yarn: `yarn add bootstrap-switch`
21+
- Composer: `composer require components/bootstrap-switch`
22+
- Bower: `bower install bootstrap-switch`
23+
- NuGet: `PM> Install-Package Bootstrap.Switch` ([NuGet package](https://github.com/blachniet/bootstrap-switch-nuget))
824

9-
Play with [demo on my fiddle](https://jsfiddle.net/djibe89/vL87w0j8/).
25+
You can also install it manually by downloading the [latest release](https://github.com/Bttstrp/bootstrap-switch/releases/latest) or clone the repo: `git clone https://github.com/Bttstrp/bootstrap-switch.git`.
26+
27+
### Inclusion
28+
29+
#### With build tools
30+
31+
If you use a bundler (Webpack, Rollup, Parcel…) or a task runner (Gulp, Grunt…) that supports SASS (or LESS, for Boostrap 3 or 2) and the JS module syntax, include the appropriate entry point file:
32+
33+
```scss
34+
// boostrap 4
35+
@import "bootstrap-switch/src/sass/bootstrap4/bootstrap-switch.scss"
36+
// or 3
37+
@import "bootstrap-switch/src/less/bootstrap3/bootstrap-switch.less"
38+
// or 2
39+
@import "bootstrap-switch/src/less/bootstrap2/bootstrap-switch.less"
40+
```
1041

11-
## Quick start
42+
Then import the library in your JavaScript as well:
1243

13-
Several quick start options are available:
44+
```js
45+
import 'bootstrap-switch';
46+
```
1447

15-
- Download the [latest release](https://github.com/Bttstrp/bootstrap-switch/releases/latest)
16-
- Clone the repo: `git clone https://github.com/Bttstrp/bootstrap-switch.git`
17-
- Install with npm: `npm install bootstrap-switch`
18-
- Install with yarn: `yarn add bootstrap-switch`
19-
- Install with Composer: `composer require components/bootstrap-switch`
20-
- Install with Bower: `bower install bootstrap-switch`
21-
- Install with NuGet: `PM> Install-Package Bootstrap.Switch` ([NuGet package](https://github.com/blachniet/bootstrap-switch-nuget))
48+
#### Without build tools
2249

23-
Include the dependencies: jQuery, Bootstrap and Bootstrap Switch CSS + Javascript:
50+
Include the dependences (jQuery, Bootstrap) and the already compiled JavaScript and CSS files in your HTML:
2451

25-
``` html
52+
```html
53+
<!-- somewhere in <head> tag -->
2654
<link href="bootstrap.css" rel="stylesheet">
2755
<link href="bootstrap-switch.css" rel="stylesheet">
2856
<script src="jquery.js"></script>
2957
<script src="bootstrap-switch.js"></script>
3058
```
3159

32-
Add your checkbox:
60+
### Your first switch
61+
62+
Add a checkbox:
3363

3464
```html
3565
<input type="checkbox" name="my-checkbox" checked>
3666
```
3767

38-
Initialize Bootstrap Switch on it:
68+
Finally, initialize Bootstrap Switch on it:
3969

4070
```javascript
4171
$("[name='my-checkbox']").bootstrapSwitch();
4272
```
4373

44-
Enjoy.
45-
46-
## Supported browsers
47-
48-
IE9+ and all the other modern browsers.
49-
50-
## LESS
51-
52-
- For Bootstrap 2 (no longer officially supported), import `src/less/bootstrap2/bootstrap-switch.less`
53-
- For Bootstrap 3, import `src/less/bootstrap3/bootstrap-switch.less`
54-
55-
## SASS/SCSS
56-
57-
- For Bootstrap 4, import `src/sass/bootstrap4/bootstrap-switch.scss`
74+
Profit!
5875

5976
## Bugs and feature requests
6077

@@ -79,3 +96,6 @@ Please do not use the issue tracker for personal support requests: [Stack Overfl
7996

8097
Licensed under the [MIT License](https://github.com/Bttstrp/bootstrap-switch/blob/master/LICENSE).
8198

99+
## Credits
100+
101+
Created by [Mattia Larentis](http://github.com/nostalgiaz). Maintained by [Emanuele Marchi](http://github.com/lostcrew), [Martin Hradil](https://github.com/himdel). Formerly maintained by [Thomas Grainger](https://github.com/graingert) and [Peter Stein](http://www.bdmdesign.org). Forever supported by the generosity of this community.

0 commit comments

Comments
 (0)