Git Product home page Git Product logo

Comments (2)

holroy avatar holroy commented on June 22, 2024 2

If variables can't be supported, as mentioned in the Discord thread, if the user had some way of unsetting the color in the Settings UI, and we could put in empty defaults, that might achieve the same result too... and put less work on developers to figure out those default variable values should be.

I found that if I actually set the CSS variables using the var(--some-color) syntax, and then "hardcode" the color in the settings for Style settings, it'll actually be able to use the variable until you set the color with style settings, and if you reset to default settings it restore the usage of the variables. The only bad thing with this workaround, is that the color shown within style settings is not correct if you change the variable by changing theme or similar, as it's still being "hardcoded".

So I would still love for var(--some-color) to be understood as a default value.

from obsidian-style-settings.

chrisgurney avatar chrisgurney commented on June 22, 2024

I'm in the middle of adding support to my plugin as well, and I'm wondering the same thing.

Started a thread about this (before I saw this issue) on the Obsidian Discord here:
https://discord.com/channels/686053708261228577/702656734631821413/1228351103486394429

I first attempted to set an empty default (it only accepts '#') but the user can't reset to it.

Then I tried using Obsidian's variables:

default-light: var(--background-primary) or default-light: var(--color-base-00)

...but I am getting this error in the console:

Error: Toolbar background missing default light value, or value is not in a valid color format

If variables can't be supported, as mentioned in the Discord thread, if the user had some way of unsetting the color in the Settings UI, and we could put in empty defaults, that might achieve the same result too... and put less work on developers to figure out those default variable values should be.

from obsidian-style-settings.

Related Issues (20)

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.