diff --git a/Gruntfile.js b/Gruntfile.js index bda18a2b..fc4987bd 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -155,14 +155,32 @@ module.exports = function (grunt) { } }, - esdoc : { - dist : { + esdoc: { + dist: { options: { source: 'src', destination: 'doc', title: pkg.name + ' v' + pkg.version } } + }, + + stylus: { + compile: { + options: { + // relativeDest: 'dist/tablefilter/style' + compress: false + }, + // files: [{ + // src: ['static/style/*/*.styl'], + // ext: '.css' + // }] + files: { + 'dist/tablefilter/style/tablefilter_.css': [ + 'static/style/*.styl' + ] + } + } } }); @@ -177,6 +195,7 @@ module.exports = function (grunt) { grunt.loadNpmTasks('grunt-webpack'); grunt.loadNpmTasks('grunt-babel'); grunt.loadNpmTasks('grunt-esdoc'); + grunt.loadNpmTasks('grunt-contrib-stylus'); grunt.registerTask('default', ['build', 'test', 'build-demos', 'esdoc']); diff --git a/package.json b/package.json index 79083fe6..1ab77e4a 100644 --- a/package.json +++ b/package.json @@ -41,6 +41,7 @@ "grunt-contrib-copy": "^0.8.0", "grunt-contrib-jshint": "^0.11.2", "grunt-contrib-qunit": "^0.7.0", + "grunt-contrib-stylus": "^0.22.0", "grunt-contrib-watch": "^0.6.1", "grunt-esdoc": "0.0.1", "grunt-string-replace": "^1.2.0", diff --git a/static/style/config.styl b/static/style/config.styl new file mode 100644 index 00000000..62f57211 --- /dev/null +++ b/static/style/config.styl @@ -0,0 +1,15 @@ +/** + * Global variables + */ + +$border-color-0 = #FFF +$border-color-1 = #CCC +$border-color-2 = #D0D0D0 +$padding = 5px + +$th-bg-color = #EBECEE +$th-padding = 5px +$th-font-color = #333 + +$filter-bg-color = #fff +$filter-border-color = #ccc \ No newline at end of file diff --git a/static/style/filter-checklist.styl b/static/style/filter-checklist.styl new file mode 100644 index 00000000..e21dcd6c --- /dev/null +++ b/static/style/filter-checklist.styl @@ -0,0 +1,47 @@ +/** + * Checklist filters default styling + */ + + @import 'config' + +// div containing checklist +.div_checklist + width 100% + height 100px + border 1px solid $filter-border-color + overflow auto + text-align left + background-color $filter-bg-color + color: #333 !important + + ul.flt_checklist + padding 0 !important + margin 0 !important + list-style none !important + + // checklist item + li.flt_checklist_item + padding 1px !important + margin 0 !important + font-size 10px !important + border-bottom 1px solid $filter-border-color !important + + :hover + background-color #335EA8 !important + color $filter-bg-color !important; + + label + display block !important; + + input + vertical-align middle !important; + margin 2px 5px 2px 1px !important; + +// disabled checklist item +.flt_checklist_item_disabled + background-color #E5E5E5 + +// selected checklist item +.flt_checklist_slc_item + background-color #335EA8 !important + color: $filter-bg-color !important diff --git a/static/style/filters.styl b/static/style/filters.styl new file mode 100644 index 00000000..abe22a31 --- /dev/null +++ b/static/style/filters.styl @@ -0,0 +1,74 @@ +/** + * Filters' default styling + */ + + @import 'config' + +// Filters row style +.fltrow + height 20px + background-color #f4f4f4 + + td + th + padding 2px !important + +// button appearance +.btnflt + font-size 11px + vertical-align middle + margin 0 2px 0 2px + padding 0 1px 0 1px + +// button appearance when displayIcons is true +.btnflt_icon + width 19px + height 19px + cursor pointer !important + border 0 !important + vertical-align middle + background transparent url(themes/btn_filter.png) center center no-repeat !important + +// input type filter +.flt + background-color $filter-bg-color + border 1px solid $filter-border-color + margin 0 + width 97% + vertical-align middle + +// select type filter +select.flt + background-color $filter-bg-color + border 1px solid $filter-border-color + margin 0 1px 1px 0 + width 99% + vertical-align middle + +// multiple select type filter +select.flt_multi + background-color $filter-bg-color + border 1px solid $filter-border-color + margin 0 1px 1px 0 + width 99% + height 100px + vertical-align middle + +// tiny input type filter +.flt_s + background-color $filter-bg-color + border 1px solid $filter-border-color + margin 0 + width 80% + vertical-align middle + +// single filter type +.single_flt + background-color $filter-bg-color + border-left 1px solid #999 + border-right 1px solid $filter-border-color + border-top 1px solid $filter-border-color + border-bottom 1px solid #999 + margin 0 + width 120px + vertical-align middle diff --git a/static/style/table.styl b/static/style/table.styl new file mode 100644 index 00000000..368e2d2e --- /dev/null +++ b/static/style/table.styl @@ -0,0 +1,28 @@ +/** + * Table's default styling + */ + + @import 'config' + +table.TF + border-spacing 0 + border-top 1px solid $border-color-2 + border-left 1px solid $border-color-2 + border-bottom 1px solid $border-color-1 + border-right 1px solid $border-color-1 + + th + margin 0 + background-color $th-bg-color + border-bottom 1px solid $border-color-2 + border-right 1px solid $border-color-2 + border-left 1px solid $border-color-0 + border-top 1px solid $border-color-0 + padding $padding + color $th-font-color + + td + margin 0 + padding $padding + border-bottom 1px solid $border-color-2 + border-right 1px solid $border-color-2