Giter Club home page Giter Club logo

Comments (2)

Jopp-gh avatar Jopp-gh commented on June 3, 2024

thanks.

Yes, to display icons you need to modify my snippet. All you need to do is to know your folder names and assign them an icon.

short demo:

  1. make a new folder in Obsidian and name that one Journal
  2. open the command palette cmd+p on Mac, should be ctrl+p on Win/Linux and type "reload" for "reload app without saving"
  3. You newly created folder (Journal) should have an icon now.

long demo

add your folder names:

  1. First of all, open folder-icons-v2.css in a text editor of your choice.
  2. consider this snippet is organized in 2 parts: the top section stores all available icons and after this section follows the ruleset section.
  3. now search for "Journal" down below in the rulesets and replace that name twice (this because of "light" and "dark" theme) WITH the name of one (1) of your folders
  4. open the command palette cmd+p on Mac, should be ctrl+p on Win/Linux and type "reload" for "reload app without saving"
  5. You folder should have an icon now.

Note, you can assign Multiple Names to an icon. See again the example rule for "--openbook-icon". This is one ruleset -block:

/* Journal, Education, Training */
body:not(.is-mobile).theme-dark .tree-item-self.is-clickable.nav-folder-title:is([data-path$="Journal"], [data-path$="Education"], [data-path$="Training"]):hover>.tree-item-inner.nav-folder-title-content::after {
    filter: inherit;
}

.nav-folder-title:is([data-path$="Journal"], [data-path$="Education"], [data-path$="Training"]) .nav-folder-title-content::after {
    content: var(--openbook-icon);
}

this ruleset contains: "Journal", "Education" and "Training". Replace these names inside body:not(.is-mobile).theme-dark and .nav-folder-title:is with names of your folders. (you've to do it twice because of "dark" and "light" theme)

Example: for simplicity, I renamed my folders to A, B and C:

body:not(.is-mobile).theme-dark .tree-item-self.is-clickable.nav-folder-title:is([data-path$="A"], [data-path$="B"], [data-path$="C"]):hover>.tree-item-inner.nav-folder-title-content::after {
    filter: inherit;
}

.nav-folder-title:is([data-path$="A"], [data-path$="B"], [data-path$="C"]) .nav-folder-title-content::after {
    content: var(--openbook-icon);
}

Now if you don't like the icon given to A, B and C, search the head part of my snippet for another icon name (eg --bookmark-icon) and replace the content: var(--openbook-icon); declaration with, content: var(--bookmark-icon);.

from obsidian-dune84.

Jopp-gh avatar Jopp-gh commented on June 3, 2024

I added a small tutorial on how to modify icons to my Wiki, under Folders.md
If you have further questions, feel free to ask.
And if my tutorial helped, you are welcome to close this bug report.

from obsidian-dune84.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.