ALegendsTale / obsidian-color-palette

Create and insert color palettes into your notes.
GNU General Public License v3.0
47 stars 2 forks source link

Help (or documentation) for width, direction, override needed #12

Closed merlinuwe closed 3 months ago

merlinuwe commented 3 months ago

Thanks for your great plugin which gives impressive results.

I tested it on Windows 10. Some of the following examples are unchecked, because I don't know how to use them. Can you help me, please?


- [x] `{"height": "40"}`

```palette
#FFC300, #FF5733, #C70039, #900C3F, #581845
{"height": "40"}
#FFC300, #FF5733, #C70039, #900C3F, #581845
{"width": "50"}
#FFC300, #FF5733, #C70039, #900C3F, #581845
{"direction": "column"}
#FFC300, #FF5733, #C70039, #900C3F, #581845
{"direction": "column", "width": "50"}
#FFC300, #FF5733, #C70039, #900C3F, #581845
{"direction": "row"}
#FFC300, #FF5733, #C70039, #900C3F, #581845
{"hover": true}
#FFC300, #FF5733, #C70039, #900C3F, #581845
{"hover": false}
#FFC300, #FF5733, #C70039, #900C3F, #581845
{"gradient": false}
#FFC300, #FF5733, #C70039, #900C3F, #581845
{"gradient": true}
#FFC300, #FF5733, #C70039, #900C3F, #581845
{"override": true, "aliases": ["yellow", "orange", "red", "dark pink", "dark red violet"]}
#FFC300, #FF5733, #C70039, #900C3F, #581845
{"aliases": ["yellow", "orange", "red", "dark pink", "dark red violet"]}


(Of course, you can take these examples for the documentations.)
ALegendsTale commented 3 months ago

Hello, thank you for creating this issue.

It would appear that the two unchecked palette examples with width are not functioning correctly in my own testing. Thank you for bringing this to my attention.

As for the unchecked palette with override, this setting is for overriding the color-validation system so that other things may be used (css variables for example). I will plan on updating the documentation to include these details.

ALegendsTale commented 3 months ago

Hello again, there is now better documentation. I have also fixed the issue with width not applying to regular palettes.

If there is anything missing from the documentation, feel free to let me know or submit a pull request. Thanks!

merlinuwe commented 3 months ago

Thank you very much.

One question: How does "override" work?

image

I get the message "Colors are defined incorrectly" when I switch true <-> false.

Could you please provide an example that works in Obsidian? Perhaps with an example from here: https://docs.obsidian.md/Reference/CSS+variables/Foundations/Colors which can't be overlooked.

ALegendsTale commented 3 months ago

Yes that's a great idea. I used --ctp-peach as an example, but that was silly as it is theme specific. I have updated the override docs with a couple examples.

Here is one example which was added to the docs. It uses a variable Obsidian itself has defined.

```palette
var(--color-orange)
{ "override": true }
```