Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add .ds icon style #794

Closed
matteobertoldo opened this issue Dec 18, 2019 · 3 comments
Closed

Add .ds icon style #794

matteobertoldo opened this issue Dec 18, 2019 · 3 comments

Comments

@matteobertoldo
Copy link

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
Copy link
Member

Alhadis commented Dec 19, 2019

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
Copy link
Author

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
Copy link
Member

Alhadis commented Dec 19, 2019

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. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants