Comments (8)
I've tested a few more things and it appears to pass through the entire text but strips out the ;
at the start section url("data:image/png;base64
which breaks it.
from obsidian-style-settings.
@damiankorcz can you post a sample of your style settings yaml with the data url?
from obsidian-style-settings.
@mgmeyers
Putting the base64 in the default:
appears to keep the ;
in the text field for the setting in the Style Settings tab.
However it appears undefined in Dev Tools preventing it from working:
I've tried doing default: url()
and pasting the data into the text field but that's when it strips out the ;
as soon as click on another tab in the settings and then back to Style Settings.
This appears to create the variable correctly in this case as shown below but without the ;
it won't work:
Here is a sample of one of the settings I'm trying to use this for:
P.S.
I'm using two separate settings for standard URL and Base64 however the formatting is the same so if I use a standard URL to an image in the setting provided it works just fine.
from obsidian-style-settings.
Hmm, what happens if you wrap your default value in single quotes?
Eg:
-
id: custom-vault-banner-icon-base64
title: Vault Banner Icon (Base64)
description: Customise the Vault Banner Icon. Use the format in the Default below for an Online image. Use the following format to point to a local file - url("app://local/C://Obsidian/Vault Name/Vault Icon.jpg").
type: variable-text
default: 'url("data:image/png;...")'
from obsidian-style-settings.
The same thing happens as when I don't wrap it with single quotes. It just removes the single quotes and passes it without them in Style Settings.
from obsidian-style-settings.
@mgmeyers Just to follow up with a few more things I've found:
I appear to have this issue with a normal URL link as well, however it seems to be an issue with the default:
value only.
I also tried wrapping just the URL itself with ' '
and " "
to see if that would make a difference but it's the same. I also tried both with the single quotes around the whole string like you suggested previously but I get the same behaviour.
The strangest thing with this is that it grabs the string that is in the default:
and even displays it correctly in the Style Settings text box and the small text under the description but it doesn't work, however if I copy the string it's displaying in Style Settings text box and paste it over itself it starts to work.
Also any other URL I manually type in or paste works in this case unlike with the Base64 value.
from obsidian-style-settings.
@damiankorcz I just realized I forgot to check: did you define your variable in CSS as well? Style settings will only override variables, not set their initial value, so you'd have to do something like this:
/* @settings
name: testing
id: testing
settings:
-
id: custom-vault-banner-icon-base64
title: Vault Banner Icon (Base64)
description: Customise the Vault Banner Icon. Use the format in the Default below for an Online image. Use the following format to point to a local file - url("app://local/C://Obsidian/Vault Name/Vault Icon.jpg").
type: variable-text
default: url("data:image/png;base64,....")
*/
:root {
--custom-vault-banner-icon-base64: url("data:image/png;base64,....");
}
from obsidian-style-settings.
@mgmeyers Well that's embarrassing on my part๐ . I wasn't sure if I needed to have default variables defined in the CSS as well as the YAML so that is my bad.
Right so that fixed the default. It now works correctly but trying to change it in the Style Settings still strips the ;
from the Base64 text. Reverting back to default when I try to change it to something else also works now.
So should I have default variables set in the :root
for all variables I use in Style Settings as well as in the default:
of each property in the YAML?
The only thing I noticed is that sometimes I'll test and change a bunch of options in Style Settings and when I click the Reset all settings to default
button at the root of the theme settings it doesn't quite change everything back. If I then refresh through Dev Tools or restart Obsidian it's all back to default as expected. Would defining them in the :root
be the solution as well?
Thank you for sticking with me to solve this btw. I appreciate it!
from obsidian-style-settings.
Related Issues (20)
- When RESTARTED, the SCROLLBAR style would be RESETED to 'Obsidian Default'
- Bug / Feature Request: Bold and Italic CSS variables to show in Blockquotes in Live Preview mode
- Change top margin of notes?
- Feature Request: Ribbon Style
- No Color Override for Maroon HOT 4
- Feature Request: Not change the default link color
- FR add obsidian uri for local files
- where folder in my desktop I should add file css? HOT 1
- Highlight Colour Not Changing in Mobile
- Horizontal scroll on Code Blocks HOT 1
- Create starter file using the plugin itself
- Slows down Obsidian
- HUGE BUG: Background is Dark-Purple instead of BLACK on Many Dark Themes ! HOT 1
- suddenly the task checkboxes and some other boxes are pure white instead of grey
- Theme Request: Catppuccin HOT 1
- Implementation suggestion: Preview below the title HOT 1
- With Minimal theme, editing text in table cell always places cursor at cellโs left edge HOT 1
- Obsidian Update to 1.5.8 breaks all custom styles HOT 1
- Is there a JSON schema for the config? HOT 1
- How to merge two settings definitions into one?
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-style-settings.