Skip to content
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

Feature style settings #25

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

holroy
Copy link
Contributor

@holroy holroy commented Feb 12, 2024

This complements #2 to allow changing of various style attributes to be changed through the Style Settings plugin if that's installed. If it's not installed, all values will retain their default values.

If one would like to, one could of course extend which variables are to be set using the style settings option.

( The commit includes the compilation fixes which I also made PR for related to #23)

Added types to the file variables, and asserted they are of correct type. In addition pulled out the actual number of the date variables.
Here is a starter set for setting colors through the Style Settings plugin. Even if that plugin is not present, the variables have a default value which then will be used.
src/styles.css Outdated
--ht21-border-color: #363636;
--ht21-tick-height: 16px;
--ht21-tick-width: 20px;
--ht21-tick-color: #8a5cf5;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be assigned var(--checkbox-color) otherwise it will break HT24 in themes other than the default obsidian theme. the same applies to all the cases where a variable was used before: --ht21-border-width, --ht21-row-hover-color. Will that still work with the plugin you're trying to support?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure how to use a variable in this type of setting. Let me ponder a little on that, and feel free to suggest a solution if you see one. After all this is your project, and I just wanted to chip in on how to make it even better and more customisable.

@holroy
Copy link
Contributor Author

holroy commented Apr 12, 2024

Now I've reset the variables to match as closely as I could the default values and variables of Obsidian. Not entirely sure if the defaults are the same in light and dark mode. And after going a little bananas and changing the colors my habit tracker looked like this:
image

And even though the colors are hard-coded, I could reset and it would fall back and follow the variables, and it then looks like this:

image


In other words, if you leave it as default it'll follow the definition of the variabels within the chosen color scheme, and if you change any particular color that specific color (or setting) will be changed. And if you later on want to reset to default for either one or all settings it'll allow that as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants