Giter VIP home page Giter VIP logo

Comments (6)

albertoloscerritos avatar albertoloscerritos commented on July 18, 2024 1

Thank you, it worked perfectly.
image
image
Awesome plugin, thanks for the great work :)

from obsidian-color-palette.

ALegendsTale avatar ALegendsTale commented on July 18, 2024

Hello, thank you for the suggestions.

I have implemented the first and second ideas as new settings.

As for the third, that might be a little difficult since palettes are generated. The best I can think of right now might be generating random variables per color on each palette. That would result in a lot of random CSS variables though.

Or maybe variables that are generated based on user set aliases.

Is that what you had in mind?

from obsidian-color-palette.

albertoloscerritos avatar albertoloscerritos commented on July 18, 2024

Hi. First of all, thank you so much. Just tried the new update and it works great.
Regarding the third point of my original post, what I was suggesting was the ability of manually adding css variables. For example, when I create a css snippet to make a custom callout, I can change the background color in two ways
First

.callout[data-callout="custom"] {
    --callout-icon: lucide-layout-dashboard;
    background-color: rgb(22, 36, 220);
 }

In this case, the format of the color: rgb(22, 36, 220); is also accepted by you palette plugin i.e. I can manually copy that rgb line, paste it in your palette and it will work:
image
(third line)

The second way to change the background color of a callout is by using a css variable:

.callout[data-callout="custom"] {
    --callout-color: rgb(var(--ctp-sapphire)); 
 }

--ctp-sapphire is a variable defined in the theme I use. I use those variables a lot in snippets and so on, because those colors change depending on the "flavor" of the theme I use. So --ctp-sapphire in light mode is not the same color as --ctp-sapphire in dark mode. That is helpful because when creating, for example, custom callouts the color palettes will update automatically. And this is what I can't do with your plugin. If I add that variable rgb(var(--ctp-sapphire)); to one palette it won't detect the color:
image
(first line).
I know this may be something very niche, I just tough it would be a cool idea.

Also, this may be intended behavior, but I noticed that palettes wont detect color in rgb format if there is no spaces between the number i.e.
rgb(0,250,250); this won't work
rgb(0, 250, 250); this works

Thanks for the awesome job :)

from obsidian-color-palette.

ALegendsTale avatar ALegendsTale commented on July 18, 2024

Thank you for letting me know of the spaces issue. A fix will be coming for it soon.

Aha I understand what you mean now. I did some experimentation before, and I definitely could hack together a system for variables, including checking their validity. I would need a fair amount of time to ensure the validation is correct though.

Therefore, I was thinking of alternative solutions and came up with a simple idea for "overrides". It could be a new setting which lets users override the validation system so that they could use any inputs they want for colors. This would of course include CSS variables, as the colors in palettes are directly input as CSS.

I'd appreciate your thoughts on this as an alternative.

from obsidian-color-palette.

albertoloscerritos avatar albertoloscerritos commented on July 18, 2024

Hi, I hope you are having a great Monday.
The option for the "overrides" sounds awesome. As you mentioned, that will allow the use of CSS variables :)

from obsidian-color-palette.

ALegendsTale avatar ALegendsTale commented on July 18, 2024

The latest release includes the new override setting. It can be toggled directly in palette settings or globally. Enjoy :)

from obsidian-color-palette.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.