Skip to content

Commit 81bb8c5

Browse files
authored
feat( core ): Size and Alignment - Checkbox and radio button sizes are calculated from parent font size. Aligned to baseline of the application's font. (#19)
BREAKING CHANGE: The complete API has been changed, and this version does not compatible with v2.x refactor( core ): Complete rewritten of the library feat( animation ): Pulse feat( state ): Introducing state, to work with different checkbox states feat( scale ): Added support to make checkbox bigger feat( SVG ): Added support for svg elements,files and sprites feat( Image ): Added support for tiny images feat( Switch ): New iOS style switches with 3 variants fix( core ): z-index is calculated from 0 to 2 [ #6 , #14 ] feat( lock ): Similar to disable but looks like active [ #17 ] build( CI ): Setup Travis for auto publish from staging to master doc( readme ): Updated with examples, badges, gif preview and a logo doc( readme ): Removed bower installation guide doc( readme ): Changed CDN provider from cdnjs to jsDelivr refactor( core ): All class names starts with prefix `p-` except *pretty*and *state*
1 parent b8078b6 commit 81bb8c5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+3636
-1706
lines changed

.gitignore

+28-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,29 @@
1-
node_modules/
2-
test/
1+
# Node
2+
node_modules
3+
npm-debug.log
4+
package-lock.json
5+
.npmrc
6+
7+
# Yarn
8+
yarn-error.log
39
yarn.lock
10+
11+
# JetBrains
12+
.idea/
13+
14+
# VS Code
15+
.vscode/
16+
.history
17+
18+
# Windows
19+
Thumbs.db
20+
Desktop.ini
21+
22+
# Mac
23+
.DS_Store
24+
25+
# Temporary files
26+
coverage/
27+
docs
28+
tmp
29+
test

.stylelintrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "stylelint-config-recommended-scss"
3+
}

.travis.yml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
sudo: required
2+
dist: trusty
3+
language: node_js
4+
node_js:
5+
- node
6+
cache:
7+
yarn: true
8+
notifications:
9+
email: false
10+
before_install:
11+
- echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" > .npmrc
12+
before_script:
13+
- export DISPLAY=:99.0
14+
- sh -e /etc/init.d/xvfb start
15+
- sleep 3
16+
- git remote rm origin
17+
- git remote add origin https://${GH_TOKEN}@github.com/lokesh-coder/hug.css.git
18+
- 'if [ ${TRAVIS_PULL_REQUEST} = "false" ]; then
19+
git fetch && git checkout master;
20+
git config push.default current;
21+
fi'
22+
after_success:
23+
- 'if [ ${TRAVIS_PULL_REQUEST} = "false" ]; then
24+
npm run ci;
25+
npm run release;
26+
npm publish --access=public;
27+
npm run log;
28+
fi'
29+
30+
branches:
31+
only:
32+
- staging
33+
- /^greenkeeper/.*$/

Gulpfile.js

+82-19
Original file line numberDiff line numberDiff line change
@@ -3,47 +3,110 @@ var browserSync = require('browser-sync');
33
var sass = require('gulp-sass');
44
var rename = require('gulp-rename');
55
var autoprefixer = require('gulp-autoprefixer');
6+
var sourcemaps = require('gulp-sourcemaps');
7+
var headerComment = require('gulp-header-comment');
8+
const gulpStylelint = require('gulp-stylelint');
9+
var stylefmt = require('gulp-stylefmt');
10+
let cleanCSS = require('gulp-clean-css');
11+
var gulpSequence = require('gulp-sequence')
12+
var del = require('del');
613
var reload = browserSync.reload;
714

815
module.exports = gulp;
916

10-
gulp.task('browser-sync', function() {
17+
/* BROWSER SYNC */
18+
19+
gulp.task('browser-sync', function () {
1120
browserSync({
1221
port: 3040,
1322
server: {
1423
baseDir: "./",
1524
directory: true
16-
}
25+
},
26+
https: true
1727
});
1828
});
1929

20-
gulp.task('sass', function() {
30+
gulp.task('browser-sync-reload', function () {
31+
browserSync.reload();
32+
});
33+
34+
/* LIST SCSS */
35+
gulp.task('lint:scss', function() {
36+
return gulp
37+
.src('src/**/*.scss')
38+
.pipe(gulpStylelint({
39+
reporters: [
40+
{ formatter: 'string', console: true }
41+
]
42+
}));
43+
});
44+
45+
46+
/* COMPILE SCSS */
47+
gulp.task('compile:scss', function () {
2148
return gulp.src('src/**/*.scss')
49+
.pipe(sourcemaps.init())
2250
.pipe(sass({
2351
outputStyle: 'expanded'
2452
})
25-
.on('error', sass.logError))
53+
.on('error', sass.logError))
2654
.pipe(autoprefixer({
27-
browsers: ['> 5%','last 2 versions'],
28-
cascade: false
55+
browsers: ['> 5%', 'last 4 versions'],
56+
cascade: false
2957
}))
30-
.pipe(gulp.dest('src/'))
31-
.pipe(sass({
32-
outputStyle: 'compressed'
33-
}))
34-
.pipe(rename({
35-
suffix: '.min'
36-
}))
37-
.pipe(gulp.dest('src/'))
58+
.pipe(sourcemaps.write('./maps'))
59+
.pipe(gulp.dest('dist'))
3860
.pipe(browserSync.reload({
3961
stream: true
4062
}));
4163
});
4264

43-
gulp.task('bs-reload', function() {
44-
browserSync.reload();
65+
/* FORMAT CSS */
66+
67+
gulp.task('format:css', function () {
68+
return gulp.src('dist/*.css')
69+
.pipe(stylefmt())
70+
.pipe(gulp.dest('dist'));
71+
})
72+
73+
/* CLEAN DIST */
74+
gulp.task('clean:dist', function () {
75+
return del(['dist']);
4576
});
4677

47-
gulp.task('default', ['sass', 'browser-sync'], function() {
48-
gulp.watch("src/**/*.scss", ['sass', 'bs-reload']);
49-
});
78+
/* MINIFY CSS */
79+
gulp.task('minify:css', () => {
80+
return gulp.src('dist/*.css')
81+
.pipe(cleanCSS({ compatibility: 'ie9' }))
82+
.pipe(rename({
83+
suffix: '.min'
84+
}))
85+
.pipe(gulp.dest('dist'));
86+
});
87+
88+
/* SET HEADER */
89+
90+
gulp.task('set:header', function () {
91+
return gulp.src('dist/*.css')
92+
.pipe(headerComment(`
93+
pretty-checkbox.css
94+
95+
A pure CSS library to beautify checkbox and radio buttons.
96+
97+
Source: <%= pkg.repository.link %>
98+
Demo: <%= pkg.homepage %>
99+
100+
Copyright (c) <%= moment().format('YYYY') %> <%= _.capitalize(pkg.author) %>
101+
`))
102+
.pipe(gulp.dest('dist'))
103+
});
104+
105+
gulp.task('build', function (cb) {
106+
gulpSequence('lint:scss', 'clean:dist', 'compile:scss', 'format:css', 'minify:css', 'set:header', cb)
107+
});
108+
109+
110+
gulp.task('default', ['compile:scss', 'browser-sync'], function () {
111+
gulp.watch("src/**/*.scss", ['compile:scss', 'browser-sync-reload']);
112+
});

LICENSE

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2017 Lokesh Rajendran
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6+
7+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8+
9+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

0 commit comments

Comments
 (0)