Skip to content

Commit 7debf75

Browse files
committed
major update
add yarn add switch theme style minor fixes and improvements
1 parent 5630834 commit 7debf75

20 files changed

Lines changed: 25514 additions & 230 deletions

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ coverage.html
1717
node_modules
1818

1919
# Example build directory
20-
example/dist
20+
#example/dist
2121

2222
# Editor and other tmp files
2323
*.swp

dist/react-switch-button.css

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,14 @@
4747
-moz-box-sizing: border-box;
4848
box-sizing: border-box;
4949
}
50+
/**
51+
* React Switch Button control style.
52+
*
53+
* @author =undo= <g.fazioli@undolog.com>
54+
* @date 2016-02-17
55+
* @version 2.0.0
56+
*
57+
*/
5058
.rsbc-switch-button.rsbc-switch-button-flat-round input[type="checkbox"] + label {
5159
padding: 2px;
5260
width: 48px;
@@ -124,3 +132,88 @@
124132
margin-left: 24px;
125133
background-color: #d5d5d5;
126134
}
135+
/**
136+
* React Switch Button control style square.
137+
*
138+
* @author =undo= <g.fazioli@undolog.com>
139+
* @date 2016-12-30
140+
* @version 1.0.0
141+
*
142+
*/
143+
.rsbc-switch-button.rsbc-switch-button-flat-square input[type="checkbox"] + label {
144+
padding: 2px;
145+
width: 48px;
146+
height: 24px;
147+
vertical-align: middle;
148+
background-color: #aaa;
149+
-webkit-border-radius: 3px;
150+
-moz-border-radius: 3px;
151+
border-radius: 3px;
152+
-webkit-transition: background 0.4s;
153+
-moz-transition: background 0.4s;
154+
-o-transition: background 0.4s;
155+
transition: background 0.4s;
156+
}
157+
.rsbc-switch-button.rsbc-switch-button-flat-square.disabled input[type="checkbox"] + label {
158+
background-color: #eee;
159+
}
160+
.rsbc-switch-button.rsbc-switch-button-flat-square:hover input[type="checkbox"] + label {
161+
background-color: #579fcb;
162+
}
163+
.rsbc-switch-button.rsbc-switch-button-flat-square.disabled:hover input[type="checkbox"] + label {
164+
background-color: #eee;
165+
}
166+
.rsbc-switch-button.rsbc-switch-button-flat-square input[type="checkbox"] + label:before,
167+
.rsbc-switch-button.rsbc-switch-button-flat-square input[type="checkbox"] + label:after {
168+
display: inline-block;
169+
position: absolute;
170+
content: "";
171+
}
172+
.rsbc-switch-button.rsbc-switch-button-flat-square input[type="checkbox"] + label:before {
173+
top: 2px;
174+
left: 2px;
175+
bottom: 2px;
176+
right: 2px;
177+
background-color: #fff;
178+
-webkit-border-radius: 2px;
179+
-moz-border-radius: 2px;
180+
border-radius: 2px;
181+
-webkit-transition: background 0.4s;
182+
-moz-transition: background 0.4s;
183+
-o-transition: background 0.4s;
184+
transition: background 0.4s;
185+
}
186+
.rsbc-switch-button.rsbc-switch-button-flat-square input[type="checkbox"] + label:after {
187+
top: 4px;
188+
left: 4px;
189+
bottom: 4px;
190+
width: 16px;
191+
background-color: #919191;
192+
-webkit-border-radius: 2px;
193+
-moz-border-radius: 2px;
194+
border-radius: 2px;
195+
-webkit-transition: margin 0.4s, background 0.4s;
196+
-moz-transition: margin 0.4s, background 0.4s;
197+
-o-transition: margin 0.4s, background 0.4s;
198+
transition: margin 0.4s, background 0.4s;
199+
}
200+
.rsbc-switch-button.rsbc-switch-button-flat-square.disabled input[type="checkbox"] + label:after {
201+
background-color: #d5d5d5;
202+
}
203+
.rsbc-switch-button.rsbc-switch-button-flat-square:hover input[type="checkbox"]:checked + label {
204+
background-color: #aaa;
205+
}
206+
.rsbc-switch-button.rsbc-switch-button-flat-square input[type="checkbox"]:checked + label {
207+
background-color: #579fcb;
208+
}
209+
.rsbc-switch-button.rsbc-switch-button-flat-square.disabled input[type="checkbox"]:checked + label {
210+
background-color: #eee;
211+
}
212+
.rsbc-switch-button.rsbc-switch-button-flat-square input[type="checkbox"]:checked + label:after {
213+
margin-left: 24px;
214+
background-color: #3887b7;
215+
}
216+
.rsbc-switch-button.rsbc-switch-button-flat-square.disabled input[type="checkbox"]:checked + label:after {
217+
margin-left: 24px;
218+
background-color: #d5d5d5;
219+
}

dist/react-switch-button.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ var SwitchButton = React.createClass({
1010
displayName: 'Switch Button',
1111

1212
// Version
13-
version: '2.0.0',
13+
version: '2.1.0',
1414

1515
/**
1616
* The props types.
@@ -63,19 +63,19 @@ var SwitchButton = React.createClass({
6363
label = undefined,
6464
labelRight = undefined;
6565

66-
if (this.props.id == '' && this.props.name != '') {
66+
if (this.props.id === '' && this.props.name !== '') {
6767
id = this.props.name;
6868
}
6969

70-
if (this.props.label != '') {
70+
if (this.props.label !== '') {
7171
label = React.createElement(
7272
'label',
7373
{ htmlFor: id },
7474
this.props.label
7575
);
7676
}
7777

78-
if (this.props.labelRight != '') {
78+
if (this.props.labelRight !== '') {
7979
labelRight = React.createElement(
8080
'label',
8181
{ htmlFor: id },

dist/react-switch-button.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/react-switch-button.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)