Skip to content

Commit

Permalink
Merge branch 'material'
Browse files Browse the repository at this point in the history
* material: (24 commits)
  More bower.json tweaks.
  Tweak bower.json.
  Tweak package.json.
  Fix failing tests caused by the grunt config.
  Fix all failing tests because of switch-light markup change. Add new tests for the Material theme and switch-toggle with 6 options.
  Changelog tweaks.
  Update the bootstrap docs. Tweak the line-height so the light switch works better with bootstrap classes.
  Update the Foundation docs.
  Tweaks to the README.
  Add the new material theme to the docs homepage, and some tweaks.
  component(1) is dead, so stop supporting it. componentjs/component#639
  Update changelog with the material theme details. Add more example to the docs site homepage header.
  Complete the new material design theme, with ripples and everything, all still css. Material design toggle switches will look like custom radios, still from material design.
  Make the new material design theme work with the new switch-light markup.
  Fix the ios theme to work with the new markup. Tweaks to the iOS theme to make it look a bit better.
  Nesting CSS was a bad idea. Fix the Holo theme to work with the new switch-light markup.
  Remove the nasty `switch-X` classes used with `switch-toggle` for number of items. More fixes to the `candy` theme to support the new markup.
  New markup for the `switch-light` component and begin adapting the `candy` theme for the new markup.
  Begin work on the new `material` theme.
  Use partials for the top menus and the footer credits.
  ...
  • Loading branch information
ghinda committed Nov 19, 2015
2 parents 98236e2 + 344579f commit 90eb6fc
Show file tree
Hide file tree
Showing 41 changed files with 3,797 additions and 8,821 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ npm-debug.log
node_modules
.tmp
.sass-cache
build/
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
## [4.0.0] - 2015-XX-XX

- BREAKING: New HTML markup for `switch-light`, more semantic and with more control over the label and switch widths and placement.
- BREAKING: Rename the `android` theme to `holo`.
- BREAKING: Remove the `less` version because it was unmaintained.
- `switch-toggle` no longer needs the `switch-X` number classes. Just add up to 6 items, no extra classes needed.
- New `material` theme, mimicking material design.
- Fix issues with enlarged text on `switch-toggle`.
- Various tweaks to the `ios` theme.
- Change text color of the active option in the `switch-light` `candy` theme.
- Add bold font-weights to all option labels in the `candy` theme.
- Disable text selection of the "on/off" text of the `switch-light`, to fix issues with changing the selection by swiping component on mobile.
- Change the project file structure, to make it easier to maintain/contribute/add new themes.
- Use `assemble` to build the static documentation site.

## [3.2.0] - 2015-10-08

- Switch to the MIT license, from Unlicense.
Expand Down
111 changes: 74 additions & 37 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,27 @@ var mountFolder = function (connect, dir) {
};

module.exports = function (grunt) {
// load all grunt tasks
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);

// configurable paths
var yeomanConfig = {
app: 'src',
dist: 'dist'
};

try {
yeomanConfig.app = require('./bower.json').appPath || yeomanConfig.app;
} catch (e) {}
grunt.loadNpmTasks('assemble');

grunt.initConfig({
yeoman: yeomanConfig,
watch: {
sass: {
files: [ '<%= yeoman.app %>/{,*/}*.{scss,sass}' ],
files: [ '{src,site}/{,*/}*.scss' ],
tasks: [ 'sass:server' ]
},
assemble: {
files: [ 'site/{,*/}*.{hbs,html}' ],
tasks: [ 'assemble' ]
},
livereload: {
options: {
livereload: LIVERELOAD_PORT
},
files: [
'./{,*/}*.html',
'./{,*/}*.css'
'./build/*.html',
'./build/{,*/}*.css',
'./dist/*.css'
]
}
},
Expand All @@ -46,6 +40,7 @@ module.exports = function (grunt) {
middleware: function (connect) {
return [
lrSnippet,
mountFolder(connect, './build/'),
mountFolder(connect, './')
];
}
Expand All @@ -55,34 +50,22 @@ module.exports = function (grunt) {
options: {
middleware: function (connect) {
return [
mountFolder(connect, './')
mountFolder(connect, './build/')
];
}
}
}
},
sass: {
dist: {
files: {
'<%= yeoman.dist %>/toggle-switch.css': '<%= yeoman.app %>/toggle-switch.scss',
'<%= yeoman.dist %>/toggle-switch-rem.css': '<%= yeoman.app %>/toggle-switch-rem.scss',
'<%= yeoman.dist %>/toggle-switch-px.css': '<%= yeoman.app %>/toggle-switch-px.scss',
'<%= yeoman.dist %>/docs/docs.css': '<%= yeoman.app %>/docs/docs.scss',
'<%= yeoman.dist %>/docs/foundation.css': 'bower_components/foundation/scss/foundation.scss'
}
options: {
sourceMap: true
},
server: {
options: {
includePaths: [
''
]
},
files: {
'<%= yeoman.dist %>/toggle-switch.css': '<%= yeoman.app %>/toggle-switch.scss',
'<%= yeoman.dist %>/toggle-switch-rem.css': '<%= yeoman.app %>/toggle-switch-rem.scss',
'<%= yeoman.dist %>/toggle-switch-px.css': '<%= yeoman.app %>/toggle-switch-px.scss',
'<%= yeoman.dist %>/docs/docs.css': '<%= yeoman.app %>/docs/docs.scss',
'<%= yeoman.dist %>/docs/foundation.css': 'bower_components/foundation/scss/foundation.scss'
'dist/toggle-switch.css': 'src/toggle-switch.scss',
'dist/toggle-switch-rem.css': 'src/toggle-switch-rem.scss',
'dist/toggle-switch-px.css': 'src/toggle-switch-px.scss',
'build/css/docs.css': 'site/css/docs.scss'
}
}
},
Expand Down Expand Up @@ -137,6 +120,55 @@ module.exports = function (grunt) {
]
}
}
},
assemble: {
options: {
layoutdir: 'site/layouts',
partials: 'site/partials/*.html'
},
site: {
files: [{
expand: true,
cwd: 'site',
src: '{,*/}*.hbs',
dest: 'build'
}]
}
},
clean: {
site: {
src: [
'build/',
'dist/'
]
}
},
copy: {
site: {
files: [
{
src: [
'bower_components/**',
'test/**',
'dist/**'
],
dest: 'build/'
}
]
}
},
buildcontrol: {
options: {
dir: 'build',
commit: true,
push: true
},
site: {
options: {
remote: '[email protected]:ghinda/css-toggle-switch.git',
branch: 'gh-pages'
}
}
}
});

Expand All @@ -146,20 +178,25 @@ module.exports = function (grunt) {
}

grunt.task.run([
'sass:server',
'clean',
'assemble',
'sass',
'connect:livereload',
'watch'
]);
});

grunt.registerTask('test', [
'sass:server',
'build',
'connect:dist',
'saucelabs-qunit'
]);

grunt.registerTask('build', [
'sass:dist'
'clean',
'assemble',
'sass',
'copy'
]);

grunt.registerTask('default', [
Expand Down
File renamed without changes.
12 changes: 4 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ Download from the [project page](http://ghinda.net/css-toggle-switch/).

Install with [Bower](http://bower.io/): `bower install --save css-toggle-switch`

Install with [Component](https://component.github.io/): `component install ghinda/css-toggle-switch`

Install with [npm](https://www.npmjs.com/package/css-toggle-switch): `npm install --save css-toggle-switch`


Expand Down Expand Up @@ -63,11 +61,9 @@ Then
http://localhost:9000/
```

## Acknowledgements
Don't use the `gh-pages` branch. It's used only for hosting the documentation website.


* Standalone themes are based on [Sort Switches / Toggles by Orman Clark](http://www.premiumpixels.com/freebies/sort-switches-toggles-psd/), [iOS 7](https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/UIKitUICatalog/UISwitch.html) and [Android](https://developer.android.com/design/building-blocks/switches.html).
* iOS label tap issue and fix reported by [Ben Dwyer](https://github.com/scruffian).
* Refactoring to export the CSS with multiple unit types (px, em, rem) by [Henjo Hoeksma](https://github.com/hphoeksma).
* [List of contributors on Github](https://github.com/ghinda/css-toggle-switch/graphs/contributors)
## License

CSS Toggle Switches is a project by [Ionuț Colceriu](http://ghinda.net).
CSS Toggle Switch is a project by [Ionuț Colceriu](http://ghinda.net), licensed under the [MIT license](LICENSE).
Loading

0 comments on commit 90eb6fc

Please sign in to comment.