From f43147ce097b6b0b9dd2922c00f72e875f5f129d Mon Sep 17 00:00:00 2001 From: Javier Arce Date: Wed, 20 Jan 2016 12:58:47 +0100 Subject: [PATCH] Updates selector names --- Gulpfile.js | 8 + icon-font/template.jst.ejs | 10 +- src/fonts/cartoIcon.eot | Bin 17632 -> 17632 bytes src/fonts/cartoIcon.ttf | Bin 17460 -> 17460 bytes src/fonts/cartoIcon.woff | Bin 11040 -> 11040 bytes src/scss/icon-font.css.scss | 762 ++++++++++++++++++++++-------------- 6 files changed, 490 insertions(+), 290 deletions(-) diff --git a/Gulpfile.js b/Gulpfile.js index 760f2c4..349413a 100644 --- a/Gulpfile.js +++ b/Gulpfile.js @@ -2,6 +2,14 @@ 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']) diff --git a/icon-font/template.jst.ejs b/icon-font/template.jst.ejs index eb570d3..f63d3a9 100644 --- a/icon-font/template.jst.ejs +++ b/icon-font/template.jst.ejs @@ -12,7 +12,7 @@ font-style: normal; } -.IconFont { +.CDB-IconFont { display: inline-block; font-family: 'CartoIcon'; font-style: normal; @@ -28,16 +28,18 @@ All available icons in CartoDB. ``` <% _.each(glyphs, function(glyph) { %> +<% var name = glyph.fileName.split("_")[2].toCamelCase(); %>
- Size-large"> -

<%= glyph.fileName.split("_")[2] %>

+ +

<%= name %>

<% }); %> ``` */ <% _.each(glyphs, function(glyph) { %> -.IconFont-<%= glyph.fileName.split("_")[2] %>::before { +<% var name = glyph.fileName.split("_")[2].toCamelCase(); %> +.CDB-IconFont--<%= name %>::before { content: '\<%= glyph.codePoint %>'; } <% }); %> diff --git a/src/fonts/cartoIcon.eot b/src/fonts/cartoIcon.eot index 9bf2cc3e12de690f8a64f05eea3d652258d2ae94..7097b7350d48bf24fbb1c026c46f6979ea7e5af3 100644 GIT binary patch delta 55 zcmaFR$@rj?ae@uAYfsli`*q9}t7c97Fjcy%$2Fec<|_j?<1YpvxOCLy28`akfYHGj E0C-guiU0rr delta 55 zcmaFR$@rj?ae@uA{Q=nz4M^BPq`2oALZMUm3U=e*r}pE*&+w0i)lP|NqVv!T1Nr Tj{Y1W delta 61 zcmV-D0K)&ER-jgpc>{CetjEp diff --git a/src/scss/icon-font.css.scss b/src/scss/icon-font.css.scss index 35e7c70..852987b 100644 --- a/src/scss/icon-font.css.scss +++ b/src/scss/icon-font.css.scss @@ -12,7 +12,7 @@ font-style: normal; } -.IconFont { +.CDB-IconFont { display: inline-block; font-family: 'CartoIcon'; font-style: normal; @@ -28,861 +28,1051 @@ All available icons in CartoDB. ``` +
- -

Clock

+ +

clock

+
- -

Stats

+ +

stats

+
- -

Heart--empty

+ +

heartempty

+
- -

Heart--fill

+ +

heartfill

+
- -

Alert

+ +

alert

+
- -

Rows

+ +

rows

+
- -

Check

+ +

check

+
- -

Dribbble

+ +

dribbble

+
- -

Twitter

+ +

twitter

+
- -

Wizard

+ +

wizard

+
- -

Info

+ +

info

+
- -

Fork

+ +

fork

+
- -

Facebook

+ +

facebook

+
- -

Folder

+ +

folder

+
- -

Dropbox

+ +

dropbox

+
- -

Cloud

+ +

cloud

+
- -

Step

+ +

step

+
- -

AddDocument

+ +

addDocument

+
- -

ArrowNext

+ +

arrowNext

+
- -

ArrowPrev

+ +

arrowPrev

+
- -

Close

+ +

close

+
- -

CartoFante

+ +

cartoFante

+
- -

Lock

+ +

lock

+
- -

CartoDB

+ +

cartoDB

+
- -

Lens

+ +

lens

+
- -

CloseLimits

+ +

closeLimits

+
- -

DefaultUser

+ +

defaultUser

+
- -

Cockroach

+ +

cockroach

+
- -

Floppy

+ +

floppy

+
- -

Trash

+ +

trash

+
- -

Wifi

+ +

wifi

+
- -

Unlock

+ +

unlock

+
- -

Unlock--withEllipsis

+ +

unlockwithEllipsis

+
- -

Gift

+ +

gift

+
- -

People

+ +

people

+
- -

Play

+ +

play

+
- -

Add

+ +

add

+
- -

Map

+ +

map

+
- -

Anchor

+ +

anchor

+
- -

Key

+ +

key

+
- -

Calendar

+ +

calendar

+
- -

Document

+ +

document

+
- -

Eye

+ +

eye

+
- -

Marker

+ +

marker

+
- -

ProgressBar

+ +

progressBar

+
- -

Book

+ +

book

+
- -

Notes

+ +

notes

+
- -

Rectangles

+ +

rectangles

+
- -

Mountain

+ +

mountain

+
- -

Points

+ +

points

+
- -

Snake

+ +

snake

+
- -

Boss

+ +

boss

+
- -

Rocket

+ +

rocket

+
- -

Barometer

+ +

barometer

+
- -

Dollar

+ +

dollar

+
- -

Email

+ +

email

+
- -

Label

+ +

label

+
- -

Outside

+ +

outside

+
- -

Jigsaw

+ +

jigsaw

+
- -

Tools

+ +

tools

+
- -

Question

+ +

question

+
- -

LayerStack

+ +

layerStack

+
- -

Alarm

+ +

alarm

+
- -

CloudDownArrow

+ +

cloudDownArrow

+
- -

Pencil

+ +

pencil

+
- -

FountainPen

+ +

fountainPen

+
- -

EmptyDoc

+ +

emptyDoc

+
- -

MergeArrow

+ +

mergeArrow

+
- -

MergeColumns

+ +

mergeColumns

+
- -

MergeSpatial

+ +

mergeSpatial

+
- -

Globe

+ +

globe

+
- -

ChevronDown

+ +

chevronDown

+
- -

Streets

+ +

streets

+
- -

Keys

+ +

keys

+
- -

FacebookSquare

+ +

facebookSquare

+
- -

Fullscreen

+ +

fullscreen

+
- -

Rarrow

+ +

rarrow

+
- -

Share

+ +

share

+
- -

Linkedin

+ +

linkedin

+
- -

CalendarBlank

+ +

calendarBlank

+
- -

CreativeCommons

+ +

creativeCommons

+
- -

Bubble

+ +

bubble

+
- -

Bars

+ +

bars

+
- -

ArrowMenu

+ +

arrowMenu

+
- -

TieFighter

+ +

tieFighter

+
- -

Ray

+ +

ray

+
- -

Markup

+ +

markup

+
- -

Table

+ +

table

+
- -

Airlock

+ +

airlock

+
- -

Pin

+ +

pin

+
- -

Attache

+ +

attache

+
- -

Download

+ +

download

+
- -

Group

+ +

group

+
- -

Dashboard

+ +

dashboard

+
- -

Spinner

+ +

spinner

``` */ -.IconFont-Clock::before { + +.CDB-IconFont--clock::before { content: '\E001'; } -.IconFont-Stats::before { + +.CDB-IconFont--stats::before { content: '\E002'; } -.IconFont-Heart--empty::before { + +.CDB-IconFont--heartempty::before { content: '\E003'; } -.IconFont-Heart--fill::before { + +.CDB-IconFont--heartfill::before { content: '\E004'; } -.IconFont-Alert::before { + +.CDB-IconFont--alert::before { content: '\E005'; } -.IconFont-Rows::before { + +.CDB-IconFont--rows::before { content: '\E006'; } -.IconFont-Check::before { + +.CDB-IconFont--check::before { content: '\E007'; } -.IconFont-Dribbble::before { + +.CDB-IconFont--dribbble::before { content: '\E008'; } -.IconFont-Twitter::before { + +.CDB-IconFont--twitter::before { content: '\E009'; } -.IconFont-Wizard::before { + +.CDB-IconFont--wizard::before { content: '\E00A'; } -.IconFont-Info::before { + +.CDB-IconFont--info::before { content: '\E00B'; } -.IconFont-Fork::before { + +.CDB-IconFont--fork::before { content: '\E00C'; } -.IconFont-Facebook::before { + +.CDB-IconFont--facebook::before { content: '\E00D'; } -.IconFont-Folder::before { + +.CDB-IconFont--folder::before { content: '\E00E'; } -.IconFont-Dropbox::before { + +.CDB-IconFont--dropbox::before { content: '\E00F'; } -.IconFont-Cloud::before { + +.CDB-IconFont--cloud::before { content: '\E010'; } -.IconFont-Step::before { + +.CDB-IconFont--step::before { content: '\E011'; } -.IconFont-AddDocument::before { + +.CDB-IconFont--addDocument::before { content: '\E012'; } -.IconFont-ArrowNext::before { + +.CDB-IconFont--arrowNext::before { content: '\E013'; } -.IconFont-ArrowPrev::before { + +.CDB-IconFont--arrowPrev::before { content: '\E014'; } -.IconFont-Close::before { + +.CDB-IconFont--close::before { content: '\E015'; } -.IconFont-CartoFante::before { + +.CDB-IconFont--cartoFante::before { content: '\E016'; } -.IconFont-Lock::before { + +.CDB-IconFont--lock::before { content: '\E017'; } -.IconFont-CartoDB::before { + +.CDB-IconFont--cartoDB::before { content: '\E018'; } -.IconFont-Lens::before { + +.CDB-IconFont--lens::before { content: '\E019'; } -.IconFont-CloseLimits::before { + +.CDB-IconFont--closeLimits::before { content: '\E01A'; } -.IconFont-DefaultUser::before { + +.CDB-IconFont--defaultUser::before { content: '\E01B'; } -.IconFont-Cockroach::before { + +.CDB-IconFont--cockroach::before { content: '\E01C'; } -.IconFont-Floppy::before { + +.CDB-IconFont--floppy::before { content: '\E01D'; } -.IconFont-Trash::before { + +.CDB-IconFont--trash::before { content: '\E01E'; } -.IconFont-Wifi::before { + +.CDB-IconFont--wifi::before { content: '\E01F'; } -.IconFont-Unlock::before { + +.CDB-IconFont--unlock::before { content: '\E020'; } -.IconFont-Unlock--withEllipsis::before { + +.CDB-IconFont--unlockwithEllipsis::before { content: '\E021'; } -.IconFont-Gift::before { + +.CDB-IconFont--gift::before { content: '\E022'; } -.IconFont-People::before { + +.CDB-IconFont--people::before { content: '\E023'; } -.IconFont-Play::before { + +.CDB-IconFont--play::before { content: '\E024'; } -.IconFont-Add::before { + +.CDB-IconFont--add::before { content: '\E025'; } -.IconFont-Map::before { + +.CDB-IconFont--map::before { content: '\E026'; } -.IconFont-Anchor::before { + +.CDB-IconFont--anchor::before { content: '\E027'; } -.IconFont-Key::before { + +.CDB-IconFont--key::before { content: '\E028'; } -.IconFont-Calendar::before { + +.CDB-IconFont--calendar::before { content: '\E029'; } -.IconFont-Document::before { + +.CDB-IconFont--document::before { content: '\E02A'; } -.IconFont-Eye::before { + +.CDB-IconFont--eye::before { content: '\E02B'; } -.IconFont-Marker::before { + +.CDB-IconFont--marker::before { content: '\E02C'; } -.IconFont-ProgressBar::before { + +.CDB-IconFont--progressBar::before { content: '\E02D'; } -.IconFont-Book::before { + +.CDB-IconFont--book::before { content: '\E02E'; } -.IconFont-Notes::before { + +.CDB-IconFont--notes::before { content: '\E02F'; } -.IconFont-Rectangles::before { + +.CDB-IconFont--rectangles::before { content: '\E030'; } -.IconFont-Mountain::before { + +.CDB-IconFont--mountain::before { content: '\E031'; } -.IconFont-Points::before { + +.CDB-IconFont--points::before { content: '\E032'; } -.IconFont-Snake::before { + +.CDB-IconFont--snake::before { content: '\E033'; } -.IconFont-Boss::before { + +.CDB-IconFont--boss::before { content: '\E034'; } -.IconFont-Rocket::before { + +.CDB-IconFont--rocket::before { content: '\E035'; } -.IconFont-Barometer::before { + +.CDB-IconFont--barometer::before { content: '\E036'; } -.IconFont-Dollar::before { + +.CDB-IconFont--dollar::before { content: '\E037'; } -.IconFont-Email::before { + +.CDB-IconFont--email::before { content: '\E038'; } -.IconFont-Label::before { + +.CDB-IconFont--label::before { content: '\E039'; } -.IconFont-Outside::before { + +.CDB-IconFont--outside::before { content: '\E03A'; } -.IconFont-Jigsaw::before { + +.CDB-IconFont--jigsaw::before { content: '\E03B'; } -.IconFont-Tools::before { + +.CDB-IconFont--tools::before { content: '\E03C'; } -.IconFont-Question::before { + +.CDB-IconFont--question::before { content: '\E03D'; } -.IconFont-LayerStack::before { + +.CDB-IconFont--layerStack::before { content: '\E03E'; } -.IconFont-Alarm::before { + +.CDB-IconFont--alarm::before { content: '\E03F'; } -.IconFont-CloudDownArrow::before { + +.CDB-IconFont--cloudDownArrow::before { content: '\E040'; } -.IconFont-Pencil::before { + +.CDB-IconFont--pencil::before { content: '\E041'; } -.IconFont-FountainPen::before { + +.CDB-IconFont--fountainPen::before { content: '\E042'; } -.IconFont-EmptyDoc::before { + +.CDB-IconFont--emptyDoc::before { content: '\E043'; } -.IconFont-MergeArrow::before { + +.CDB-IconFont--mergeArrow::before { content: '\E044'; } -.IconFont-MergeColumns::before { + +.CDB-IconFont--mergeColumns::before { content: '\E045'; } -.IconFont-MergeSpatial::before { + +.CDB-IconFont--mergeSpatial::before { content: '\E046'; } -.IconFont-Globe::before { + +.CDB-IconFont--globe::before { content: '\E047'; } -.IconFont-ChevronDown::before { + +.CDB-IconFont--chevronDown::before { content: '\E048'; } -.IconFont-Streets::before { + +.CDB-IconFont--streets::before { content: '\E049'; } -.IconFont-Keys::before { + +.CDB-IconFont--keys::before { content: '\E04A'; } -.IconFont-FacebookSquare::before { + +.CDB-IconFont--facebookSquare::before { content: '\E04B'; } -.IconFont-Fullscreen::before { + +.CDB-IconFont--fullscreen::before { content: '\E04C'; } -.IconFont-Rarrow::before { + +.CDB-IconFont--rarrow::before { content: '\E04D'; } -.IconFont-Share::before { + +.CDB-IconFont--share::before { content: '\E04E'; } -.IconFont-Linkedin::before { + +.CDB-IconFont--linkedin::before { content: '\E04F'; } -.IconFont-CalendarBlank::before { + +.CDB-IconFont--calendarBlank::before { content: '\E050'; } -.IconFont-CreativeCommons::before { + +.CDB-IconFont--creativeCommons::before { content: '\E051'; } -.IconFont-Bubble::before { + +.CDB-IconFont--bubble::before { content: '\E052'; } -.IconFont-Bars::before { + +.CDB-IconFont--bars::before { content: '\E053'; } -.IconFont-ArrowMenu::before { + +.CDB-IconFont--arrowMenu::before { content: '\E054'; } -.IconFont-TieFighter::before { + +.CDB-IconFont--tieFighter::before { content: '\E055'; } -.IconFont-Ray::before { + +.CDB-IconFont--ray::before { content: '\E056'; } -.IconFont-Markup::before { + +.CDB-IconFont--markup::before { content: '\E057'; } -.IconFont-Table::before { + +.CDB-IconFont--table::before { content: '\E058'; } -.IconFont-Airlock::before { + +.CDB-IconFont--airlock::before { content: '\E059'; } -.IconFont-Pin::before { + +.CDB-IconFont--pin::before { content: '\E05A'; } -.IconFont-Attache::before { + +.CDB-IconFont--attache::before { content: '\E05B'; } -.IconFont-Download::before { + +.CDB-IconFont--download::before { content: '\E05C'; } -.IconFont-Group::before { + +.CDB-IconFont--group::before { content: '\E05D'; } -.IconFont-Dashboard::before { + +.CDB-IconFont--dashboard::before { content: '\E05E'; } -.IconFont-Spinner::before { + +.CDB-IconFont--spinner::before { content: '\E05F'; }