file-icons / atom

Atom file-specific icons for improved visual grepping.
MIT License
1.32k stars 250 forks source link

Add .ds icon style #794

Closed matteobertoldo closed 4 years ago

matteobertoldo commented 4 years ago

Hi man! 👋

It's possible to associate the icon for .ds files?. Here an official Salesforce B2C documentation.

"What is a B2C Commerce Script Module?

A CommonJS-compliant B2C Commerce script module is either a script file (with a .js, .json, or .ds extension) or a directory containing script files. A module can hide private data, while exposing public objects and methods via a free variable named exports."

Proposal icon

Icon for .js files but in light blue as for .jsx files, given the Salesforce blue 😅.

Thanks!

Alhadis commented 4 years ago

Hey there,

You can achieve this with your stylesheet:

.icon[data-name$=".ds"]::before{
    font: 14px Mfizz;
    content: "\f129";
    top: 1px;

    body:not(.file-icons-colourless) &{
        color: #00a1e0;
    }
}

There appear to be a number of filetypes which use the .ds extension, so I'm not sure adding the JS icon indiscriminately would be a good idea. 🤔

matteobertoldo commented 4 years ago

Thank you so much for the style snippet! Very nice now! 😝. I only updated the hex to agree with the default blue. I added the hexadecimal of the .medium-blue class (#6a9fb5) as I meant on the first comment. Here is the result. Identical to the color of ISML files for Salesfoce projects.

hero-tab

There appear to be a number of filetypes which use the .ds extension, so I'm not sure adding the JS icon indiscriminately would be a good idea. 🤔

Aaaah, I guess! You'r right! I don't think it is correct to always insert the js icon. I haven't investigated your code, but maybe you can target the icon if the file is present in a certain directory?. I've been working for about 3 years with SFCC projects and I've always seen the files with the extension .ds allocated to the path: **/cartridge/scripts/**/index.ds. Here an example:

hero-tree-view
Alhadis commented 4 years ago

I've been working for about 3 years with SFCC projects and I've always seen the files with the extension .ds allocated to the path: **/cartridge/scripts/**/index.ds.

I'll take your word for it. 😉 I've added a rule that will target .ds files located within /cartridge/scripts/* directories (and any subdirectories therein). You should see it in the next release. 👍