file-icons / atom

Atom file-specific icons for improved visual grepping.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Wrong classname when I use matchName Api to get the icon classname of txt file

Jocs opened this issue · comments

I have a txt file, for example mock.txt through matchName api to get the icon's classname, which is icon-file-text, but I did not find the corresponding classname(icon-file-text) in styles/icons.less file.

Did I go wrong?

["icon-file-text",["medium-blue","medium-blue"],/\.te?xt$|\.dri$|\.irclog$|\.uot$/i,,false,,,,/^\xEF\xBB\xBF|^\xFF\xFE/],

A handful of icons are provided by Atom's core styling. The ones used by File-Icons are:

Here's the equivalent CSS, if you need it outside of Atom:

.icon-circuit-board::before { content: "\f0d6"; font: 16px/1 "Octicons Regular"; }
.icon-file-pdf::before      { content: "\f014"; font: 16px/1 "Octicons Regular"; }
.icon-file-text::before     { content: "\f011"; font: 16px/1 "Octicons Regular"; }
.icon-mail::before          { content: "\f03b"; font: 16px/1 "Octicons Regular"; }
.icon-paintcan::before      { content: "\f0d1"; font: 16px/1 "Octicons Regular"; }
.icon-star::before          { content: "\f02a"; font: 16px/1 "Octicons Regular"; }

This inconsistency is annoying, but it's for backwards (and forwards) compatibility. Basically, any class-name prefixed by icon- is guaranteed not to be defined by File-Icons, which uses the -icon suffix instead.

@Alhadis Thanks!