diff --git a/.gitignore b/.gitignore index 138828b..2f47aa8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +.DS_Store node_modules npm-debug.log .tmp diff --git a/.scss-lint.yml b/.scss-lint.yml index ee73a66..bc7a7fe 100644 --- a/.scss-lint.yml +++ b/.scss-lint.yml @@ -1,7 +1,8 @@ scss_files: 'src/scss/**/*.scss' exclude: - - 'src/scss/utilities/normalize.scss' - - 'src/scss/utilities/helpers.scss' + - 'src/scss/cdb-utilities/normalize.scss' + - 'src/scss/cdb-utilities/reset.scss' + - 'src/scss/cdb-utilities/helpers.scss' - 'src/scss/variables/_sizes.scss' linters: BangFormat: diff --git a/Gruntfile.js b/Gruntfile.js index 1c69523..af9f633 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -7,6 +7,7 @@ module.exports = function (grunt) { clean: require('./tasks/clean'), sass: require('./tasks/sass'), cssmin: require('./tasks/cssmin'), + copy: require('./tasks/copy'), shell: require('./tasks/shell'), watch: require('./tasks/watch'), 'gh-pages': require('./tasks/gh-pages') @@ -14,22 +15,29 @@ module.exports = function (grunt) { var baseTasks = [ 'clean', + 'shell:generateFont', 'sass', 'concat', 'cssmin', + 'copy', 'shell' ]; + var generateFontTask = baseTasks.concat([ + 'shell:generateFont' + ]); + var devTasks = baseTasks.concat([ 'connect', 'watch:scss' ]); grunt.event.on('watch', function (action, filepath) { - grunt.task.run('shell'); + grunt.task.run('shell:style'); }); grunt.registerTask('dev', devTasks); + grunt.registerTask('generate-font', generateFontTask); grunt.registerTask('build', baseTasks); grunt.registerTask('default', baseTasks); grunt.registerTask('publish', ['build', 'gh-pages']); diff --git a/Gulpfile.js b/Gulpfile.js new file mode 100644 index 0000000..7b191a6 --- /dev/null +++ b/Gulpfile.js @@ -0,0 +1,29 @@ +var gulp = require('gulp'); +var iconfont = require('gulp-iconfont'); +var iconfontCss = require('gulp-iconfont-css'); + +String.prototype.toCamelCase = function() { + var str = this.replace('--', ''); + return str.replace(/^([A-Z])|\s(\w)/g, function(match, p1, p2, offset) { + if (p2) return p2.toUpperCase(); + return p1.toLowerCase(); + }); +}; + +gulp.task('default', function(){ + gulp.src(['./icon-font/svgs/*.svg']) + + .pipe(iconfontCss({ + fontName: 'cartoIcon', + path: './icon-font/template.jst.ejs', + targetPath: '../scss/cdb-icon-font.scss', + fontPath: '../../fonts/' + })) + + .pipe(iconfont({ + fontName: 'cartoIcon', + appendCodepoints: true + })) + + .pipe(gulp.dest('src/fonts/')); +}); diff --git a/Icon-Fonting.md b/Icon-Fonting.md new file mode 100644 index 0000000..fae062b --- /dev/null +++ b/Icon-Fonting.md @@ -0,0 +1,34 @@ +How to make changes in the CartoDB icon font +-------------------------------------------- + +If you want to edit, add or remove any icon in our CartoDB font, you should follow these steps: + +- Check you have [Sketch](http://bohemiancoding.com/sketch/) last version. +- Open [font.sketch](http://github.com/CartoDB/CartoAssets/blob/master/icon-font/font.sketch) file and make your changes. + +### Rules for the icons: +- Size should have at max 500px of width/height. +- Place the icon accordingly with the grid. +- Icons should be completely black. +- Group the icon if it has several parts. +- Make icons exportable to SVG. +- Name your icon (layer/group) according to the pattern `icon-font_xx_Name`, where xx is a unique integer (increase it for each new icon). + +### When you're done with changes + +- Select all the icons, and export them to `app/assets/fonts/icon-font/svgs` folder (option should be visible in the bottom corner in your Sketch app): + - ![screen shot 2015-01-16 at 11 40 36](https://cloud.githubusercontent.com/assets/978461/5774986/93dc90e8-9d74-11e4-8064-a478e55d392b.png) + - Take into account that ```svgs``` folder is ignored. +- Open your terminal app and go to the CartoDB root folder. +- Install your node dependencies: `npm install` +- Now we will generate the new icon fonts + stylesheet. Just run: `./node_modules/.bin/gulp` +- Check that your `icon-font.css.scss` and the `cartoIcon` fonts have been edited: + - ![screen shot 2015-01-16 at 11 02 53](https://cloud.githubusercontent.com/assets/978461/5775004/acf10faa-9d74-11e4-893c-790da626d894.png) + +All done! + + +### Troubleshooting + +- **Q**: "I ran `gulp` but the `icon-font.css.scss` file wasn't generated/updated!" + **A**: Make sure that the folder `icon-font/svgs` contain the `.svg` files. diff --git a/README.md b/README.md index 67619a7..201bee6 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,6 @@ > Share frontend assets between different CartoDB repositories - ### Installation As easy as: - ```npm install``` @@ -18,6 +17,10 @@ It will generate a UI documentation about the components in this repository: If you want to check the documenation, it is generated in the ```dist``` folder. +### How to add/update the icon font + +See this [instructions](https://github.com/CartoDB/CartoAssets/blob/master/Icon-Fonting.md) + ### Publish a new version in NPM In order to publish a new version of CartoAssets you need to: @@ -32,3 +35,4 @@ If you have these previous steps done: Just run this command: - ```grunt publish``` + diff --git a/icon-font/font.sketch b/icon-font/font.sketch new file mode 100644 index 0000000..ace8ed8 Binary files /dev/null and b/icon-font/font.sketch differ diff --git a/icon-font/svgs/icon-font_01_Clock.svg b/icon-font/svgs/icon-font_01_Clock.svg new file mode 100644 index 0000000..b3e741b --- /dev/null +++ b/icon-font/svgs/icon-font_01_Clock.svg @@ -0,0 +1,17 @@ + + + + icon-font_01_Clock + Created with Sketch. + + + + + + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_02_Stats.svg b/icon-font/svgs/icon-font_02_Stats.svg new file mode 100644 index 0000000..e5ad332 --- /dev/null +++ b/icon-font/svgs/icon-font_02_Stats.svg @@ -0,0 +1,16 @@ + + + + icon-font_02_Stats + Created with Sketch. + + + + + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_03_Heart--empty.svg b/icon-font/svgs/icon-font_03_Heart--empty.svg new file mode 100644 index 0000000..047bd79 --- /dev/null +++ b/icon-font/svgs/icon-font_03_Heart--empty.svg @@ -0,0 +1,12 @@ + + + + icon-font_03_Heart--empty + Created with Sketch. + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_04_Heart--fill.svg b/icon-font/svgs/icon-font_04_Heart--fill.svg new file mode 100644 index 0000000..6fa773d --- /dev/null +++ b/icon-font/svgs/icon-font_04_Heart--fill.svg @@ -0,0 +1,12 @@ + + + + icon-font_04_Heart--fill + Created with Sketch. + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_05_Alert.svg b/icon-font/svgs/icon-font_05_Alert.svg new file mode 100644 index 0000000..3adc3bf --- /dev/null +++ b/icon-font/svgs/icon-font_05_Alert.svg @@ -0,0 +1,14 @@ + + + + icon-font_05_Alert + Created with Sketch. + + + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_06_Rows.svg b/icon-font/svgs/icon-font_06_Rows.svg new file mode 100644 index 0000000..74e7b3b --- /dev/null +++ b/icon-font/svgs/icon-font_06_Rows.svg @@ -0,0 +1,12 @@ + + + + icon-font_06_Rows + Created with Sketch. + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_07_Check.svg b/icon-font/svgs/icon-font_07_Check.svg new file mode 100644 index 0000000..5435d68 --- /dev/null +++ b/icon-font/svgs/icon-font_07_Check.svg @@ -0,0 +1,14 @@ + + + + icon-font_07_Check + Created with Sketch. + + + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_08_Dribbble.svg b/icon-font/svgs/icon-font_08_Dribbble.svg new file mode 100644 index 0000000..bbc33bf --- /dev/null +++ b/icon-font/svgs/icon-font_08_Dribbble.svg @@ -0,0 +1,14 @@ + + + + icon-font_08_Dribbble + Created with Sketch. + + + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_09_Twitter.svg b/icon-font/svgs/icon-font_09_Twitter.svg new file mode 100644 index 0000000..c89e41a --- /dev/null +++ b/icon-font/svgs/icon-font_09_Twitter.svg @@ -0,0 +1,14 @@ + + + + icon-font_09_Twitter + Created with Sketch. + + + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_10_Wizard.svg b/icon-font/svgs/icon-font_10_Wizard.svg new file mode 100644 index 0000000..001fb05 --- /dev/null +++ b/icon-font/svgs/icon-font_10_Wizard.svg @@ -0,0 +1,12 @@ + + + + icon-font_10_Wizard + Created with Sketch. + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_11_Info.svg b/icon-font/svgs/icon-font_11_Info.svg new file mode 100644 index 0000000..d8b7a08 --- /dev/null +++ b/icon-font/svgs/icon-font_11_Info.svg @@ -0,0 +1,12 @@ + + + + icon-font_11_Info + Created with Sketch. + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_12_Fork.svg b/icon-font/svgs/icon-font_12_Fork.svg new file mode 100644 index 0000000..4b02f5b --- /dev/null +++ b/icon-font/svgs/icon-font_12_Fork.svg @@ -0,0 +1,12 @@ + + + + icon-font_12_Fork + Created with Sketch. + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_13_Facebook.svg b/icon-font/svgs/icon-font_13_Facebook.svg new file mode 100644 index 0000000..d4debe7 --- /dev/null +++ b/icon-font/svgs/icon-font_13_Facebook.svg @@ -0,0 +1,12 @@ + + + + icon-font_13_Facebook + Created with Sketch. + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_14_Folder.svg b/icon-font/svgs/icon-font_14_Folder.svg new file mode 100644 index 0000000..7f66c56 --- /dev/null +++ b/icon-font/svgs/icon-font_14_Folder.svg @@ -0,0 +1,12 @@ + + + + icon-font_14_Folder + Created with Sketch. + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_15_Dropbox.svg b/icon-font/svgs/icon-font_15_Dropbox.svg new file mode 100644 index 0000000..69c2f92 --- /dev/null +++ b/icon-font/svgs/icon-font_15_Dropbox.svg @@ -0,0 +1,14 @@ + + + + icon-font_15_Dropbox + Created with Sketch. + + + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_16_Cloud.svg b/icon-font/svgs/icon-font_16_Cloud.svg new file mode 100644 index 0000000..aff4589 --- /dev/null +++ b/icon-font/svgs/icon-font_16_Cloud.svg @@ -0,0 +1,12 @@ + + + + icon-font_16_Cloud + Created with Sketch. + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_17_Step.svg b/icon-font/svgs/icon-font_17_Step.svg new file mode 100644 index 0000000..46ccff7 --- /dev/null +++ b/icon-font/svgs/icon-font_17_Step.svg @@ -0,0 +1,14 @@ + + + + icon-font_17_Step + Created with Sketch. + + + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_18_AddDocument.svg b/icon-font/svgs/icon-font_18_AddDocument.svg new file mode 100644 index 0000000..da1ca6e --- /dev/null +++ b/icon-font/svgs/icon-font_18_AddDocument.svg @@ -0,0 +1,14 @@ + + + + icon-font_18_AddDocument + Created with Sketch. + + + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_21_ArrowNext.svg b/icon-font/svgs/icon-font_21_ArrowNext.svg new file mode 100644 index 0000000..9be7423 --- /dev/null +++ b/icon-font/svgs/icon-font_21_ArrowNext.svg @@ -0,0 +1,12 @@ + + + + icon-font_21_ArrowNext + Created with Sketch. + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_22_ArrowPrev.svg b/icon-font/svgs/icon-font_22_ArrowPrev.svg new file mode 100644 index 0000000..bdc04cb --- /dev/null +++ b/icon-font/svgs/icon-font_22_ArrowPrev.svg @@ -0,0 +1,12 @@ + + + + icon-font_22_ArrowPrev + Created with Sketch. + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_23_Close.svg b/icon-font/svgs/icon-font_23_Close.svg new file mode 100644 index 0000000..0d40187 --- /dev/null +++ b/icon-font/svgs/icon-font_23_Close.svg @@ -0,0 +1,12 @@ + + + + icon-font_23_Close + Created with Sketch. + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_24_CartoFante.svg b/icon-font/svgs/icon-font_24_CartoFante.svg new file mode 100644 index 0000000..7bb3094 --- /dev/null +++ b/icon-font/svgs/icon-font_24_CartoFante.svg @@ -0,0 +1,19 @@ + + + + icon-font_24_CartoFante + Created with Sketch. + + + + + + + + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_25_Lock.svg b/icon-font/svgs/icon-font_25_Lock.svg new file mode 100644 index 0000000..933f393 --- /dev/null +++ b/icon-font/svgs/icon-font_25_Lock.svg @@ -0,0 +1,12 @@ + + + + icon-font_25_Lock + Created with Sketch. + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_26_CartoDB.svg b/icon-font/svgs/icon-font_26_CartoDB.svg new file mode 100644 index 0000000..2536893 --- /dev/null +++ b/icon-font/svgs/icon-font_26_CartoDB.svg @@ -0,0 +1,22 @@ + + + + icon-font_26_CartoDB + Created with Sketch. + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_27_Lens.svg b/icon-font/svgs/icon-font_27_Lens.svg new file mode 100644 index 0000000..7e904d2 --- /dev/null +++ b/icon-font/svgs/icon-font_27_Lens.svg @@ -0,0 +1,12 @@ + + + + icon-font_27_Lens + Created with Sketch. + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_28_CloseLimits.svg b/icon-font/svgs/icon-font_28_CloseLimits.svg new file mode 100644 index 0000000..a68a682 --- /dev/null +++ b/icon-font/svgs/icon-font_28_CloseLimits.svg @@ -0,0 +1,12 @@ + + + + icon-font_28_CloseLimits + Created with Sketch. + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_29_DefaultUser.svg b/icon-font/svgs/icon-font_29_DefaultUser.svg new file mode 100644 index 0000000..7d2c9c7 --- /dev/null +++ b/icon-font/svgs/icon-font_29_DefaultUser.svg @@ -0,0 +1,12 @@ + + + + icon-font_29_DefaultUser + Created with Sketch. + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_30_Cockroach.svg b/icon-font/svgs/icon-font_30_Cockroach.svg new file mode 100644 index 0000000..f7ae287 --- /dev/null +++ b/icon-font/svgs/icon-font_30_Cockroach.svg @@ -0,0 +1,12 @@ + + + + icon-font_30_Cockroach + Created with Sketch. + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_31_Floppy.svg b/icon-font/svgs/icon-font_31_Floppy.svg new file mode 100644 index 0000000..a246b40 --- /dev/null +++ b/icon-font/svgs/icon-font_31_Floppy.svg @@ -0,0 +1,12 @@ + + + + icon-font_31_Floppy + Created with Sketch. + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_32_Trash.svg b/icon-font/svgs/icon-font_32_Trash.svg new file mode 100644 index 0000000..48340f6 --- /dev/null +++ b/icon-font/svgs/icon-font_32_Trash.svg @@ -0,0 +1,19 @@ + + + + icon-font_32_Trash + Created with Sketch. + + + + + + + + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_33_Wifi.svg b/icon-font/svgs/icon-font_33_Wifi.svg new file mode 100644 index 0000000..7f894cf --- /dev/null +++ b/icon-font/svgs/icon-font_33_Wifi.svg @@ -0,0 +1,18 @@ + + + + icon-font_33_Wifi + Created with Sketch. + + + + + + + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_34_Unlock.svg b/icon-font/svgs/icon-font_34_Unlock.svg new file mode 100644 index 0000000..c10b8a7 --- /dev/null +++ b/icon-font/svgs/icon-font_34_Unlock.svg @@ -0,0 +1,12 @@ + + + + icon-font_34_Unlock + Created with Sketch. + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_35_Unlock--withEllipsis.svg b/icon-font/svgs/icon-font_35_Unlock--withEllipsis.svg new file mode 100644 index 0000000..9341f3c --- /dev/null +++ b/icon-font/svgs/icon-font_35_Unlock--withEllipsis.svg @@ -0,0 +1,12 @@ + + + + icon-font_35_Unlock--withEllipsis + Created with Sketch. + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_36_Gift.svg b/icon-font/svgs/icon-font_36_Gift.svg new file mode 100644 index 0000000..c05647b --- /dev/null +++ b/icon-font/svgs/icon-font_36_Gift.svg @@ -0,0 +1,12 @@ + + + + icon-font_36_Gift + Created with Sketch. + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_37_People.svg b/icon-font/svgs/icon-font_37_People.svg new file mode 100644 index 0000000..39955db --- /dev/null +++ b/icon-font/svgs/icon-font_37_People.svg @@ -0,0 +1,12 @@ + + + + icon-font_37_People + Created with Sketch. + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_38_Play.svg b/icon-font/svgs/icon-font_38_Play.svg new file mode 100644 index 0000000..d68246f --- /dev/null +++ b/icon-font/svgs/icon-font_38_Play.svg @@ -0,0 +1,12 @@ + + + + icon-font_38_Play + Created with Sketch. + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_39_Add.svg b/icon-font/svgs/icon-font_39_Add.svg new file mode 100644 index 0000000..f05f2fb --- /dev/null +++ b/icon-font/svgs/icon-font_39_Add.svg @@ -0,0 +1,27 @@ + + + + icon-font_39_Add + Created with Sketch. + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_40_Map.svg b/icon-font/svgs/icon-font_40_Map.svg new file mode 100644 index 0000000..937ab4e --- /dev/null +++ b/icon-font/svgs/icon-font_40_Map.svg @@ -0,0 +1,12 @@ + + + + icon-font_40_Map + Created with Sketch. + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_41_Anchor.svg b/icon-font/svgs/icon-font_41_Anchor.svg new file mode 100644 index 0000000..7ec37fc --- /dev/null +++ b/icon-font/svgs/icon-font_41_Anchor.svg @@ -0,0 +1,12 @@ + + + + icon-font_41_Anchor + Created with Sketch. + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_42_Key.svg b/icon-font/svgs/icon-font_42_Key.svg new file mode 100644 index 0000000..a6ffcd3 --- /dev/null +++ b/icon-font/svgs/icon-font_42_Key.svg @@ -0,0 +1,12 @@ + + + + icon-font_42_Key + Created with Sketch. + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_43_Calendar.svg b/icon-font/svgs/icon-font_43_Calendar.svg new file mode 100644 index 0000000..c0f68f4 --- /dev/null +++ b/icon-font/svgs/icon-font_43_Calendar.svg @@ -0,0 +1,12 @@ + + + + icon-font_43_Calendar + Created with Sketch. + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_44_Document.svg b/icon-font/svgs/icon-font_44_Document.svg new file mode 100644 index 0000000..8044e29 --- /dev/null +++ b/icon-font/svgs/icon-font_44_Document.svg @@ -0,0 +1,14 @@ + + + + icon-font_44_Document + Created with Sketch. + + + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_45_Eye.svg b/icon-font/svgs/icon-font_45_Eye.svg new file mode 100644 index 0000000..a164f58 --- /dev/null +++ b/icon-font/svgs/icon-font_45_Eye.svg @@ -0,0 +1,12 @@ + + + + icon-font_45_Eye + Created with Sketch. + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_46_Marker.svg b/icon-font/svgs/icon-font_46_Marker.svg new file mode 100644 index 0000000..d3d4e8a --- /dev/null +++ b/icon-font/svgs/icon-font_46_Marker.svg @@ -0,0 +1,12 @@ + + + + icon-font_46_Marker + Created with Sketch. + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_47_ProgressBar.svg b/icon-font/svgs/icon-font_47_ProgressBar.svg new file mode 100644 index 0000000..d835596 --- /dev/null +++ b/icon-font/svgs/icon-font_47_ProgressBar.svg @@ -0,0 +1,19 @@ + + + + icon-font_47_ProgressBar + Created with Sketch. + + + + + + + + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_48_Book.svg b/icon-font/svgs/icon-font_48_Book.svg new file mode 100644 index 0000000..e37e587 --- /dev/null +++ b/icon-font/svgs/icon-font_48_Book.svg @@ -0,0 +1,12 @@ + + + + icon-font_48_Book + Created with Sketch. + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_49_Notes.svg b/icon-font/svgs/icon-font_49_Notes.svg new file mode 100644 index 0000000..e2fe2f0 --- /dev/null +++ b/icon-font/svgs/icon-font_49_Notes.svg @@ -0,0 +1,12 @@ + + + + icon-font_49_Notes + Created with Sketch. + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_50_Rectangles.svg b/icon-font/svgs/icon-font_50_Rectangles.svg new file mode 100644 index 0000000..2b09a5b --- /dev/null +++ b/icon-font/svgs/icon-font_50_Rectangles.svg @@ -0,0 +1,12 @@ + + + + icon-font_50_Rectangles + Created with Sketch. + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_51_Mountain.svg b/icon-font/svgs/icon-font_51_Mountain.svg new file mode 100644 index 0000000..e58cb93 --- /dev/null +++ b/icon-font/svgs/icon-font_51_Mountain.svg @@ -0,0 +1,12 @@ + + + + icon-font_51_Mountain + Created with Sketch. + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_52_Points.svg b/icon-font/svgs/icon-font_52_Points.svg new file mode 100644 index 0000000..91ce106 --- /dev/null +++ b/icon-font/svgs/icon-font_52_Points.svg @@ -0,0 +1,12 @@ + + + + icon-font_52_Points + Created with Sketch. + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_53_Snake.svg b/icon-font/svgs/icon-font_53_Snake.svg new file mode 100644 index 0000000..54c7c19 --- /dev/null +++ b/icon-font/svgs/icon-font_53_Snake.svg @@ -0,0 +1,12 @@ + + + + icon-font_53_Snake + Created with Sketch. + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_54_Boss.svg b/icon-font/svgs/icon-font_54_Boss.svg new file mode 100644 index 0000000..a6bf9b3 --- /dev/null +++ b/icon-font/svgs/icon-font_54_Boss.svg @@ -0,0 +1,18 @@ + + + + icon-font_54_Boss + Created with Sketch. + + + + + + + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_55_Rocket.svg b/icon-font/svgs/icon-font_55_Rocket.svg new file mode 100644 index 0000000..5d4abe6 --- /dev/null +++ b/icon-font/svgs/icon-font_55_Rocket.svg @@ -0,0 +1,16 @@ + + + + icon-font_55_Rocket + Created with Sketch. + + + + + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_56_Barometer.svg b/icon-font/svgs/icon-font_56_Barometer.svg new file mode 100644 index 0000000..48d14d8 --- /dev/null +++ b/icon-font/svgs/icon-font_56_Barometer.svg @@ -0,0 +1,16 @@ + + + + icon-font_56_Barometer + Created with Sketch. + + + + + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_57_Dollar.svg b/icon-font/svgs/icon-font_57_Dollar.svg new file mode 100644 index 0000000..c63544f --- /dev/null +++ b/icon-font/svgs/icon-font_57_Dollar.svg @@ -0,0 +1,15 @@ + + + + icon-font_57_Dollar + Created with Sketch. + + + + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_58_Email.svg b/icon-font/svgs/icon-font_58_Email.svg new file mode 100644 index 0000000..33bb782 --- /dev/null +++ b/icon-font/svgs/icon-font_58_Email.svg @@ -0,0 +1,15 @@ + + + + icon-font_58_Email + Created with Sketch. + + + + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_59_Label.svg b/icon-font/svgs/icon-font_59_Label.svg new file mode 100644 index 0000000..9200a4d --- /dev/null +++ b/icon-font/svgs/icon-font_59_Label.svg @@ -0,0 +1,12 @@ + + + + icon-font_59_Label + Created with Sketch. + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_60_Outside.svg b/icon-font/svgs/icon-font_60_Outside.svg new file mode 100644 index 0000000..d41eeb6 --- /dev/null +++ b/icon-font/svgs/icon-font_60_Outside.svg @@ -0,0 +1,12 @@ + + + + icon-font_60_Outside + Created with Sketch. + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_61_Jigsaw.svg b/icon-font/svgs/icon-font_61_Jigsaw.svg new file mode 100644 index 0000000..10304ed --- /dev/null +++ b/icon-font/svgs/icon-font_61_Jigsaw.svg @@ -0,0 +1,12 @@ + + + + icon-font_61_Jigsaw + Created with Sketch. + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_62_Tools.svg b/icon-font/svgs/icon-font_62_Tools.svg new file mode 100644 index 0000000..3025b12 --- /dev/null +++ b/icon-font/svgs/icon-font_62_Tools.svg @@ -0,0 +1,12 @@ + + + + icon-font_62_Tools + Created with Sketch. + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_63_Question.svg b/icon-font/svgs/icon-font_63_Question.svg new file mode 100644 index 0000000..3aa8500 --- /dev/null +++ b/icon-font/svgs/icon-font_63_Question.svg @@ -0,0 +1,12 @@ + + + + icon-font_63_Question + Created with Sketch. + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_64_LayerStack.svg b/icon-font/svgs/icon-font_64_LayerStack.svg new file mode 100644 index 0000000..ac65fc1 --- /dev/null +++ b/icon-font/svgs/icon-font_64_LayerStack.svg @@ -0,0 +1,12 @@ + + + + icon-font_64_LayerStack + Created with Sketch. + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_65_Alarm.svg b/icon-font/svgs/icon-font_65_Alarm.svg new file mode 100644 index 0000000..2ac15d4 --- /dev/null +++ b/icon-font/svgs/icon-font_65_Alarm.svg @@ -0,0 +1,18 @@ + + + + icon-font_65_Alarm + Created with Sketch. + + + + + + + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_66_CloudDownArrow.svg b/icon-font/svgs/icon-font_66_CloudDownArrow.svg new file mode 100644 index 0000000..6318b87 --- /dev/null +++ b/icon-font/svgs/icon-font_66_CloudDownArrow.svg @@ -0,0 +1,15 @@ + + + + icon-font_66_CloudDownArrow + Created with Sketch. + + + + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_67_Pencil.svg b/icon-font/svgs/icon-font_67_Pencil.svg new file mode 100644 index 0000000..281770c --- /dev/null +++ b/icon-font/svgs/icon-font_67_Pencil.svg @@ -0,0 +1,15 @@ + + + + icon-font_67_Pencil + Created with Sketch. + + + + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_68_FountainPen.svg b/icon-font/svgs/icon-font_68_FountainPen.svg new file mode 100644 index 0000000..87eb2f7 --- /dev/null +++ b/icon-font/svgs/icon-font_68_FountainPen.svg @@ -0,0 +1,17 @@ + + + + icon-font_68_FountainPen + Created with Sketch. + + + + + + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_69_EmptyDoc.svg b/icon-font/svgs/icon-font_69_EmptyDoc.svg new file mode 100644 index 0000000..0abc2c2 --- /dev/null +++ b/icon-font/svgs/icon-font_69_EmptyDoc.svg @@ -0,0 +1,14 @@ + + + + icon-font_69_EmptyDoc + Created with Sketch. + + + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_70_MergeArrow.svg b/icon-font/svgs/icon-font_70_MergeArrow.svg new file mode 100644 index 0000000..8b35a9d --- /dev/null +++ b/icon-font/svgs/icon-font_70_MergeArrow.svg @@ -0,0 +1,12 @@ + + + + icon-font_70_MergeArrow + Created with Sketch. + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_71_MergeColumns.svg b/icon-font/svgs/icon-font_71_MergeColumns.svg new file mode 100644 index 0000000..d5dd23d --- /dev/null +++ b/icon-font/svgs/icon-font_71_MergeColumns.svg @@ -0,0 +1,12 @@ + + + + icon-font_71_MergeColumns + Created with Sketch. + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_72_MergeSpatial.svg b/icon-font/svgs/icon-font_72_MergeSpatial.svg new file mode 100644 index 0000000..55ba759 --- /dev/null +++ b/icon-font/svgs/icon-font_72_MergeSpatial.svg @@ -0,0 +1,12 @@ + + + + icon-font_72_MergeSpatial + Created with Sketch. + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_73_Globe.svg b/icon-font/svgs/icon-font_73_Globe.svg new file mode 100644 index 0000000..bbdb446 --- /dev/null +++ b/icon-font/svgs/icon-font_73_Globe.svg @@ -0,0 +1,20 @@ + + + + icon-font_73_Globe + Created with Sketch. + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_74_ChevronDown.svg b/icon-font/svgs/icon-font_74_ChevronDown.svg new file mode 100644 index 0000000..8bb29fb --- /dev/null +++ b/icon-font/svgs/icon-font_74_ChevronDown.svg @@ -0,0 +1,12 @@ + + + + icon-font_74_ChevronDown + Created with Sketch. + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_75_Streets.svg b/icon-font/svgs/icon-font_75_Streets.svg new file mode 100644 index 0000000..7cb315d --- /dev/null +++ b/icon-font/svgs/icon-font_75_Streets.svg @@ -0,0 +1,12 @@ + + + + icon-font_75_Streets + Created with Sketch. + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_76_Keys.svg b/icon-font/svgs/icon-font_76_Keys.svg new file mode 100644 index 0000000..064a035 --- /dev/null +++ b/icon-font/svgs/icon-font_76_Keys.svg @@ -0,0 +1,12 @@ + + + + icon-font_76_Keys + Created with Sketch. + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_77_FacebookSquare.svg b/icon-font/svgs/icon-font_77_FacebookSquare.svg new file mode 100644 index 0000000..093165f --- /dev/null +++ b/icon-font/svgs/icon-font_77_FacebookSquare.svg @@ -0,0 +1,12 @@ + + + + icon-font_77_FacebookSquare + Created with Sketch. + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_78_Fullscreen.svg b/icon-font/svgs/icon-font_78_Fullscreen.svg new file mode 100644 index 0000000..9726480 --- /dev/null +++ b/icon-font/svgs/icon-font_78_Fullscreen.svg @@ -0,0 +1,12 @@ + + + + icon-font_78_Fullscreen + Created with Sketch. + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_79_Rarrow.svg b/icon-font/svgs/icon-font_79_Rarrow.svg new file mode 100644 index 0000000..b70ed44 --- /dev/null +++ b/icon-font/svgs/icon-font_79_Rarrow.svg @@ -0,0 +1,12 @@ + + + + icon-font_79_Rarrow + Created with Sketch. + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_80_Share.svg b/icon-font/svgs/icon-font_80_Share.svg new file mode 100644 index 0000000..6b67136 --- /dev/null +++ b/icon-font/svgs/icon-font_80_Share.svg @@ -0,0 +1,12 @@ + + + + icon-font_80_Share + Created with Sketch. + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_81_Linkedin.svg b/icon-font/svgs/icon-font_81_Linkedin.svg new file mode 100644 index 0000000..3f60381 --- /dev/null +++ b/icon-font/svgs/icon-font_81_Linkedin.svg @@ -0,0 +1,12 @@ + + + + icon-font_81_Linkedin + Created with Sketch. + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_82_CalendarBlank.svg b/icon-font/svgs/icon-font_82_CalendarBlank.svg new file mode 100644 index 0000000..74083cf --- /dev/null +++ b/icon-font/svgs/icon-font_82_CalendarBlank.svg @@ -0,0 +1,15 @@ + + + + icon-font_82_CalendarBlank + Created with Sketch. + + + + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_83_CreativeCommons.svg b/icon-font/svgs/icon-font_83_CreativeCommons.svg new file mode 100644 index 0000000..a7df97e --- /dev/null +++ b/icon-font/svgs/icon-font_83_CreativeCommons.svg @@ -0,0 +1,15 @@ + + + + icon-font_83_CreativeCommons + Created with Sketch. + + + + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_84_Bubble.svg b/icon-font/svgs/icon-font_84_Bubble.svg new file mode 100644 index 0000000..9986899 --- /dev/null +++ b/icon-font/svgs/icon-font_84_Bubble.svg @@ -0,0 +1,12 @@ + + + + icon-font_84_Bubble + Created with Sketch. + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_85_Bars.svg b/icon-font/svgs/icon-font_85_Bars.svg new file mode 100644 index 0000000..7c7aa8e --- /dev/null +++ b/icon-font/svgs/icon-font_85_Bars.svg @@ -0,0 +1,12 @@ + + + + icon-font_85_Bars + Created with Sketch. + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_86_ArrowMenu.svg b/icon-font/svgs/icon-font_86_ArrowMenu.svg new file mode 100644 index 0000000..b92b352 --- /dev/null +++ b/icon-font/svgs/icon-font_86_ArrowMenu.svg @@ -0,0 +1,15 @@ + + + + icon-font_86_ArrowMenu + Created with Sketch. + + + + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_87_TieFighter.svg b/icon-font/svgs/icon-font_87_TieFighter.svg new file mode 100644 index 0000000..c10588f --- /dev/null +++ b/icon-font/svgs/icon-font_87_TieFighter.svg @@ -0,0 +1,12 @@ + + + + icon-font_87_TieFighter + Created with Sketch. + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_88_Ray.svg b/icon-font/svgs/icon-font_88_Ray.svg new file mode 100644 index 0000000..07b1601 --- /dev/null +++ b/icon-font/svgs/icon-font_88_Ray.svg @@ -0,0 +1,12 @@ + + + + icon-font_88_Ray + Created with Sketch. + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_89_Markup.svg b/icon-font/svgs/icon-font_89_Markup.svg new file mode 100644 index 0000000..a29fe80 --- /dev/null +++ b/icon-font/svgs/icon-font_89_Markup.svg @@ -0,0 +1,12 @@ + + + + icon-font_89_Markup + Created with Sketch. + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_90_Table.svg b/icon-font/svgs/icon-font_90_Table.svg new file mode 100644 index 0000000..2b98fc4 --- /dev/null +++ b/icon-font/svgs/icon-font_90_Table.svg @@ -0,0 +1,16 @@ + + + + icon-font_90_Table + Created with Sketch. + + + + + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_91_Airlock.svg b/icon-font/svgs/icon-font_91_Airlock.svg new file mode 100644 index 0000000..59f2f68 --- /dev/null +++ b/icon-font/svgs/icon-font_91_Airlock.svg @@ -0,0 +1,12 @@ + + + + icon-font_91_Airlock + Created with Sketch. + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_92_Pin.svg b/icon-font/svgs/icon-font_92_Pin.svg new file mode 100644 index 0000000..2748462 --- /dev/null +++ b/icon-font/svgs/icon-font_92_Pin.svg @@ -0,0 +1,12 @@ + + + + icon-font_92_Pin + Created with Sketch. + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_93_Attache.svg b/icon-font/svgs/icon-font_93_Attache.svg new file mode 100644 index 0000000..0866cb8 --- /dev/null +++ b/icon-font/svgs/icon-font_93_Attache.svg @@ -0,0 +1,12 @@ + + + + icon-font_93_Attache + Created with Sketch. + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_94_Download.svg b/icon-font/svgs/icon-font_94_Download.svg new file mode 100644 index 0000000..652d25f --- /dev/null +++ b/icon-font/svgs/icon-font_94_Download.svg @@ -0,0 +1,17 @@ + + + + icon-font_94_Download + Created with Sketch. + + + + + + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_95_Group.svg b/icon-font/svgs/icon-font_95_Group.svg new file mode 100644 index 0000000..915dd03 --- /dev/null +++ b/icon-font/svgs/icon-font_95_Group.svg @@ -0,0 +1,17 @@ + + + + icon-font_95_Group + Created with Sketch. + + + + + + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_96_Dashboard.svg b/icon-font/svgs/icon-font_96_Dashboard.svg new file mode 100644 index 0000000..d0600ac --- /dev/null +++ b/icon-font/svgs/icon-font_96_Dashboard.svg @@ -0,0 +1,12 @@ + + + + icon-font_96_Dashboard + Created with Sketch. + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_97_Spinner.svg b/icon-font/svgs/icon-font_97_Spinner.svg new file mode 100644 index 0000000..0859c7e --- /dev/null +++ b/icon-font/svgs/icon-font_97_Spinner.svg @@ -0,0 +1,12 @@ + + + + icon-font_97_Spinner + Created with Sketch. + + + + + + + \ No newline at end of file diff --git a/icon-font/svgs/icon-font_98_Drop.svg b/icon-font/svgs/icon-font_98_Drop.svg new file mode 100644 index 0000000..2542d1c --- /dev/null +++ b/icon-font/svgs/icon-font_98_Drop.svg @@ -0,0 +1,14 @@ + + + + icon-font_98_Drop + Created with Sketch. + + + + + + + + + \ No newline at end of file diff --git a/icon-font/template.jst.ejs b/icon-font/template.jst.ejs new file mode 100644 index 0000000..d52b624 --- /dev/null +++ b/icon-font/template.jst.ejs @@ -0,0 +1,57 @@ +// Icon font elements +// ---------------------------------------------- + +@import "cdb-variables/sizes"; + +@font-face { + font-family: 'CartoIcon'; + src: url('../fonts/cartoIcon.eot'); + src: url('../fonts/cartoIcon.eot?#iefix') format('embedded-opentype'), + url('../fonts/cartoIcon.woff') format('woff'), + url('../fonts/cartoIcon.ttf') format('truetype'), + url('../fonts/cartoIcon.svg?ey3vsq#cartoIcon') format('svg'); + font-weight: normal; + font-style: normal; +} + +.CDB-IconFont { + display: inline-block; + font-family: 'CartoIcon'; + font-style: normal; + font-weight: normal; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + line-height: 1; +} + +.CDB-IconFont--center { + vertical-align: middle; +} +.CDB-IconFont--top { + vertical-align: top; +} +.CDB-IconFont--small { + font-size: $sFontSize-small + 1; +} + +/* SG +# Typography/Icon font +All available icons in CartoDB. + +``` +<% _.each(glyphs, function(glyph) { %> +<% var name = glyph.fileName.split("_")[2].toCamelCase(); %> +
+ +

<%= name %>

+
+<% }); %> +``` +*/ + +<% _.each(glyphs, function(glyph) { %> +<% var name = glyph.fileName.split("_")[2].toCamelCase(); %> +.CDB-IconFont--<%= name %>::before { + content: '\<%= glyph.codePoint %>'; +} +<% }); %> diff --git a/package.json b/package.json index 4e6c64b..e629759 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,17 @@ { "name": "cartoassets", "description": "Share frontend assets between different CartoDB repositories", - "version": "0.1.10", + "version": "0.1.19", "homepage": "https://github.com/cartodb/CartoAssets", "author": { - "name": "xavijam", - "email": "xavijam@gmail.com" + "name": "CartoDB", + "email": "contact@cartodb.com" }, + "contributors": [ + "Javier Álvarez ", + "Emilio García ", + "Javier Arce " + ], "repository": { "type": "git", "url": "git://github.com/cartodb/CartoAssets.git" @@ -31,9 +36,15 @@ "grunt-contrib-clean": "0.7.0", "grunt-contrib-concat": "0.5.1", "grunt-contrib-cssmin": "0.14.0", + "grunt-contrib-copy": "~0.5.0", "grunt-contrib-connect": "0.11.2", "grunt-contrib-watch": "0.6.1", "grunt-gh-pages": "1.0.0", + "gulp": "3.8.10", + "gulp-iconfont": "1.0.0", + "gulp-iconfont-css": "0.0.9", + "gulp-install": "0.2.0", + "gulp-sketch": "0.0.7", "grunt-shell": "1.1.2", "load-grunt-tasks": "*" }, diff --git a/src/fonts/cartoIcon.eot b/src/fonts/cartoIcon.eot new file mode 100644 index 0000000..887caac Binary files /dev/null and b/src/fonts/cartoIcon.eot differ diff --git a/src/fonts/cartoIcon.svg b/src/fonts/cartoIcon.svg new file mode 100644 index 0000000..47e72b1 --- /dev/null +++ b/src/fonts/cartoIcon.svg @@ -0,0 +1,300 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/fonts/cartoIcon.ttf b/src/fonts/cartoIcon.ttf new file mode 100644 index 0000000..2cfff3c Binary files /dev/null and b/src/fonts/cartoIcon.ttf differ diff --git a/src/fonts/cartoIcon.woff b/src/fonts/cartoIcon.woff new file mode 100644 index 0000000..06005bb Binary files /dev/null and b/src/fonts/cartoIcon.woff differ diff --git a/src/scss/components/colors.scss b/src/scss/cdb-components/colors.scss similarity index 98% rename from src/scss/components/colors.scss rename to src/scss/cdb-components/colors.scss index 53cdbda..1fac96d 100644 --- a/src/scss/components/colors.scss +++ b/src/scss/cdb-components/colors.scss @@ -15,7 +15,7 @@ ``` */ -@import '../variables/colors'; +@import '../cdb-variables/colors'; .box { width: 120px; diff --git a/src/scss/components/loader.scss b/src/scss/cdb-components/loader.scss similarity index 95% rename from src/scss/components/loader.scss rename to src/scss/cdb-components/loader.scss index 7f0aeba..e812aff 100644 --- a/src/scss/components/loader.scss +++ b/src/scss/cdb-components/loader.scss @@ -12,7 +12,7 @@ There is only one state 'is-visible', in order to make it visible. ``` */ -@import '../utilities/mixins'; +@import '../cdb-utilities/mixins'; .CDB-Loader { @include css3-prefix(animation, loader-progress 1000ms linear 1); diff --git a/src/scss/components/shapes.scss b/src/scss/cdb-components/shapes.scss similarity index 99% rename from src/scss/components/shapes.scss rename to src/scss/cdb-components/shapes.scss index dd89e0d..2e3fc51 100644 --- a/src/scss/components/shapes.scss +++ b/src/scss/cdb-components/shapes.scss @@ -12,7 +12,7 @@ You may resize and change the colors of the icons with the `glyph-`-classes. Ava ``` */ -@import '../utilities/mixins'; +@import '../cdb-utilities/mixins'; .CDB-Shape-dot { display: inline-block; diff --git a/src/scss/components/typography.scss b/src/scss/cdb-components/typography.scss similarity index 94% rename from src/scss/components/typography.scss rename to src/scss/cdb-components/typography.scss index 719a5c7..3d65171 100644 --- a/src/scss/components/typography.scss +++ b/src/scss/cdb-components/typography.scss @@ -2,7 +2,7 @@ // ---------------------------------------------- /* SG -# Typography/ +# Typography ```

Open Sans 26/34 Regular

@@ -11,10 +11,10 @@

Open Sans 12/16 Semibold

Open Sans 10/14 Semibold

Open Sans 10/14 Regular

-``` +``` */ -@import '../variables/sizes'; +@import '../cdb-variables/sizes'; .Text { font-family: 'Open Sans'; @@ -47,4 +47,3 @@ font-size: $sFontSize-small; line-height: $sLineHeight-small; } - diff --git a/src/scss/cdb-icon-font.scss b/src/scss/cdb-icon-font.scss new file mode 100644 index 0000000..14b5258 --- /dev/null +++ b/src/scss/cdb-icon-font.scss @@ -0,0 +1,1101 @@ +// Icon font elements +// ---------------------------------------------- + +@import "cdb-variables/sizes"; + +@font-face { + font-family: 'CartoIcon'; + src: url('../fonts/cartoIcon.eot'); + src: url('../fonts/cartoIcon.eot?#iefix') format('embedded-opentype'), + url('../fonts/cartoIcon.woff') format('woff'), + url('../fonts/cartoIcon.ttf') format('truetype'), + url('../fonts/cartoIcon.svg?ey3vsq#cartoIcon') format('svg'); + font-weight: normal; + font-style: normal; +} + +.CDB-IconFont { + display: inline-block; + font-family: 'CartoIcon'; + font-style: normal; + font-weight: normal; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + line-height: 1; +} + +.CDB-IconFont--center { + vertical-align: middle; +} +.CDB-IconFont--top { + vertical-align: top; +} +.CDB-IconFont--small { + font-size: $sFontSize-small + 1; +} + +/* SG +# Typography/Icon font +All available icons in CartoDB. + +``` + + +
+ +

clock

+
+ + +
+ +

stats

+
+ + +
+ +

heartempty

+
+ + +
+ +

heartfill

+
+ + +
+ +

alert

+
+ + +
+ +

rows

+
+ + +
+ +

check

+
+ + +
+ +

dribbble

+
+ + +
+ +

twitter

+
+ + +
+ +

wizard

+
+ + +
+ +

info

+
+ + +
+ +

fork

+
+ + +
+ +

facebook

+
+ + +
+ +

folder

+
+ + +
+ +

dropbox

+
+ + +
+ +

cloud

+
+ + +
+ +

step

+
+ + +
+ +

addDocument

+
+ + +
+ +

arrowNext

+
+ + +
+ +

arrowPrev

+
+ + +
+ +

close

+
+ + +
+ +

cartoFante

+
+ + +
+ +

lock

+
+ + +
+ +

cartoDB

+
+ + +
+ +

lens

+
+ + +
+ +

closeLimits

+
+ + +
+ +

defaultUser

+
+ + +
+ +

cockroach

+
+ + +
+ +

floppy

+
+ + +
+ +

trash

+
+ + +
+ +

wifi

+
+ + +
+ +

unlock

+
+ + +
+ +

unlockwithEllipsis

+
+ + +
+ +

gift

+
+ + +
+ +

people

+
+ + +
+ +

play

+
+ + +
+ +

add

+
+ + +
+ +

map

+
+ + +
+ +

anchor

+
+ + +
+ +

key

+
+ + +
+ +

calendar

+
+ + +
+ +

document

+
+ + +
+ +

eye

+
+ + +
+ +

marker

+
+ + +
+ +

progressBar

+
+ + +
+ +

book

+
+ + +
+ +

notes

+
+ + +
+ +

rectangles

+
+ + +
+ +

mountain

+
+ + +
+ +

points

+
+ + +
+ +

snake

+
+ + +
+ +

boss

+
+ + +
+ +

rocket

+
+ + +
+ +

barometer

+
+ + +
+ +

dollar

+
+ + +
+ +

email

+
+ + +
+ +

label

+
+ + +
+ +

outside

+
+ + +
+ +

jigsaw

+
+ + +
+ +

tools

+
+ + +
+ +

question

+
+ + +
+ +

layerStack

+
+ + +
+ +

alarm

+
+ + +
+ +

cloudDownArrow

+
+ + +
+ +

pencil

+
+ + +
+ +

fountainPen

+
+ + +
+ +

emptyDoc

+
+ + +
+ +

mergeArrow

+
+ + +
+ +

mergeColumns

+
+ + +
+ +

mergeSpatial

+
+ + +
+ +

globe

+
+ + +
+ +

chevronDown

+
+ + +
+ +

streets

+
+ + +
+ +

keys

+
+ + +
+ +

facebookSquare

+
+ + +
+ +

fullscreen

+
+ + +
+ +

rarrow

+
+ + +
+ +

share

+
+ + +
+ +

linkedin

+
+ + +
+ +

calendarBlank

+
+ + +
+ +

creativeCommons

+
+ + +
+ +

bubble

+
+ + +
+ +

bars

+
+ + +
+ +

arrowMenu

+
+ + +
+ +

tieFighter

+
+ + +
+ +

ray

+
+ + +
+ +

markup

+
+ + +
+ +

table

+
+ + +
+ +

airlock

+
+ + +
+ +

pin

+
+ + +
+ +

attache

+
+ + +
+ +

download

+
+ + +
+ +

group

+
+ + +
+ +

dashboard

+
+ + +
+ +

spinner

+
+ + +
+ +

drop

+
+ +``` +*/ + + + +.CDB-IconFont--clock::before { + content: '\E001'; +} + + +.CDB-IconFont--stats::before { + content: '\E002'; +} + + +.CDB-IconFont--heartempty::before { + content: '\E003'; +} + + +.CDB-IconFont--heartfill::before { + content: '\E004'; +} + + +.CDB-IconFont--alert::before { + content: '\E005'; +} + + +.CDB-IconFont--rows::before { + content: '\E006'; +} + + +.CDB-IconFont--check::before { + content: '\E007'; +} + + +.CDB-IconFont--dribbble::before { + content: '\E008'; +} + + +.CDB-IconFont--twitter::before { + content: '\E009'; +} + + +.CDB-IconFont--wizard::before { + content: '\E00A'; +} + + +.CDB-IconFont--info::before { + content: '\E00B'; +} + + +.CDB-IconFont--fork::before { + content: '\E00C'; +} + + +.CDB-IconFont--facebook::before { + content: '\E00D'; +} + + +.CDB-IconFont--folder::before { + content: '\E00E'; +} + + +.CDB-IconFont--dropbox::before { + content: '\E00F'; +} + + +.CDB-IconFont--cloud::before { + content: '\E010'; +} + + +.CDB-IconFont--step::before { + content: '\E011'; +} + + +.CDB-IconFont--addDocument::before { + content: '\E012'; +} + + +.CDB-IconFont--arrowNext::before { + content: '\E013'; +} + + +.CDB-IconFont--arrowPrev::before { + content: '\E014'; +} + + +.CDB-IconFont--close::before { + content: '\E015'; +} + + +.CDB-IconFont--cartoFante::before { + content: '\E016'; +} + + +.CDB-IconFont--lock::before { + content: '\E017'; +} + + +.CDB-IconFont--cartoDB::before { + content: '\E018'; +} + + +.CDB-IconFont--lens::before { + content: '\E019'; +} + + +.CDB-IconFont--closeLimits::before { + content: '\E01A'; +} + + +.CDB-IconFont--defaultUser::before { + content: '\E01B'; +} + + +.CDB-IconFont--cockroach::before { + content: '\E01C'; +} + + +.CDB-IconFont--floppy::before { + content: '\E01D'; +} + + +.CDB-IconFont--trash::before { + content: '\E01E'; +} + + +.CDB-IconFont--wifi::before { + content: '\E01F'; +} + + +.CDB-IconFont--unlock::before { + content: '\E020'; +} + + +.CDB-IconFont--unlockwithEllipsis::before { + content: '\E021'; +} + + +.CDB-IconFont--gift::before { + content: '\E022'; +} + + +.CDB-IconFont--people::before { + content: '\E023'; +} + + +.CDB-IconFont--play::before { + content: '\E024'; +} + + +.CDB-IconFont--add::before { + content: '\E025'; +} + + +.CDB-IconFont--map::before { + content: '\E026'; +} + + +.CDB-IconFont--anchor::before { + content: '\E027'; +} + + +.CDB-IconFont--key::before { + content: '\E028'; +} + + +.CDB-IconFont--calendar::before { + content: '\E029'; +} + + +.CDB-IconFont--document::before { + content: '\E02A'; +} + + +.CDB-IconFont--eye::before { + content: '\E02B'; +} + + +.CDB-IconFont--marker::before { + content: '\E02C'; +} + + +.CDB-IconFont--progressBar::before { + content: '\E02D'; +} + + +.CDB-IconFont--book::before { + content: '\E02E'; +} + + +.CDB-IconFont--notes::before { + content: '\E02F'; +} + + +.CDB-IconFont--rectangles::before { + content: '\E030'; +} + + +.CDB-IconFont--mountain::before { + content: '\E031'; +} + + +.CDB-IconFont--points::before { + content: '\E032'; +} + + +.CDB-IconFont--snake::before { + content: '\E033'; +} + + +.CDB-IconFont--boss::before { + content: '\E034'; +} + + +.CDB-IconFont--rocket::before { + content: '\E035'; +} + + +.CDB-IconFont--barometer::before { + content: '\E036'; +} + + +.CDB-IconFont--dollar::before { + content: '\E037'; +} + + +.CDB-IconFont--email::before { + content: '\E038'; +} + + +.CDB-IconFont--label::before { + content: '\E039'; +} + + +.CDB-IconFont--outside::before { + content: '\E03A'; +} + + +.CDB-IconFont--jigsaw::before { + content: '\E03B'; +} + + +.CDB-IconFont--tools::before { + content: '\E03C'; +} + + +.CDB-IconFont--question::before { + content: '\E03D'; +} + + +.CDB-IconFont--layerStack::before { + content: '\E03E'; +} + + +.CDB-IconFont--alarm::before { + content: '\E03F'; +} + + +.CDB-IconFont--cloudDownArrow::before { + content: '\E040'; +} + + +.CDB-IconFont--pencil::before { + content: '\E041'; +} + + +.CDB-IconFont--fountainPen::before { + content: '\E042'; +} + + +.CDB-IconFont--emptyDoc::before { + content: '\E043'; +} + + +.CDB-IconFont--mergeArrow::before { + content: '\E044'; +} + + +.CDB-IconFont--mergeColumns::before { + content: '\E045'; +} + + +.CDB-IconFont--mergeSpatial::before { + content: '\E046'; +} + + +.CDB-IconFont--globe::before { + content: '\E047'; +} + + +.CDB-IconFont--chevronDown::before { + content: '\E048'; +} + + +.CDB-IconFont--streets::before { + content: '\E049'; +} + + +.CDB-IconFont--keys::before { + content: '\E04A'; +} + + +.CDB-IconFont--facebookSquare::before { + content: '\E04B'; +} + + +.CDB-IconFont--fullscreen::before { + content: '\E04C'; +} + + +.CDB-IconFont--rarrow::before { + content: '\E04D'; +} + + +.CDB-IconFont--share::before { + content: '\E04E'; +} + + +.CDB-IconFont--linkedin::before { + content: '\E04F'; +} + + +.CDB-IconFont--calendarBlank::before { + content: '\E050'; +} + + +.CDB-IconFont--creativeCommons::before { + content: '\E051'; +} + + +.CDB-IconFont--bubble::before { + content: '\E052'; +} + + +.CDB-IconFont--bars::before { + content: '\E053'; +} + + +.CDB-IconFont--arrowMenu::before { + content: '\E054'; +} + + +.CDB-IconFont--tieFighter::before { + content: '\E055'; +} + + +.CDB-IconFont--ray::before { + content: '\E056'; +} + + +.CDB-IconFont--markup::before { + content: '\E057'; +} + + +.CDB-IconFont--table::before { + content: '\E058'; +} + + +.CDB-IconFont--airlock::before { + content: '\E059'; +} + + +.CDB-IconFont--pin::before { + content: '\E05A'; +} + + +.CDB-IconFont--attache::before { + content: '\E05B'; +} + + +.CDB-IconFont--download::before { + content: '\E05C'; +} + + +.CDB-IconFont--group::before { + content: '\E05D'; +} + + +.CDB-IconFont--dashboard::before { + content: '\E05E'; +} + + +.CDB-IconFont--spinner::before { + content: '\E05F'; +} + + +.CDB-IconFont--drop::before { + content: '\E060'; +} diff --git a/src/scss/utilities/_mixins.scss b/src/scss/cdb-utilities/_mixins.scss similarity index 100% rename from src/scss/utilities/_mixins.scss rename to src/scss/cdb-utilities/_mixins.scss diff --git a/src/scss/utilities/fonts.scss b/src/scss/cdb-utilities/fonts.scss similarity index 100% rename from src/scss/utilities/fonts.scss rename to src/scss/cdb-utilities/fonts.scss diff --git a/src/scss/utilities/helpers.scss b/src/scss/cdb-utilities/helpers.scss similarity index 100% rename from src/scss/utilities/helpers.scss rename to src/scss/cdb-utilities/helpers.scss diff --git a/src/scss/utilities/normalize.scss b/src/scss/cdb-utilities/normalize.scss similarity index 100% rename from src/scss/utilities/normalize.scss rename to src/scss/cdb-utilities/normalize.scss diff --git a/src/scss/variables/_colors.scss b/src/scss/cdb-variables/_colors.scss similarity index 100% rename from src/scss/variables/_colors.scss rename to src/scss/cdb-variables/_colors.scss diff --git a/src/scss/variables/_sizes.scss b/src/scss/cdb-variables/_sizes.scss similarity index 100% rename from src/scss/variables/_sizes.scss rename to src/scss/cdb-variables/_sizes.scss diff --git a/src/scss/utilities/reset.scss b/src/scss/utilities/reset.scss new file mode 100644 index 0000000..0c9b86d --- /dev/null +++ b/src/scss/utilities/reset.scss @@ -0,0 +1,60 @@ +/* http://meyerweb.com/eric/tools/css/reset/ + v2.0 | 20110126 + License: none (public domain) +*/ + +html, body, div, span, applet, object, iframe, +h1, h2, h3, h4, h5, h6, p, blockquote, pre, +a, abbr, acronym, address, big, cite, code, +del, dfn, em, img, ins, kbd, q, s, samp, +small, strike, strong, sub, sup, tt, var, +b, u, i, center, +dl, dt, dd, ol, ul, li, +fieldset, form, label, legend, +table, caption, tbody, tfoot, thead, tr, th, td, +article, aside, canvas, details, embed, +figure, figcaption, footer, header, hgroup, +menu, nav, output, ruby, section, summary, +time, mark, audio, video { + margin: 0; + padding: 0; + border: 0; + font-size: 100%; + font: inherit; + vertical-align: baseline; +} +/* HTML5 display-role reset for older browsers */ +article, aside, details, figcaption, figure, +footer, header, hgroup, menu, nav, section { + display: block; +} +body { + line-height: 1; +} +ol, ul { + list-style: none; +} +blockquote, q { + quotes: none; +} +blockquote:before, blockquote:after, +q:before, q:after { + content: ''; + content: none; +} +table { + border-collapse: collapse; + border-spacing: 0; +} +// Resetting buttons too +button { + margin: 0; + padding: 0; + border: none; + background: transparent; + box-sizing: border-box; + outline: none; +} +dd, dt { + display: inline-block; +} diff --git a/styleguide/_template.html b/styleguide/_template.html index 2576881..f892cf2 100644 --- a/styleguide/_template.html +++ b/styleguide/_template.html @@ -1,5 +1,5 @@ - + {{> theme}} @@ -9,46 +9,53 @@
+
+
+

Basics

+

Important notes about this styleguide

+
+
+

This is a preliminar WIP of the new dashboard stylesheet, based on the naming conventions of suitcss and Medium’s CSS is actually pretty good.

+ +

General rules

+ +
    +
  • All new elements added in this repository should have included a 'CDB-' namespace.
  • +
  • + Don't create default styles for common elements (e.g. input { padding: 10px 0 }). It will make more difficult edit styles for the future custom elements and the !important use will grow.
  • +
  • + Avoid creating new classes with only one attribute (e.g. .marginRight { margin-right: 10px } ). It is impossible to manage the amount of cases we would like to cover.
  • +
+ +
+ +

Table of contents

+ + + +
+ +

+ Components

+ +

Syntax: <ComponentName>[--modifierName|-descendentName]

+ +

+ ComponentName

+ +

The component's name must be written in camel case.

+ +
.MyComponent { /* … */ }
+ +
<article class="MyComponent">
+  …
+</article>
+ +

+ ComponentName--modifierName

+ +

A component modifier is a class that modifies the presentation of the base component in some form.

+ +
    +
  1. Modifier names must be written in camel case and be separated from the component name by two hyphens.
  2. +
  3. + The class should be included in the HTML in addition to the base component class.
  4. +
+ +
/* Core button */
+.Btn { /* … */ }
+
+/* Default button style */
+.Btn--default { /* … */ }
+ +
<article class="Btn Btn--default">
+  …
+</article>
+ +

+ ComponentName-descendentName

+ +
    +
  1. A component descendent is a class that is attached to a descendent node of a component.
  2. +
  3. It's responsible for applying presentation directly to the descendent on behalf of a particular component.
  4. +
  5. + Descendent names must be written in camel case.
  6. +
+ +
<article class="Tweet">
+  <header class="Tweet-header">
+    <img class="Tweet-avatar" src="{{src}}" alt="{{alt}}">
+    …
+  </header>
+  <div class="Tweet-bodyText">
+    …
+  </div>
+</article>
+ +

+ ComponentName.is-stateOfComponent

+ +

Use is-stateName to reflect changes to a component's state.

+ +
    +
  1. The state name must be camel case.
  2. +
  3. + Never style these classes directly: they should always be used as an adjoining class.
  4. +
+ +

This means that the same state names can be used in multiple contexts, but every component must define its own styles for the state (as they are scoped to the component).

+ +

Right:

+ +
.Tweet { /* … */ }
+.Tweet.is-expanded { /* … */ }
+
+<article class="Tweet is-expanded">
+  …
+</article>
+ +

Wrong:

+ +
.Tweet { /* … */ }
+.Tweet.expanded { /* … */ }
+ +
<article class="Tweet expanded">
+  …
+</article>
+ +

We should always rely on the same terminology to express state of a component: i.e.: a common term for is-active, is-expanded, is-selected, is-highlighted, ...

+ +

+ JavaScript

+ +

Syntax: js-<targetName>

+ +

JavaScript-specific classes reduce the risk that changing the structure or theme of components will inadvertently affect any required JavaScript behaviour and complex functionality. It is not neccesarry to use them in every case, just think of them as a tool in your utility belt. If you are creating a class, which you dont intend to use for styling, but instead only as a selector in JavaScript, you should probably be adding the js- prefix. In practice this looks like this:

+ +
<a href="/login" class="Btn Btn-primary js-login"></a>
+ +

JavaScript-specific classes should not, under any circumstances, be styled.

+ +
+ +

+ A word on (Pre)compilers

+ +

Since we use Rails as a backend, we make use of Sprockets to make all the dirty work with stylesheets (and javascripts). Many of the stylesheets are constructed by simply writing require_directorythis is awesome, but it also kind of sucks.

+ +

Preferably we should use @import instead of require when possible. + http://pivotallabs.com/structure-your-sass-files-with-import/

+ +

When using require we should list the required files in the order they must be applied, as an added control to avoid undesired behaviours.

+ +

Bad:

+ +
/*
+*= require dashboard/header
+*= require dashboard/table
+*/
+
+ +

Worse:

+ +
/*
+*= require_tree dashboard
+*/
+
+ +

Good:

+ +
@import "dashboard/header";
+@import "dashboard/tables";
+
+ +

Better:

+ +
@import
+"dashboard/header",
+"dashboard/tables";
+
+ +
+ +

+ Structure sample

+ +

+.Btn {}
+
+  .Btn--m {}
+
+  .Btn--highlight {}
+
+  .Btn--green {}
+
+  .Btn.is-active {}
+
+.Menu {}
+
+  .Menu-item {}
+
+  .Menu-link {}
+
+.Header {}
+
+  .Navbar {}
+
+    .Navbar-header {}
+
+      .Navbar-brand {}
+
+      .Navbar-searchField {}
+
+      .Navbar-searchButton {}
+
+    .Navbar-menu {}
+
+      .Navbar-menuItem {}
+
+      .Navbar-menuLink {}
+
+.Dashboard {}
+
+  .Dashboard-header {}
+
+    .Dashboard-avatar {}
+
+    .Dashboard-title {}
+
+    .Dashboard-menu {}
+
+  .Dashboard-subHeader {}
+
+    .Dashboard-subMenu {}
+
+      .Dashboard-subMenuItem {}
+
+      .Dashboard-subMenuLink {}
+
+
+.Block {}
+
+  .Block-thumbnail {}
+
+  .Block-title {}
+
+  .Block-description {}
+
+  .Block-tags {}
+
+  .Block-status {}
+
+  .Block-footer {}
+
+ +
+ +

+ Colors

+ +

+ colors.scss

+ +

Syntax: $c<colorName>

+ +

+ Sample

+ +
// Colors
+// --------------------------------------------------
+// Paragraphs
+$cTypography-headers:           rgba(#333, 1);
+$cTypography-paragraphs:        rgba(#666, 1);
+$cTypography-secondary:         rgba(#999, 1);
+$cTypography-help:              rgba(#CCC, 1);
+$cTypography-headersOverBlack:  rgba(#FFF, 1);
+$cTypography-link:              rgba(#0090D7, 1);
+$cTypography-linkHover:         rgba(#62B4E3, 1);
+$cTypography-linkSelected:      rgba(#333, 1);
+
+// Structure
+$cStructure-mainBkg:  rgba(#FFF, 1);
+$cStructure-mainLine: rgba(#DDD, 1);
+$cStructure-grayBkg:  rgba(#F9F9F9, 1);
+$cStructure-softLine: rgba(#EEE, 1);
+
+// Highlight
+$cHighlight-main:     rgba(#0090D7, 1);
+$cHighlight-positive: rgba(#8FB83F, 1);
+$cHighlight-negative: rgba(#C74B43, 1);
+$cHighlight-alert:    rgba(#C67B44, 1);
+ +

Don't use named colors, try to use meaningful names.

+ +
+ +

+ Z-Index

+ +

+ z-index.scss

+ +
// Z-Index Scale (private vars)
+// --------------------------------------------------
+@zIndex-1:   100;
+@zIndex-2:   200;
+@zIndex-3:   300;
+@zIndex-4:   400;
+@zIndex-5:   500;
+@zIndex-6:   600;
+@zIndex-7:   700;
+@zIndex-8:   800;
+@zIndex-9:   900;
+@zIndex-10: 1000;
+ +

+ z-index file use

+ +
// Z-Index Applications
+// --------------------------------------------------
+@zIndex-1--screenForeground:        @zIndex-1;
+@zIndex-1--followUpVisibility:      @zIndex-1;
+@zIndex-1--prlWelcome:              @zIndex-1;
+@zIndex-1--appImageDropdown:        @zIndex-1;
+@zIndex-1--surfaceUnder:            @zIndex-1;
+@zIndex-1--blockGroup:              @zIndex-1;
+
+(…)
+
+@zIndex-9--zoomOverlayTarget:       @zIndex-9;
+@zIndex-9--navOverlayTouch:         @zIndex-9;
+@zIndex-9--overlay:                 @zIndex-9;
+@zIndex-9--dialog:                  @zIndex-9;
+@zIndex-9--tooltip:                 @zIndex-9;
+
+ +
+ +

+ Formatting

+ +

From: https://gist.github.com/fat/a47b882eb5f84293c4ed

+ +

The following are some high level page formatting style rules.

+ +

+ +

+ Property: value

+ +

There should be a blank space between a property and a value:

+ +

Right:

+ +
.content-edit { background: red }
+ +

Wrong:

+ +
.content-edit {background:red}
+ +

If you have to define an only one property, leave blank spaces between brackets.

+ +

+ +

+ Spacing

+ +

CSS rules should be comma seperated but live on new lines:

+ +

Right:

+ +
.content,
+.content-edit {
+  …
+}
+ +

Wrong:

+ +
.content, .content-edit {
+  …
+}
+ +

CSS blocks should be seperated by a single new line. not two. not 0.

+ +

Right:

+ +
.content {
+  …
+}
+.content-edit {
+  …
+}
+ +

Wrong:

+ +
.content {
+  …
+}
+
+.content-edit {
+  …
+}
+ +
+ +

+ Quotes

+ +

Quotes are optional in CSS and LESS. We use double quotes as it is visually clearer that the string is not a selector or a style property.

+ +

Right:

+ +
background-image: url("/img/you.jpg");
+font-family: "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial;
+ +

Wrong:

+ +
background-image: url(/img/you.jpg);
+font-family: Helvetica Neue Light, Helvetica Neue, Helvetica, Arial;
+ +
+ +

+ Colors

+ +

When implementing feature styles, you should only be using color variables provided by colors.css.scss.

+ +

When adding a color variable to colors.css.scss, using RGB and RGBA color units are preferred over hex, named, HSL, or HSLA values.

+ +

Right:

+ +
rgb(50, 50, 50);
+rgba(50, 50, 50, 0.2);
+ +

Wrong:

+ +
#FFF;
+#FFFFFF;
+white;
+hsl(120, 100%, 50%);
+hsla(120, 100%, 50%, 1);
+ +
+ +

+ Things to add to the guide

+ +
    +
  1. Define a type scale (variables for font-sizes, weights, letter-spacing, line-heights, etc.).
  2. +
  3. + .u- prefixed class name for single purpose utility classes like .u-underline, .u-capitalize, etc. (not sure about this one)
  4. +
  5. Don't use compass predefined functions, create a mixin in new mixins.css.scssfile.
  6. +
  7. No more clearfix or layout hacks, use flexbox: + + +
  8. +
+ +
+ +

+ CSSComb config

+ +
   "config": {
+
+        // Whether to add a semicolon after the last value/mixin.
+        "always-semicolon": true,
+
+        // Set indent for code inside blocks, including media queries and nested rules.
+        "block-indent": "  ",
+
+        // Unify case of hexadecimal colors.
+        "color-case": "lower",
+
+        // Whether to expand hexadecimal colors or use shorthands.
+        "color-shorthand": true,
+
+        // Unify case of element selectors.
+        "element-case": "lower",
+
+        // Add/remove line break at EOF.
+        "eof-newline": true,
+
+        // Add/remove leading zero in dimensions.
+        "leading-zero": false,
+
+        // Unify quotes style.
+        "quotes": "single",
+
+        // Remove all rulesets that contain nothing but spaces.
+        "remove-empty-rulesets": true,
+
+        // Set space after `:` in declarations.
+        "space-after-colon": " ",
+
+        // Set space after combinator (for example, in selectors like `p > a`).
+        "space-after-combinator": " ",
+
+        // Set space after `{`.
+        "space-after-opening-brace": "\n",
+
+        // Set space after selector delimiter.
+        "space-after-selector-delimiter": "\n",
+
+        // Set space before `}`.
+        "space-before-closing-brace": "\n",
+
+        // Set space before `:` in declarations.
+        "space-before-colon": "",
+
+        // Set space before combinator (for example, in selectors like `p > a`).
+        "space-before-combinator": " ",
+
+        // Set space before `{`.
+        "space-before-opening-brace": " ",
+
+        // Set space before selector delimiter.
+        "space-before-selector-delimiter": "",
+
+        // Set space between declarations (i.e. `color: tomato`).
+        "space-between-declarations": "\n",
+
+        // Whether to trim trailing spaces.
+        "strip-spaces": true,
+
+        // Whether to remove units in zero-valued dimensions.
+        "unitless-zero": true,
+
+        // Whether to align prefixes in properties and values.
+        "vendor-prefix-align": true,
+
+        // Sort properties in particular order.
+        "sort-order": [
+            "position",
+            "top",
+            "right",
+            "bottom",
+            "left",
+            "z-index",
+            "display",
+            "float",
+            "width",
+            "min-width",
+            "max-width",
+            "height",
+            "min-height",
+            "max-height",
+            "-webkit-box-sizing",
+            "-moz-box-sizing",
+            "box-sizing",
+            "-webkit-appearance",
+            "-moz-appearance",
+            "appearance",
+            "padding",
+            "padding-top",
+            "padding-right",
+            "padding-bottom",
+            "padding-left",
+            "margin",
+            "margin-top",
+            "margin-right",
+            "margin-bottom",
+            "margin-left",
+            "overflow",
+            "overflow-x",
+            "overflow-y",
+            "-webkit-overflow-scrolling",
+            "-ms-overflow-x",
+            "-ms-overflow-y",
+            "-ms-overflow-style",
+            "clip",
+            "clear",
+            "src",
+            "font",
+            "font-family",
+            "font-size",
+            "font-weight",
+            "font-style",
+            "font-variant",
+            "font-size-adjust",
+            "font-stretch",
+            "font-effect",
+            "font-emphasize",
+            "font-emphasize-position",
+            "font-emphasize-style",
+            "font-smooth",
+            "-webkit-hyphens",
+            "-moz-hyphens",
+            "hyphens",
+            "line-height",
+            "color",
+            "text-align",
+            "-webkit-text-align-last",
+            "-moz-text-align-last",
+            "-ms-text-align-last",
+            "text-align-last",
+            "text-emphasis",
+            "text-emphasis-color",
+            "text-emphasis-style",
+            "text-emphasis-position",
+            "text-decoration",
+            "text-underline-position",
+            "-webkit-text-decoration-style",
+            "-moz-text-decoration-style",
+            "text-decoration-style",
+            "-moz-text-decoration-color",
+            "text-decoration-color",
+            "-moz-text-decoration-line",
+            "text-decoration-line",
+            "text-indent",
+            "-ms-text-justify",
+            "text-justify",
+            "text-outline",
+            "-ms-text-overflow",
+            "text-overflow",
+            "text-overflow-ellipsis",
+            "text-overflow-mode",
+            "text-shadow",
+            "text-transform",
+            "text-wrap",
+            "-webkit-text-size-adjust",
+            "-moz-text-size-adjust",
+            "-ms-text-size-adjust",
+            "text-size-adjust",
+            "letter-spacing",
+            "-ms-word-break",
+            "word-break",
+            "word-spacing",
+            "-ms-word-wrap",
+            "word-wrap",
+            "-moz-tab-size",
+            "-o-tab-size",
+            "tab-size",
+            "white-space",
+            "vertical-align",
+            "list-style",
+            "list-style-position",
+            "list-style-type",
+            "list-style-image",
+            "pointer-events",
+            "-webkit-touch-action",
+            "-ms-touch-action",
+            "touch-action",
+            "cursor",
+            "visibility",
+            "zoom",
+            "flex-direction",
+            "flex-order",
+            "flex-pack",
+            "flex-align",
+            "table-layout",
+            "empty-cells",
+            "caption-side",
+            "border-spacing",
+            "border-collapse",
+            "content",
+            "quotes",
+            "counter-reset",
+            "counter-increment",
+            "resize",
+            "-webkit-user-select",
+            "-moz-user-select",
+            "-ms-user-select",
+            "user-select",
+            "nav-index",
+            "nav-up",
+            "nav-right",
+            "nav-down",
+            "nav-left",
+            "background",
+            "background-color",
+            "background-image",
+            "-ms-filter:\\'progid:DXImageTransform.Microsoft.gradient",
+            "filter:progid:DXImageTransform.Microsoft.gradient",
+            "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader",
+            "filter",
+            "background-repeat",
+            "background-attachment",
+            "background-position",
+            "background-position-x",
+            "-ms-background-position-x",
+            "background-position-y",
+            "-ms-background-position-y",
+            "-webkit-background-clip",
+            "-moz-background-clip",
+            "background-clip",
+            "background-origin",
+            "-webkit-background-size",
+            "-moz-background-size",
+            "-o-background-size",
+            "background-size",
+            "border",
+            "border-width",
+            "border-style",
+            "border-color",
+            "border-top",
+            "border-top-width",
+            "border-top-style",
+            "border-top-color",
+            "border-right",
+            "border-right-width",
+            "border-right-style",
+            "border-right-color",
+            "border-bottom",
+            "border-bottom-width",
+            "border-bottom-style",
+            "border-bottom-color",
+            "border-left",
+            "border-left-width",
+            "border-left-style",
+            "border-left-color",
+            "-webkit-box-decoration-break",
+            "box-decoration-break",
+            "-webkit-border-radius",
+            "-moz-border-radius",
+            "border-radius",
+            "-webkit-border-top-left-radius",
+            "-moz-border-radius-topleft",
+            "border-top-left-radius",
+            "-webkit-border-top-right-radius",
+            "-moz-border-radius-topright",
+            "border-top-right-radius",
+            "-webkit-border-bottom-right-radius",
+            "-moz-border-radius-bottomright",
+            "border-bottom-right-radius",
+            "-webkit-border-bottom-left-radius",
+            "-moz-border-radius-bottomleft",
+            "border-bottom-left-radius",
+            "-webkit-border-image",
+            "-moz-border-image",
+            "-o-border-image",
+            "border-image",
+            "-webkit-border-image-source",
+            "-moz-border-image-source",
+            "-o-border-image-source",
+            "border-image-source",
+            "-webkit-border-image-slice",
+            "-moz-border-image-slice",
+            "-o-border-image-slice",
+            "border-image-slice",
+            "-webkit-border-image-width",
+            "-moz-border-image-width",
+            "-o-border-image-width",
+            "border-image-width",
+            "-webkit-border-image-outset",
+            "-moz-border-image-outset",
+            "-o-border-image-outset",
+            "border-image-outset",
+            "-webkit-border-image-repeat",
+            "-moz-border-image-repeat",
+            "-o-border-image-repeat",
+            "border-image-repeat",
+            "outline",
+            "outline-width",
+            "outline-style",
+            "outline-color",
+            "outline-offset",
+            "-webkit-box-shadow",
+            "-moz-box-shadow",
+            "box-shadow",
+            "filter:progid:DXImageTransform.Microsoft.Alpha(Opacity",
+            "-ms-filter:\\'progid:DXImageTransform.Microsoft.Alpha",
+            "opacity",
+            "-ms-interpolation-mode",
+            "-webkit-transition",
+            "-moz-transition",
+            "-ms-transition",
+            "-o-transition",
+            "transition",
+            "-webkit-transition-delay",
+            "-moz-transition-delay",
+            "-ms-transition-delay",
+            "-o-transition-delay",
+            "transition-delay",
+            "-webkit-transition-timing-function",
+            "-moz-transition-timing-function",
+            "-ms-transition-timing-function",
+            "-o-transition-timing-function",
+            "transition-timing-function",
+            "-webkit-transition-duration",
+            "-moz-transition-duration",
+            "-ms-transition-duration",
+            "-o-transition-duration",
+            "transition-duration",
+            "-webkit-transition-property",
+            "-moz-transition-property",
+            "-ms-transition-property",
+            "-o-transition-property",
+            "transition-property",
+            "-webkit-transform",
+            "-moz-transform",
+            "-ms-transform",
+            "-o-transform",
+            "transform",
+            "-webkit-transform-origin",
+            "-moz-transform-origin",
+            "-ms-transform-origin",
+            "-o-transform-origin",
+            "transform-origin",
+            "-webkit-animation",
+            "-moz-animation",
+            "-ms-animation",
+            "-o-animation",
+            "animation",
+            "-webkit-animation-name",
+            "-moz-animation-name",
+            "-ms-animation-name",
+            "-o-animation-name",
+            "animation-name",
+            "-webkit-animation-duration",
+            "-moz-animation-duration",
+            "-ms-animation-duration",
+            "-o-animation-duration",
+            "animation-duration",
+            "-webkit-animation-play-state",
+            "-moz-animation-play-state",
+            "-ms-animation-play-state",
+            "-o-animation-play-state",
+            "animation-play-state",
+            "-webkit-animation-timing-function",
+            "-moz-animation-timing-function",
+            "-ms-animation-timing-function",
+            "-o-animation-timing-function",
+            "animation-timing-function",
+            "-webkit-animation-delay",
+            "-moz-animation-delay",
+            "-ms-animation-delay",
+            "-o-animation-delay",
+            "animation-delay",
+            "-webkit-animation-iteration-count",
+            "-moz-animation-iteration-count",
+            "-ms-animation-iteration-count",
+            "-o-animation-iteration-count",
+            "animation-iteration-count",
+            "-webkit-animation-direction",
+            "-moz-animation-direction",
+            "-ms-animation-direction",
+            "-o-animation-direction",
+            "animation-direction",
+            "-webkit-text-orientation",
+            "-moz-text-orientation",
+            "-o-text-orientation",
+            "text-orientation",
+            "-ms-writing-mode",
+            "text-rendering",
+            "-webkit-font-smoothing",
+            "-moz-osx-font-smoothing",
+            "font-smoothing",
+            "direction",
+            "unicode-bidi"
+        ]
+    }
+
+ + + + + + + + + +
+
+ {{#each sections}}
diff --git a/tasks/concat.js b/tasks/concat.js index 1c8846b..f97acac 100644 --- a/tasks/concat.js +++ b/tasks/concat.js @@ -2,7 +2,7 @@ module.exports = { dist: { options: {}, files: { - 'dist/cartostyles.css': [ + 'dist/css/cartostyles.css': [ '.tmp/src/scss/**/*.css' ] } diff --git a/tasks/copy.js b/tasks/copy.js new file mode 100644 index 0000000..fd09f93 --- /dev/null +++ b/tasks/copy.js @@ -0,0 +1,7 @@ +module.exports = { + main: { + files: [ + { expand: true, cwd: 'src/', src: 'fonts/**', dest: 'dist/' }, + ] + } +}; diff --git a/tasks/cssmin.js b/tasks/cssmin.js index 27f4ee8..d960ae6 100644 --- a/tasks/cssmin.js +++ b/tasks/cssmin.js @@ -4,8 +4,8 @@ module.exports = { check: 'gzip' }, files: { - 'dist/cartostyles.css': [ - 'dist/cartostyles.css' + 'dist/css/cartostyles.css': [ + 'dist/css/cartostyles.css' ] } } diff --git a/tasks/shell.js b/tasks/shell.js index 99da8aa..299a370 100644 --- a/tasks/shell.js +++ b/tasks/shell.js @@ -1,5 +1,8 @@ module.exports = { - dist: { + style: { command: 'styleguide' + }, + generateFont: { + command: 'gulp' } };