-
Notifications
You must be signed in to change notification settings - Fork 30.5k
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
File and folder icon theme feature #3200
Conversation
Hi @pflannery, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution! TTYL, MSBOT; |
/* explorer icons */
.explorer-folders-view .folder-icon {
padding-left: 22px;
background: url(media/folder.svg) 1px 4px no-repeat;
}
.explorer-folders-view .expanded .folder-icon {
background: url(media/folder_open.svg) 1px 4px no-repeat;
}
.explorer-folders-view .file-icon {
padding-left: 22px;
background: url(media/file.svg) 1px 4px no-repeat;
}
.explorer-working-files .working-files-item {
padding-left: 22px;
background: url(media/file.svg) 1px 4px no-repeat;
}
|
@pflannery, Thanks for signing the contribution license agreement so quickly! Actual humans will now validate the agreement and then evaluate the PR. |
@aeschli is it possible with our theming story to add global CSS rules that alter things outside the monaco editor? I would think not? |
@bpasero Yes sure. The theming CSS rules are all global and can be used anywhere. But there's a limited set of standardized colors that TextMate themes define and they are editor related. Custom colors are also possible, of course. |
@pflannery currently you cannot really theme anything outside the editor. @aeschli please chime in unless I am correct with that statement. |
Is this PR going to be merged? It sounds like @aeschli is saying that this is possible. After getting used to file icons in Sublime and Atom, it's a bit of a dealbreaker not to support them. |
@JoshAddington we can merge this in but it is NOT possible to add file icons to the explorer via theme extensions. |
@bpasero @aeschli I see now how theming worked with tm. This evening I added the rework css parser which allows theming using css. This doesnt break tm themes. These are the allowed css selector\property definitions. Example theme using css for editor and explorer Example of css monokai theme with icons: |
Nice! One thing though, I don't know if it's a good idea to tie icons directly in with the theme. I know that it works now, and it'll likely be the best solution until more work is done on Microsoft's side. However, I I find it likely that a person could really like a particular theme, but the theme's author either doesn't support icons, or supports icons that the user doesn't like. Since the presence of icons doesn't affect anything structurally, I wonder how feasible it would be to move the concept of an icon pack outside of the theme infrastructure; so users can mix and match themes with icons. Of course, that would require much more code than simply hijacking themes. |
if your happy for this to happen then
@nelsonlaquet yeah would be nice to be able swap out the icons only. I still think themes could still choose to provide their own icons to match their colouring styles. |
Super excited to see some progress on this! I don't think themes are the right place to put icons though. The wrong icons would ruin a good theme and it would probably end up spawning a bunch of derivative themes just for icons: monokai-flat-icon, monokai-someother-icon, monkai-dimmed-flat-icon, ... You can imagine how it would get out of hand. |
@Tyriar your right. I can also see many derivatives either way its done i.e. dark-web-icon-pack, high-contrast-web-icon-pack, light-web-icon-pack etc... I've always thought of the term theme to mean colours, icons, wallpapers and sounds (sounds not being relevant here). I think we could setup themes so that they declare what components they contain. i.e. icons, syntax or both. For the global dark, light, or high contrast themes we could eventually drop these in favour of css controlling the entire ide. |
@pflannery I glanced over and found you are using png. Will this work well on retina display? |
@Code-DJ it's really only in order to get it to work and show its working. The example icon pack will be removed before it's merged. |
@bpasero I've tried to add a unit test but I cant seem to run tests. When using the launcher it doesn't run my test. When using Is there something I need to do on windows for this? |
@pflannery you should be able to run the tests from the command line easily by typing scripts/test.sh |
thanks @bpasero . I was trying to use the launcher or test task but they aren't working. Debugging is still a bit of chore but have it working like this
|
@aeschli @bpasero I didn't want to just go off and do this without first discussing with you. How's that sound? |
@pflannery How about supporting themeing more UI components, like the color of the status bar? |
@pflannery I appreciate your work but we are currently not planning to support theming outside the editor. We might revisit this post GA when we decide our 6 months roadmap and keep you in the loop. |
@bpasero I hope the plan will include
Would be a shame to be stuck with editor themes via abstracted config json\xml files |
@chrisdias fyi on the last comment for planning |
Sad to see this one go. Somehow the monochrome and same-weighted text in the folder view of VSCode makes it extremely difficult for me to read compared to all other editors which have either colorization or at least bold weights for folders to distinguish them from files. I'll be seeking a hack in the meantime. Edit: hack discovered |
- adds ability to create themes using css - adds new preferences for icon theme selection - adds icon theme menu option with no icon option - adds explorer and working file renderer tests - adds theme service tests - adds css theme provider tests
This seems very specific to one area of theming. In my opinion, you should be able to theme (apply CSS to) any part of the application. This is very easy to do when you're using something like Electron. Related: #459 |
@glen-84 that could cause issues and massive incompatibilities between plugins. Sure; it would open up the potential for a lot of awesome things, but I get the feeling the VSCode dev team wants to keep things as locked down as possible to ensure a consistent and usable experience. |
@nelsonlaquet You're no fun! 😁 But seriously, I don't believe that custom CSS would cause massive incompatibilities between plug-ins. People love customizing things, and it builds community. I really hope that Microsoft doesn't do the Windows thing again, where you literally have to edit registry values just to change the font. |
@FEARCODE see #211 (comment) for a recap of the current situation. I'd love to see it added personally. |
@Tyriar I agree. I am not sure how they went about their research, but a monotone list of names is hard to look at when I have a ton of files. Also, his comment on "multi-colored" distracting icons is false. As pictured here, these icon DRASTICALLY improve the speed at which i can find my folder/files. #211 (comment) I think that themes should also control what the icons look like and i do agree there should be an option to disable them. |
Since we are now using electron 0.37 (Based on chrome 49) could we not use css properties(variables) to solve the icon url path issue, or even all of the css extensibility. As the properties can also be accessed through JavaScript, something then like a .json file could be used to define the properties and then VSCode applies them to the UI. This would prevent devs using css to alter things they shouldn't. |
@tht13 JSON is about an hours work away in the PR but I've stopped whilst we wait for the road map.
I don't agree on your comments regarding CSS. If I don't like an extension then I just remove it. Atom is a good example of letting designers build themes using |
I've just looked at the amount of changes that have been since this PR was active and I've decided to abandon this PR as it's too old now. |
@pflannery I didn't realize you had implemented it in such a way, nice! Using native css variables was just a selection as they can then be manipulated from the javascript side more easily. I hope this comes back soon in a new PR, would be really cool to have! |
@pflannery what is the name of the third theme in the first screenshot? |
@kruncher It was an example theme (example-2) I made with this PR to show this change working |
@pflannery it looks awesome; I'd totally use that as my theme! I love the icon style as well. Thanks, I will see if I can modify an existing .tmTheme file to make this work. |
Relates to #211
Adds ability to create color and icon themes using css.
Adds ability to create an icon theme (css only).
Adds ability to switch icon theme's independently of color themes
Doesn't break current textmate themes
Examples of icon themes mixed with different color themes: (icons probably not to be included in the final merge)
![dark-plusiwth-icons](https://cloud.githubusercontent.com/assets/1727302/13712522/00e9ed88-e7bc-11e5-9906-2c0954ccd6af.png)
![untitled](https://cloud.githubusercontent.com/assets/1727302/13712707/1119830c-e7bd-11e5-99a1-ac6fc5986c4e.png)
![monokai-icons-with-quiet-light](https://cloud.githubusercontent.com/assets/1727302/13712525/05629de2-e7bc-11e5-81b9-3c8bd3ecedd7.png)