Comments (6)
Thank you, it worked perfectly.
Awesome plugin, thanks for the great work :)
from obsidian-color-palette.
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.
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:
(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:
(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.
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.
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.
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)
- Convert URLs to HEX codes HOT 2
- styles.css is missing in release 1.1.0 HOT 1
- Is it possible to create gradient color? HOT 3
- Color palette no longer showing all colors. HOT 2
- plugin disabling tooltips across the app? HOT 1
- Feature request: custom name labels HOT 3
- Color palette: height is not changed after changing data.json HOT 7
- Feature request: More color representations supported by css styles HOT 4
- Error Message when using coolors.co link HOT 2
- now longer working in 1.5.12? HOT 4
- Help (or documentation) for width, direction, override needed HOT 4
- 2.12.0+ Canvas Bug with Plugin HOT 3
- how can i use Convert codeblock link to hex HOT 2
- documents with many color palettes are extremely laggy now HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from obsidian-color-palette.