惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Cisco Talos Blog
Cisco Talos Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
爱范儿
爱范儿
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Jina AI
Jina AI
雷峰网
雷峰网
The Register - Security
The Register - Security
The Cloudflare Blog
博客园 - 【当耐特】
M
MIT News - Artificial intelligence
I
InfoQ
博客园 - 三生石上(FineUI控件)
H
Help Net Security
博客园 - 司徒正美
Vercel News
Vercel News
WordPress大学
WordPress大学
S
SegmentFault 最新的问题
云风的 BLOG
云风的 BLOG
B
Blog
Google DeepMind News
Google DeepMind News
B
Blog RSS Feed
L
LangChain Blog
人人都是产品经理
人人都是产品经理
GbyAI
GbyAI
T
The Blog of Author Tim Ferriss
T
Tailwind CSS Blog
aimingoo的专栏
aimingoo的专栏
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Recorded Future
Recorded Future
小众软件
小众软件
Martin Fowler
Martin Fowler
罗磊的独立博客
Stack Overflow Blog
Stack Overflow Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
酷 壳 – CoolShell
酷 壳 – CoolShell
腾讯CDC
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Apple Machine Learning Research
Apple Machine Learning Research
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园 - Franky
Hugging Face - Blog
Hugging Face - Blog
Y
Y Combinator Blog
V
Visual Studio Blog
F
Fortinet All Blogs
Microsoft Azure Blog
Microsoft Azure Blog
大猫的无限游戏
大猫的无限游戏
Engineering at Meta
Engineering at Meta
N
Netflix TechBlog - Medium
V
V2EX
Blog — PlanetScale
Blog — PlanetScale

Chip Cullen

The need for importance, and AI: Chip Cullen An updated Colorosetta: Chip Cullen The Return of the Font Combinator!: Chip Cullen Changing the number of an item in an ordered list: Chip Cullen My pizza dough recipe as of May 2025: Chip Cullen Gonna try to be a bit more personal: Chip Cullen How I built dynamic social media images in Eleventy using Cloudinary: Chip Cullen My current approach to AI : Chip Cullen Lessons Learned Surviving a Major Product Launch: Chip Cullen How to Build a Drop Down Menu with Modern CSS: Chip Cullen How to stop page scrolling when you have an open dialog element: Chip Cullen Distraction Driven Development: Chip Cullen How I learned to code: the art of letting go: Chip Cullen In praise of the switch statement: Chip Cullen Project stuck? Think about how you’re breaking it down & question everything: Chip Cullen So how did the onboarding experiment go?: Chip Cullen Ideas for an Onboarding Checklist: Chip Cullen I really like Post Mortems: Chip Cullen Raise Red Flags Early: Chip Cullen How to mock fetch requests in React Testing Librarty tests: Chip Cullen Running a Structured Meeting: Chip Cullen Adding the View Transitions API to my personal site: Chip Cullen A Lightweight Way to Read GraphQL Data: Chip Cullen How to make a color changing favicon: Chip Cullen Using a Pros/Cons list to help navigate technical discussions: Chip Cullen How to use variable fonts from Google Fonts: Chip Cullen A new website: now on Eleventy!: Chip Cullen How to Truncate Type at More Than One Line with Just CSS: Chip Cullen Colorosetta: the VS Code Extension!: Chip Cullen Using CSS Custom Properties and Logical Properties Together: Chip Cullen Browser Dev Tools: Element Inspector Popover: Chip Cullen The Link with rel=preload is a Seperate Thing: Chip Cullen How to have Dark & Light Mode Images that also works with User Choice: Chip Cullen Don’t use Viewport Units for Font Size on their own: Chip Cullen A little known Media Query: Aspect Ratio: Chip Cullen Meta thinking: Managing Decisions: Chip Cullen Give Your To-Do's Context: Chip Cullen Say What the Impact is when Reporting Issues: Chip Cullen Firefighting 101: How to Manage Breakages: Chip Cullen How to Deal With Large Pieces of Technical Debt: Chip Cullen Make Your Request Clear: Chip Cullen Analytics events, HTML classes, and protecting against refactoring: Chip Cullen How We Removed jQuery from a large app: Chip Cullen New tool: ColoRosetta: Chip Cullen What width and height attributes should you use with responsive images?: Chip Cullen Django 3.1 gotcha: Referrer Policy has a new default, and it might break iframes and links: Chip Cullen A Javascript Component Pattern: Chip Cullen CSS min(), max() and clamp() Functions: Chip Cullen Pointer Events and Inline Elements in Chrome: Chip Cullen Resolving a github repo and a new Create React App: Chip Cullen How to POST *Data* with the Fetch API: Chip Cullen The Contrast Triangle: Chip Cullen Advice on interviewing for Junior Developers: Chip Cullen Life Lessons Learned From Running a Marathon: How to do something really hard: Chip Cullen A (Brief) intro to Search Engine Structured Data: Chip Cullen Javascript Fallback Values on Variables and Booleans - a hard lesson: Chip Cullen Alfred Tip: Quickly Access Common URLs: Chip Cullen Responsive Images in Hugo - by Laura Kalbag: Chip Cullen Making a Gatsby Site with Multiple Content Types: Chip Cullen How to Create and Use Fixtures in Cypress Tests: Chip Cullen Fixing the 'Bad Interpreter' Error from AWS and Python 3.7: Chip Cullen Creating a Canonical Tag in a Django Template: Chip Cullen Responsive spacing with viewport and ch units: Chip Cullen Welcome to my New Design - 2019: Chip Cullen Django Templates: Block and If statements don’t work like you might expect: Chip Cullen Books I Read in 2018: Chip Cullen Lifehack: 4 ways to help tame common email noise: Chip Cullen How to make better Pull Requests: Adding Steps to Test: Chip Cullen The unsung develpment tool: Spreadsheets: Chip Cullen Troubleshooting Adding and Removing EventListeners: with Arguments, Debounced, and in a React Class: Chip Cullen How to Fake the Window Object in Jest and Enzyme: Chip Cullen Migrating From Wordpress to Hugo: Chip Cullen Background Repeat and its Possibilities: Chip Cullen Getting Started With Front End Tests: a Mindset: Chip Cullen Migrating a Blog - An Opportunity for a Content Inventory: Chip Cullen Moving to Hugo: Chip Cullen JavaScript events: .target vs .currentTarget: Chip Cullen Things I wish I knew when starting with Python: Chip Cullen Leading Ampersands for modifiers in Sass: An anti-pattern: Chip Cullen How to get rid of the "You have mail" message in your terminal: Chip Cullen Why three typefaces rule the web, and what you can do about it: Chip Cullen You shouldn't worry about Section 508 - it's Section 504: Chip Cullen Looping Video Backgrounds: pointers and pitfalls: Chip Cullen How to “preview” a click event tag in the Google Tag Manager console: Chip Cullen Moving on from a technology, or: life after Drupal: Chip Cullen Don’t be a dumb developer: Chip Cullen Two level breadcrumbs with CSS :only-child: Chip Cullen Simplicity comes with experience: Chip Cullen Do the least amount possible: Chip Cullen SVGs vs. Icon Fonts: Two points in favor of Icon Fonts: Chip Cullen Accessible links without underlines: Chip Cullen The Strategic Job Hunt: Chip Cullen Surviving Getting Laid Off: Chip Cullen How to structure your typography in Sass: Chip Cullen Layer Cake: A Responsive Design Layout Pattern: Chip Cullen Creativity is yet to come in Web Design: Chip Cullen Front End Testing with Wraith: A Step by Step Recipe: Chip Cullen Where to begin? How I start a visual design for the web: Chip Cullen If you could only have five Google Fonts: Chip Cullen Why SVG is so cool (or: what happens when you're late to the party on something): Chip Cullen
How to use IcoMoon and Icon Fonts – Part 3: 7 Ninja Tricks: Chip Cullen
2013-08-11 · via Chip Cullen

This last of three posts about IcoMoon is going to cover just a few tips and tricks to get the most out of IcoMoon. Some involve the app itself, some are more to do with implementation. Let's get to it!

Ninja Trick 1: Adding other icon sets to IcoMoon's app

IcoMoon has several icon sets that you can choose from. When in the 'selection' screen, either click on the "Icon Library" button at the top of the screen:

Icon Library Button

Or scroll to the bottom and hit "More Icon Sets…"

Icon Library Button

And select other sets that you want to include.

Other icons sets"

Some are free and have very open licenses, others cost some money. Usually the ones with CC (Creative Commons) licenses are free to use.

Ninja Trick 2: Editing icons in your font

Like an icon that you found, but want it rotated the other way? Need it to be 'larger' within the font itself? One of the coolest things about IcoMoon is that it lets you control the icons in your font (to a certain extent). If you are in the 'selection screen' and click the "edit" button

The edit mode button

You are now in 'edit mode', which means if you now click on an icon, you get the 'edit screen'

Editing an Icon

Which lets you:

  • Rotate
  • Flip
  • Scale
  • Move

This helped me out a great deal on one project where I inserted an icon, but it needed to be a little bit bigger, but sizing it up with CSS was causing unwanted other effects. By being able to scale up the individual icon within the font, I was good to go.

Ninja Trick 3: Adding your own shapes to your icon font

As was eluded to in Part 2, what if the shape or icon you want is not available as part of the IcoMoon set (or any of the other sets available)? Not to worry. As long as you have a vector based version of your particular icon, you're in luck.

  1. Export your custom icon as an SVG (in Illustrator File > Save As and select "SVG 1.1")
  2. In the IcoMoon icon 'selection screen' click the "Import Icons" button

The Import Icons button

and upload your .svg file

  1. You can edit your shape before saving it to your font - just like editing any other icon

Keep in mind that you'll have more luck with black shapes, and if they are as clean as possible when it comes to vector points.

Ninja Trick 4: Changing the font name

IcoMoon generates your icon font with a default name of 'icomoonxxxxxx'. You can change what the name of the font, in the 'font' screen, by clicking on 'font preferences'

The preference button

And changing it there. that way you can give your font files a more project-specific name.

Ninja Trick 5: Downloading your font config file

One thing that I recommend you do after generating and downloading a font is to be sure to download your 'session' file - which you can get at any point by clicking the 'store session' link at the bottom of the screen:

Be sure to save your session

This will download a .json file that contains the information of where your font was when you were editing it - which icons you chose, out of which sets, and any adjustments you made to them. You can keep this file with your project and in version control so you can always go back later, and 'load session' to get back to where you were.

IcoMoon is smart enough to remember where you were when you last used your browser - but if you change computers or browser, it can't know what you were up to. That's why the session file is so important.

In fact, if I had one request of IcoMoon it would be to include the session file by default when you download your font. I've not tried it myself, but theoretically you can actually reimport one of your font files and start work from there, as well.

Ninja Trick 6: Changing an icon with JavaScript / jQuery

This took me a good hour or so to figure out the other day, so I thought I'd share my lesson. Let's say you have an icon inserted with HTML, and you want to change the icon itself? In my case I was trying to change the icon on a button from pause to play and back again. You have to write the HTML entity a little differently when manipulating it in jQuery:

<a href="#" id="pausePlayButton">
  <span aria-hidden="true" id="playPauseIcon" data-icon="&#xe001;"></span>
</a>
//jQuery:
$("#pausePlayButton").click(function() {
  $(this)
    .children("#pausePlayIcon")
    .attr("data-icon", "\ue002");
});

All we are doing is changing the content of the data-icon attribute, but we need to escape the new value that we're passing with the \u at the beginning.

Ninja Trick 7: Get your SASS on

This doesn't really have anything to do with IcoMoon specifically, but rather implementation of an icon font. As I covered previously, there are some ways to use the power of SASS to make using icons really easy.

I've taken that even further and created a 'power duo' of an extendable and a mixin that you can use to easily add icons via CSS and keep your final code as lean as possible.

The first part, the extendable "%icon" keeps most of the CSS that you will need to use an icon. By making this extendable, all of the selectors that end up using it are ganged together. That's a lot better than having this stack of CSS get repeated all over the place, causing your final CSS output to be bloated.

The mixin "icon" merely references that extendable, and lets you pass the escaped HTML entity as an argument. You can also optionally include "before" or "after" if you want the mixin to create the pseudo element for you. (The majority of the time you won't use that optional argument, as you'll probably need to apply further rules to the icon).

So now, to use an icon, you can simply write this:

.foo {
  &:before {
    @include icon("\e001");
    // other rules
  }
}

Or if you want to have it create the pseudo element for you:

.foo {
  @include icon("\e001", before);
}

If you really want to go down the SASS rabbit hole, you can even set your icon HTML entities as variables, which will be easier to remember, and easy to change down the line:

//kept in a variables partial
$icon-rocketship: "\e001";
//-----
.foo {
  &:before {
    @include icon($icon-rocketship);
    // other rules
  }
}

Blast off! Grab the extendable and mixin here!

Conclusion

So this concludes the three part series on IcoMoon and Icon fonts. I will try to follow up in the future with even more ticks that you can use to unleash the power of icon fonts (things like ligatures, mapping different characters, etc).