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

Option to add colors for headers from theme #141

Open
d9k opened this issue Nov 22, 2023 · 3 comments
Open

Option to add colors for headers from theme #141

d9k opened this issue Nov 22, 2023 · 3 comments

Comments

@d9k
Copy link

d9k commented Nov 22, 2023

Please add option to apply headers colors from theme (--h1-color, --h2-color, ...etc)

It's much easier to see current level and navigate:

before after
Selection_2023-11-22_21-56-18 Selection_2023-11-22_21-55-56

Also selected header font weight must not differ from font weight of non-selected items.
Because different font weight of selected item forces quiet outline tree markup to "jump" back and forth on scrolling: 1-line item sometimes becomes 2-lines item on different font weight

@d9k
Copy link
Author

d9k commented Nov 22, 2023

My quiet-outline-plugin-mod.css snippet (can be added in Obisidan options -> Appearance -> CSS snippets)

/** Headers color */

.quiet-outline .n-tree .n-tree-node.level-1 > .n-tree-node-content .n-tree-node-content__text,
.quiet-outline .n-tree .n-tree-node.level-1 > .n-tree-node-content .n-tree-node-content__text a.tag {
  color: var(--h1-color);
}

.quiet-outline .n-tree .n-tree-node.level-2 > .n-tree-node-content .n-tree-node-content__text,
.quiet-outline .n-tree .n-tree-node.level-2 > .n-tree-node-content .n-tree-node-content__text a.tag{
  color: var(--h2-color);
}

.quiet-outline .n-tree .n-tree-node.level-3 > .n-tree-node-content .n-tree-node-content__text,
.quiet-outline .n-tree .n-tree-node.level-3 > .n-tree-node-content .n-tree-node-content__text a.tag{
  color: var(--h3-color);
}

.quiet-outline .n-tree .n-tree-node.level-4 > .n-tree-node-content .n-tree-node-content__text,
.quiet-outline .n-tree .n-tree-node.level-4 > .n-tree-node-content .n-tree-node-content__text a.tag{
  color: var(--h4-color);
}

.quiet-outline .n-tree .n-tree-node.level-5 > .n-tree-node-content .n-tree-node-content__text,
.quiet-outline .n-tree .n-tree-node.level-5 > .n-tree-node-content .n-tree-node-content__text a.tag{
  color: var(--h5-color);
}


/** Selected node */
.quiet-outline .n-tree-node.located {
  background-color: #16332d;
}

.quiet-outline .n-tree-node.located p {
  font-weight: 400;
}

.quiet-outline .n-tree-node.located p {
  color: unset;
}

@d9k
Copy link
Author

d9k commented Nov 22, 2023

Also see my CSS snippet to fix headers style in Obsidian for reference:

Main feature is that code, tags and links inside headers are the same color as the header containing them.

@bushnerd
Copy link

My quiet-outline-plugin-mod.css snippet (can be added in Obisidan options -> Appearance -> CSS snippets)

/** Headers color */

.quiet-outline .n-tree .n-tree-node.level-1 > .n-tree-node-content .n-tree-node-content__text,
.quiet-outline .n-tree .n-tree-node.level-1 > .n-tree-node-content .n-tree-node-content__text a.tag {
  color: var(--h1-color);
}

.quiet-outline .n-tree .n-tree-node.level-2 > .n-tree-node-content .n-tree-node-content__text,
.quiet-outline .n-tree .n-tree-node.level-2 > .n-tree-node-content .n-tree-node-content__text a.tag{
  color: var(--h2-color);
}

.quiet-outline .n-tree .n-tree-node.level-3 > .n-tree-node-content .n-tree-node-content__text,
.quiet-outline .n-tree .n-tree-node.level-3 > .n-tree-node-content .n-tree-node-content__text a.tag{
  color: var(--h3-color);
}

.quiet-outline .n-tree .n-tree-node.level-4 > .n-tree-node-content .n-tree-node-content__text,
.quiet-outline .n-tree .n-tree-node.level-4 > .n-tree-node-content .n-tree-node-content__text a.tag{
  color: var(--h4-color);
}

.quiet-outline .n-tree .n-tree-node.level-5 > .n-tree-node-content .n-tree-node-content__text,
.quiet-outline .n-tree .n-tree-node.level-5 > .n-tree-node-content .n-tree-node-content__text a.tag{
  color: var(--h5-color);
}


/** Selected node */
.quiet-outline .n-tree-node.located {
  background-color: #16332d;
}

.quiet-outline .n-tree-node.located p {
  font-weight: 400;
}

.quiet-outline .n-tree-node.located p {
  color: unset;
}

Thanks, it works well.

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