|
1 | 1 | Awesome Bootstrap Checkbox
|
2 | 2 | ==========================
|
3 | 3 |
|
4 |
| -[Font Awesome][] [Bootstrap][] Checkboxes & Radios plugin. Pure CSS way to make inputs look prettier. **No Javascript!** |
| 4 | +Font Awesome Bootstrap Checkboxes & Radios plugin. Pure css way to make inputs look prettier. **No javascript**! |
5 | 5 |
|
6 |
| -**[Demo][]** |
| 6 | +**[Demo](http://flatlogic.github.io/awesome-bootstrap-checkbox/demo/)** |
7 | 7 |
|
8 | 8 | Use
|
9 | 9 | ------------
|
10 | 10 |
|
11 |
| -First just include **awesome-bootstrap-checkbox.css** somewhere in your HTML, or add the equivalent files to your [Sass](#using-sass) / [Less](#using-less) configuration. |
12 |
| -Next, everything is based on code convention. Here is checkbox markup from Bootstrap site: |
| 11 | +First just include **awesome-bootstrap-checkbox.css** somewhere in your html. Or **awesome-bootstrap-checkbox.scss** if you use sass. |
| 12 | +Next everything is based on code convention. Here is checkbox markup from Bootstrap site: |
13 | 13 |
|
14 | 14 | ````html
|
15 | 15 | <form role="form">
|
@@ -83,96 +83,39 @@ You may use `checkbox-primary`, `checkbox-danger`, `radio-info`, etc to style ch
|
83 | 83 |
|
84 | 84 | `checkbox-circle` is for rounded checkboxes.
|
85 | 85 |
|
86 |
| -Inputs without label text: |
| 86 | +`checkbox-single` and `radio-single` for inputs without label text. |
87 | 87 |
|
88 |
| -````html |
89 |
| -<div class="checkbox"> |
90 |
| - <input type="checkbox" class="styled" id="singleCheckbox1" value="option1" aria-label="Single checkbox One"> |
91 |
| - <label></label> |
92 |
| -</div> |
93 |
| -```` |
94 |
| - |
95 |
| -Using [Sass][] |
96 |
| ----------- |
97 |
| - |
98 |
| -As per example in the `demo` folder, to use Font Awesome you'll have to `@import` the following library parts: |
99 |
| - |
100 |
| -````scss |
101 |
| -@import "../bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap/variables"; |
102 |
| -@import "../bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap/mixins"; |
103 |
| - |
104 |
| -@import "../bower_components/Font-Awesome/scss/variables"; |
105 |
| - |
106 |
| -@import "../awesome-bootstrap-checkbox"; |
107 |
| -```` |
108 |
| - |
109 |
| -Adjust this to the path where your bootstrap and font-awesome files are located. |
110 |
| - |
111 |
| -Using [Less][] |
112 |
| ----------- |
113 |
| - |
114 |
| -Just like the Sass setup, you'll have to `@import` the following library parts: |
115 |
| - |
116 |
| -````less |
117 |
| -@import "../bower_components/bootstrap/less/variables"; |
118 |
| -@import "../bower_components/bootstrap/less/mixins"; |
119 |
| - |
120 |
| -@import "../awesome-bootstrap-checkbox"; |
121 |
| - |
122 |
| -@import "../bower_components/Font-Awesome/less/variables"; |
123 |
| -```` |
124 |
| - |
125 |
| -Custom icon font |
| 88 | +Glyphicons way (Opt-out Font Awesome) |
126 | 89 | ------------
|
127 | 90 |
|
128 |
| -If you want to use another icon font instead of Font Awesome, such as [Glyphicons][], override the default variables: |
129 |
| -````scss |
130 |
| -$font-family-icon: 'Glyphicons Halflings'; |
131 |
| -$check-icon: "\e013"; |
132 |
| - |
133 |
| -.checkbox label:after { |
134 |
| - padding-left: 4px; |
135 |
| - padding-top: 2px; |
136 |
| - font-size: 9px; |
137 |
| -} |
138 |
| -```` |
139 |
| - |
140 |
| -or for Less: |
141 |
| -````less |
142 |
| -@font-family-icon: 'Glyphicons Halflings'; |
143 |
| -@check-icon: "\e013"; |
144 |
| - |
145 |
| -// Same styles as the Sass example... |
146 |
| -```` |
147 |
| - |
148 |
| -Or for plain CSS, override the `.checkbox` class (and `.styled` class for Opera): |
| 91 | +If you want to use glyphicons instead of font-awesome then override `.checkbox` class: |
149 | 92 | ````css
|
150 |
| -input[type="checkbox"].styled:checked + label:after, |
151 |
| -input[type="radio"].styled:checked + label:after, |
152 | 93 | .checkbox input[type=checkbox]:checked + label:after {
|
153 | 94 | font-family: 'Glyphicons Halflings';
|
154 | 95 | content: "\e013";
|
155 | 96 | }
|
156 |
| - |
157 |
| -input[type="checkbox"].styled:checked label:after, |
158 |
| -input[type="radio"].styled:checked label:after, |
159 | 97 | .checkbox label:after {
|
160 | 98 | padding-left: 4px;
|
161 | 99 | padding-top: 2px;
|
162 | 100 | font-size: 9px;
|
163 | 101 | }
|
164 | 102 | ````
|
165 | 103 |
|
166 |
| -Credits |
167 |
| ------------- |
| 104 | +Using SASS |
| 105 | +---------- |
168 | 106 |
|
169 |
| -Based on the [Official Bootstrap Sass port][Bootstrap Sass] and the awesome [Font Awesome][]. |
| 107 | +As per example in the `demo` folder, to use these **awesome** you'll have to `@import` the following library parts: |
170 | 108 |
|
| 109 | +````scss |
| 110 | +@import "../bootstrap/scss/variables"; |
| 111 | +@import "../bootstrap/scss/mixins"; |
| 112 | + |
| 113 | +@import "../Font-Awesome/scss/variables"; |
| 114 | +```` |
| 115 | + |
| 116 | +Adjust this to the path where your bootstrap and font-awesome files are located. |
| 117 | + |
| 118 | +Credits |
| 119 | +------------ |
171 | 120 |
|
172 |
| -[Demo]: http://flatlogic.github.io/awesome-bootstrap-checkbox/demo/ |
173 |
| -[Bootstrap]: http://getbootstrap.com/ |
174 |
| -[Bootstrap Sass]: https://github.com/twbs/bootstrap-sass |
175 |
| -[Font Awesome]: https://github.com/FortAwesome/Font-Awesome |
176 |
| -[Glyphicons]: http://getbootstrap.com/components/#glyphicons |
177 |
| -[Sass]: http://sass-lang.com/ |
178 |
| -[Less]: http://lesscss.org/ |
| 121 | +Based on the [Bootstrap 4][http://getbootstrap.com/] and the awesome [Font Awesome](https://github.com/FortAwesome/Font-Awesome). |
0 commit comments