Skip to content

Commit d00ab6f

Browse files
committed
add snippet customization example
1 parent 7fa41bf commit d00ab6f

File tree

4 files changed

+15
-2
lines changed

4 files changed

+15
-2
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ meta.txt
2929

3030
exampleVault/.obsidian/*
3131
!exampleVault/.obsidian/plugins
32+
!exampleVault/.obsidian/snippets
3233

3334
exampleVault/.obsidian/plugins/*
3435
exampleVault/.obsidian/plugins/obsidian-meta-bind-plugin/*
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/* A snippet that turns a progress bar input field red */
2+
.mb-input-type-progressBar.red-progress-bar .mb-progress-bar-progress {
3+
background: var(--color-red);
4+
}
5+
6+
/* A snippet that turns a button green */
7+
.mb-button.green-button > button {
8+
background: var(--color-green);
9+
}

exampleVault/Buttons/Button Example.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@ text `BUTTON[docs-button, docs, open-button]` text
1414
BUTTON[docs-button]
1515
```
1616

17-
asase
17+
With a custom class and a CSS snippet we can change the button to be green.
1818

1919
```meta-bind-button
2020
style: primary
2121
label: Open Meta Bind FAQ
22+
class: green-button
2223
action:
2324
type: command
2425
command: obsidian-meta-bind-plugin:open-faq

exampleVault/Input Fields/Progress Bar.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ INPUT[progressBar(showcase, minValue(0), maxValue(10), stepSize(-1)):progress3]
2121
INPUT[progressBar(showcase, minValue(0), maxValue(10), stepSize(0.1)):progress4]
2222
```
2323

24+
With some snippets we can change the color of the progress bar.
25+
2426
```meta-bind
25-
INPUT[progressBar(defaultValue(53), class(red))]
27+
INPUT[progressBar(defaultValue(53), class(red-progress-bar))]
2628
```

0 commit comments

Comments
 (0)