-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
enhance: Adding logseq.text-color::
block property
#10316
base: master
Are you sure you want to change the base?
Conversation
- extracting property and parsing type
IMHO, I prefer not to add too many customizations to Markdown or property.
CC @xyhp915 |
With "props like text-color::" do you refer to a set of html styles, like text-color, text-font-family, text-font-size, etc.? If that's the case, I can create a new subset of
Yeah, it's true that, in HTML, a node style is pretty difficult to override as it has a very high priority. It would be better to add a class or data-* to make it easier for themes to adapt it. Nevertheless, I'd add a default set of CSS rules in If this new proposal looks fine to be merged, I'll code it this weekend. |
Hi @daviddavo. Thanks for the contribution. I'll defer your questions to @andelf and @xyhp915. It's worth noting that #10132 will add a number of colors so it's probably worth holding off on adding colors until those are in
Regardless of which approach we go with, we'll need to rename the property to have a |
Yes, In the meantime I could just implement the property per se and the "fallback" to HTML colors, and then when cmdk is merged use those colors too. |
Currently, it is customizable by editing the logseq/src/main/frontend/common.css Lines 98 to 104 in d0655ba
Using .ls-block {
...
&[data-logseq-property-text-color] {
color: attr(data-logseq-property-text-color color);
}
} But it's not yet supported by any browser. If we use .ls-block {
...
&[data-logseq-property-text-color="red"] {
color: ...;
}
&[data-logseq-property-text-color="green"] {
color: ...;
}
.
.
.
} And it would not support custom HTML colors like I think a good compromise would be using the But I would have to move it to the logseq/src/main/frontend/components/block.cljs Lines 1966 to 1978 in 30172a8
Keep in mind that I coded it this way because I wanted to be consistent with the way the Furthermore, because currently, it uses |
Tldr of my previous post:
|
Now the way of modifying the
As I see it now I have to declare a new set of 7 variables in
Imho I would use the first approach as its similar to what it has been already done with cc @xyhp915 (I see in git blame that he was in charge of some related code) |
Done with radix-11. I still prefer the vars-classic approach (see commit 8b02041 ) Ready for review. Btw, I'm still on board about refactoring background-color, just say if you prefer to do it in this PR or in another one. |
text-color::
block propertylogseq.text-color::
block property
Hi @daviddavo I'm sorry for replying so late. This feature is a great idea, but after careful consideration, it may not be possible to merge it into the |
Thank you! I'll be happy to learn about the db feature when it is merged and do the necessary changes! |
I created a
text-color
property to set the text color of a block, allowing builtin colors like the highlight. This property is "hidden" but editable. Called ittext-color
to avoid ambiguity with the pagecolor
property, and be more explicit differencing it withbackground-color
.What do you think of these colors? Should I change them, or are they fine?