Skip to content

Commit 1670943

Browse files
committed
update readme and compile
1 parent d2fe8b1 commit 1670943

File tree

6 files changed

+48
-24
lines changed

6 files changed

+48
-24
lines changed

README.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ You can use composer to install this package:
1818

1919
$ composer require wpbones/pure-css-switch
2020

21-
You may also to add `"wpbones/pure-css-switch": "^1.0"` in the `composer.json` file of your plugin:
21+
You may also to add `"wpbones/pure-css-switch": "~1.0"` in the `composer.json` file of your plugin:
2222

2323
```json
2424
"require": {
@@ -36,6 +36,11 @@ and run
3636
Alternatively, you can get the `src/resources/assets/less/wpbones-switch.less` and then compile it, or get directly the `src/public/css/wpbones-switch.css` files.
3737
Also, you can get pre-compiled minified version `src/public/css/wpbones-switch.min.css`.
3838

39+
## Development installation
40+
41+
Use `yarn` to install the development tools. Next, use `gulp --production` to compile the resources.
42+
43+
3944
## Enqueue for Controller
4045

4146
You can use the provider to enqueue the styles.
@@ -69,6 +74,21 @@ PureCSSSwitchProvider::css();
6974
PureCSSSwitchProvider::css();
7075
```
7176

77+
## Theme
78+
79+
Of course, you can switch theme by using `theme` property ot its fluent version.
80+
Currently, we support two theme:
81+
82+
* `flat-round` - defaul
83+
* `flat-square`
84+
85+
You should use something lokk like:
86+
87+
```php
88+
<?php echo WPKirk\PureCSSSwitch\Html\HtmlTagSwitchButton::name( 'test-switch-7' )->theme( 'flat-square' ); ?>
89+
```
90+
91+
7292
## HTML markup
7393

7494
In your view you can use the `WPKirk\PureCSSSwitch\Html\HtmlTagSwitchButton` class
@@ -99,4 +119,8 @@ In your view you can use the `WPKirk\PureCSSSwitch\Html\HtmlTagSwitchButton` cla
99119
<p>
100120
<?php echo WPKirk\PureCSSSwitch\Html\HtmlTagSwitchButton::name( 'test-switch-6' )->left_label( 'Swipe me' )->disabled( true ) ?>
101121
</p>
122+
123+
<p>
124+
<?php echo WPKirk\PureCSSSwitch\Html\HtmlTagSwitchButton::name( 'test-switch-7' )->theme( 'flat-square' ); ?>
125+
</p>
102126
```

src/public/css/wpbones-switch-square.css

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
height: 24px;
55
vertical-align: middle;
66
background-color: #aaa;
7-
-webkit-border-radius: 60px;
8-
-moz-border-radius: 60px;
9-
border-radius: 60px;
7+
-webkit-border-radius: 3px;
8+
-moz-border-radius: 3px;
9+
border-radius: 3px;
1010
-webkit-transition: background 0.4s;
1111
-moz-transition: background 0.4s;
1212
-o-transition: background 0.4s;
@@ -33,9 +33,9 @@
3333
bottom: 2px;
3434
right: 2px;
3535
background-color: #fff;
36-
-webkit-border-radius: 60px;
37-
-moz-border-radius: 60px;
38-
border-radius: 60px;
36+
-webkit-border-radius: 2px;
37+
-moz-border-radius: 2px;
38+
border-radius: 2px;
3939
-webkit-transition: background 0.4s;
4040
-moz-transition: background 0.4s;
4141
-o-transition: background 0.4s;
@@ -47,9 +47,9 @@
4747
bottom: 4px;
4848
width: 16px;
4949
background-color: #919191;
50-
-webkit-border-radius: 52px;
51-
-moz-border-radius: 52px;
52-
border-radius: 52px;
50+
-webkit-border-radius: 2px;
51+
-moz-border-radius: 2px;
52+
border-radius: 2px;
5353
-webkit-transition: margin 0.4s, background 0.4s;
5454
-moz-transition: margin 0.4s, background 0.4s;
5555
-o-transition: margin 0.4s, background 0.4s;

src/public/css/wpbones-switch-square.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.

src/public/css/wpbones-switch-theme.css

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,9 @@
122122
height: 24px;
123123
vertical-align: middle;
124124
background-color: #aaa;
125-
-webkit-border-radius: 60px;
126-
-moz-border-radius: 60px;
127-
border-radius: 60px;
125+
-webkit-border-radius: 3px;
126+
-moz-border-radius: 3px;
127+
border-radius: 3px;
128128
-webkit-transition: background 0.4s;
129129
-moz-transition: background 0.4s;
130130
-o-transition: background 0.4s;
@@ -151,9 +151,9 @@
151151
bottom: 2px;
152152
right: 2px;
153153
background-color: #fff;
154-
-webkit-border-radius: 60px;
155-
-moz-border-radius: 60px;
156-
border-radius: 60px;
154+
-webkit-border-radius: 2px;
155+
-moz-border-radius: 2px;
156+
border-radius: 2px;
157157
-webkit-transition: background 0.4s;
158158
-moz-transition: background 0.4s;
159159
-o-transition: background 0.4s;
@@ -165,9 +165,9 @@
165165
bottom: 4px;
166166
width: 16px;
167167
background-color: #919191;
168-
-webkit-border-radius: 52px;
169-
-moz-border-radius: 52px;
170-
border-radius: 52px;
168+
-webkit-border-radius: 2px;
169+
-moz-border-radius: 2px;
170+
border-radius: 2px;
171171
-webkit-transition: margin 0.4s, background 0.4s;
172172
-moz-transition: margin 0.4s, background 0.4s;
173173
-o-transition: margin 0.4s, background 0.4s;

src/public/css/wpbones-switch-theme.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.

0 commit comments

Comments
 (0)