Need help writing custom CSS for dynalist stylish "On Focus"

I suck at CSS / front end development, could someone please point me in the right direction?

Thereā€™s this stylish plugin here:

Essentially it lets you ā€œon focusā€ whatever current node you are on

What I want to do is write a customizable CSS that does the following:

  • On the current bulletpointā€™s Node-outer class, have the CSS ā€œon focusā€ the parent list bulletpoint and whiteout everything else
  • Ideally Iā€™d like for it to have a set delay maybe too, the ā€œon focusā€ effect only takes place after 10-15 seconds as Iā€™m writing the document. Its similar to the idea of ā€œZen modeā€ in app.classeur.io https://www.youtube.com/watch?v=F1X7NEafKro&feature=youtu.be.

This goes hand in hand with the layouts I made out navigating large lists / scability

Hereā€™s a quick mockup of what I want to achieve with the CSS

Unfortunately updating parents styles when something is done to children* is not possible in pure CSS. And currently dynalist also doesnā€™t mark Node-outer in any way when youā€™re working on nodes within it. But I think it can be done with custom JavaScript code injected through https://chrome.google.com/webstore/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo . I might play with it in the future, itā€™s a nice idea.


*It can only work with ā€˜hoverā€™ event, but itā€™s not good enough I suppose:

.is-currentRoot > .Node-children > .Node-childrenInner:hover > .Node-outer {
    opacity: .2;
    transition: 1.5s;
}
.is-currentRoot > .Node-children > .Node-childrenInner > .Node-outer:hover {
    opacity: 1;
}
1 Like

This works pretty well though, with the onhover, but I definitely want one based on where the current cursor is in dynalist (since I would definitely accidentally hover over things Iā€™m not working on)

All the settings related to opacity / transition are pretty much spot on for what I wanted

If you did have a tampermonkey script, how would you integrate this with stylish anyhow?

thanks for the help piotr :slight_smile:

also attached what it looks like on my screen:

EDIT Testing this a bit further, I think if somehow the tampermonkey script could use the unique URL I associated with it to do this ā€œOn focusā€ effect. This way if i zoom into a mode that doesnā€™t have lots of information this effect doesnā€™t take place. Or by default, set it to work only on the 1st / 2nd bulletpoint from root document

Iā€™ll probably experiment with this and write my own tampermonkey script to do this as well when i get around to it

I could see a lot of applications for this for other things like book writing in general

Tampermonkey gives you a lot of possibilities if you know JavaScript (I know a little bit). The problem here is that this is a dynamic application and AFAIK currently there is no way to listen to its events (onDocumentReady, onDocumentChanged, or sth similar) so itā€™s doable, but not as simple as with typical websites.

1 Like

Piotr I tested out your CSS code, this is how Iā€™m using it right now:

2 Stylish CSS styles

  • One specific Dynalist URL (my main wiki/project pages of everything) has the ā€œon hover effectā€
  • My regular CSS sheet for my entire dynalist file

This way I can just choose between which effect I want. E.G. If I want to see the big picture with fading, or navigate to a specific bulletpoint with no fading