Replies: 18 comments 22 replies
-
Hey @esm7
Lots of thoughts:
|
Beta Was this translation helpful? Give feedback.
-
Full thumbs up for working on user-focused documentation to this, with all the points that you wrote. About the performance impact: being sure requires some measurements (and I don't mind to take measurements of before & after), however I doubt that more details in the actual rendering will have a meaningful performance toll. Electron's renderer is very fast and rendering the same data using some more This is probably negligible compared to what it takes to run a query -- most notably (I assume) iterating over thousands of tasks. This too requires measurements, maybe I'm completely wrong here, but my hunch says that if we add simple code in |
Beta Was this translation helpful? Give feedback.
-
I should also have noted, @esm7, that I believe that @sytone has added various extra CSS classes for displaying tasks in his fork of Tasks: https://github.com/sytone/obsidian-tasks-x. We have agreed to try and keep open the option of incrementally merging some of his changes back to Tasks and trying to keep them compatible. I can't see anything about his new style classes in his docs - unsure if I'm missing anything obvious. Anyway, for any classes you were planning to add, we should explore if he added them already, and if so, keep the class names and the code as consistent as possible. Diffing of the two code bases is complicated slightly by the fact that he has:
I am holding off doing those things in Tasks until all the existing PRs are merged or closed... |
Beta Was this translation helpful? Give feedback.
-
@sytone can you elaborate or point me at those mentioned CSS classes, so I can make this change as compatible as possible? On a different note, perhaps now that boolean queries are merged, SQL queries are not as important as they used to be. |
Beta Was this translation helpful? Give feedback.
-
@esm7 I know very little CSS (essentially the MDN CSS modules, staring at various snippets in Obsidian, and a few blogposts) so please read this as a beginner's question: will adding "div" (or "span" I guess) for components of the task text's display alter the "inline" vs "block" nature of the task text "li" overall? More classes for styling options sounds like fun! |
Beta Was this translation helpful? Give feedback.
-
No, |
Beta Was this translation helpful? Give feedback.
-
I am an Obsidian beginner (who tries to read the docs 😉) and have some CSS background. I am looking forward to seeing the implementations suggested here. For now, I would like to know wheter it is possible to do add a custom css class to the DIV containing the whole query block.
Thanks for the support! 😊 |
Beta Was this translation helpful? Give feedback.
-
This is very important to me too and I'm disappointed for not being able to work on it yet, but I have high confidence that we'll have this (at least in a PR stage) within 2-3 weeks :) |
Beta Was this translation helpful? Give feedback.
-
A quick update for everybody waiting on this, including myself! |
Beta Was this translation helpful? Give feedback.
-
Hey, just wanted to drop by and update that although much later than expected, I started working on this today :) |
Beta Was this translation helpful? Give feedback.
-
I've noticed recently that a few plugins allow their behaviour to be customised via the Style Settings plugin: For example, Buttons: I've no idea whether this work might enable that capability for the Tasks plugin, or if the changes on this feature could be done in a way that could be compatible with the Style Settings plugin... Or if this is all something completely independent... But I wanted to at least mention the idea, just in case it might enable many more people to take advantage of the styling options that will be opened up than just those comfortable with CSS snippet files.... |
Beta Was this translation helpful? Give feedback.
-
This seems substantially easier than a 'theme' setting I was considering to add. Thank you, will look into it. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Quick update and a follow-up discussion.
|
Beta Was this translation helpful? Give feedback.
-
I had a quick look at the branch - I only had time to look in the GitHub diffs view so didn't follow the changes in detail. I presume the yarn.lock change was for your own convenience on your branch, and not something that will be in a PR....
Sounds good.
Good question. I don't know yet. I'm not sure that I even really know what to expect yet in the short term, yet alone in the long term. One thing I would really like is for users to have ways to control the appearance of their results with needing to futz around with CSS snippets. I see that as a separate thing from the current work though, that is, something that builds on the current work. I am not sure, but I think I would like to wait for a little while and see what kinds of styling ideas users come up with. It would be worth looking through the discussions and feature requests to see what kinds of things users have requested in the past, styling wise.
Oooohhh - I guess that answers what I said above. Yes please! You are right above the governing of the themes. Are there other plugins that have done similar things? Can anything be learned from them? Actually, I suspect the word "themes" is likely to confusion, given the ambiguity with Tasks' own theme system. So best avoided. Style?
The two existing possibilities are:
Maybe i'm being a bit too cautious - I certainly don't want to cramp your style.
Interesting. You are way ahead of me! |
Beta Was this translation helpful? Give feedback.
-
Related discussion: #1358 |
Beta Was this translation helpful? Give feedback.
-
This has now been released in Tasks 3.0.0. Huge thanks to @esm7 for this tremendous body of work! Find out more in the comprehensive user docs. |
Beta Was this translation helpful? Give feedback.
-
Hey,
Now that auto-complete (#822) and boolean queries (#852) are behind us, the next thing I wanna do for Obsidian Tasks is to make it much more CSS friendly.
We're not gonna continue letting all those Todo apps out there look better than our awesome queries, are we? 😉
What I had in Mind
From an infrastructure point of view, what
QueryRenderer
is missing is to communicate more information to the rendered HTML, so it can be beautifully themed with CSS.Specifically, what I think that needs to be changed is:
div
s -- one for the description, another for the due date, another for recurrence, adiv
for each single tag, etc.Task
object should be communicated as HTML classes, both in the task's main div (the one that contains all the components) and in each individual component. For example a task with medium priority should havepriority-medium
in itsdiv
class and also thediv
that hosts the priority text should havepriority-medium
class as well.task-due0d
for tasks due today,task-due1d
for tasks due tomorrow,task-due2d
for tasks due in 2 days,task-due-1d
for tasks due yesterday,task-scheduled0d
for tasks scheduled today -- you get the idea.For example, the following task:
- [ ] #task Fix the bugs in the latest release ⏫ 📅 2022-07-11 #atWork
Should be rendered this way by
QueryRenderer
:task-priority-high
,task-due1d
,task-#atWork
task-description
)task-priority
,task-priority-high
)task-due
,task-due1d
)task-tag
,task-#atWork
This can effectively render to the exact same look as current queries do. As default, or for users who want to keep things the way they are, the look of queries will not change at all if so you wish.
But...
Why We Should Do It
With the above example, individuals or theme designers can do wonders.
That's my general idea (well, ok, it's more than general 😆 )
(I actually tried to do this about 2 weeks ago, thinking it's a low-hanging fruit, but failed miserably 😃 now I'm back with conclusions...)
@claremacrae, would love to get your feedback about whether you welcome this change, and any other insights of others too of course!
Beta Was this translation helpful? Give feedback.
All reactions