Added support for overriding CSS styles with STYLES page

This commit is contained in:
Zef Hemel
2023-02-28 10:07:20 +01:00
parent 91cc9a13c7
commit 288e67e380
15 changed files with 63 additions and 27 deletions
+2 -1
View File
@@ -6,6 +6,7 @@ release.
## Next
* Support template variables in a page template's `$name`
* Added support to override CSS styles on a per-space basis. This replaces the previous `fontFamily` setting. See [[STYLES]] for hints on how to use this new experimental feature.
* Reverted behavior of using up/down arrow keys to move between the page title and page content (and rename based on it). This resulted in undesirable behavior too often. You can now rename a page by clicking/tapping on the title, changing the name and hitting Enter or clicking anywhere outside the page title to apply the rename.
* Dependency upgrades
* Various bug fixes
@@ -36,7 +37,7 @@ release.
* Fixed copy & paste, drag & drop of attachments in the [[Desktop]] app
* Continuous [[Sync]]
* Support for embedding [[Markdown/Code Widgets]].
* Ability to set the editor font via the `fontFamily` setting in [[SETTINGS]] (restart the app/reload the page to make it go into effect).
* ~~Ability to set the editor font via the `fontFamily` setting~~ in [[SETTINGS]] (restart the app/reload the page to make it go into effect). **Update**: now done via [[STYLES]]
---
## 0.2.8
+12
View File
@@ -0,0 +1,12 @@
If you create a [[STYLES]] page in your project, SilverBullet will look for a CSS code block inside that page and load it upon boot (an example can be found below).
This can be used to achieve various things, such as overriding the default editor font, or setting wider page widths. What CSS styles you can override is not very well documented, youll have to reverse engineer things a bit for now, unfortunately.
```css
#sb-root {
/* Uncomment the next line to set the editor font to Courier */
/* --editor-font: "Courier" !important; */
/* Uncomment the next line to set the editor width to 1400px */
/* --editor-width: 1400px !important; */
}
```
+1 -1
View File
@@ -96,7 +96,7 @@ Click on the links below to explore various aspects of SilverBullet more in-dept
* [[CHANGELOG]]: Whats new?
* [[🔌 Plugs]]: extensions available for, and as part of SilverBullet
* [[💡 Inspiration]]: some of the projects that inspired SilverBullet
* [[Special Pages]]: a few page names in Silver Bullet have special meaning
* [[🔨 Development]]: how to start hacking on SilverBullet itself
## Support
+10
View File
@@ -0,0 +1,10 @@
SilverBullet has a few “special pages.” The convention is to always use ALL CAPS for these page names. Generally the format of these pages is that they can contain arbitrary text, but embedded in them is some sort of fenced code block (triple backtick blocks) that encode something special. What _exactly_ depends on the page.
All special pages except [[SETTINGS]] are optional: if they dont exist, well, they dont do anything.
Here are the current list of “special pages” known to humankind:
* [[SETTINGS]] for setting various settings
* [[PLUGS]] as a source for the plug manager to decide what plugs to load and where from
* [[VIMRC]] for tweaking [[Vim]] mode
* [[STYLES]] to override SilverBullet CSS styles (experimental)
+7
View File
@@ -0,0 +1,7 @@
As part of SilverBullets [[Vim]] support, the [[VIMRC]] page allows you to run a set of _ex_ commands on boot. To use this functionality, create a page in your space named [[VIMRC]] and put a fenced code block (as demonstrated below) with one ex command per line, for example:
```
imap jj <Esc>
```
To manually reload your [[VIMRC]] you can use the {[Editor: Vim: Load VIMRC]} command.
+1 -8
View File
@@ -2,11 +2,4 @@ SilverBullet has a basic Vim mode. You can toggle it using the {[Editor: Toggle
In addition, it supports various ex commands that you can run as you would expect, for instance: `:imap jj <Esc>`.
## VIMRC
SilverBullet also has the ability to load a set of these ex command on boot. To use this functionality, create a page in your space named [[VIMRC]] and put a fenced code block in it (similar to how this is done in [[SETTINGS]]) with one ex command per line, for example:
```
imap jj <Esc>
```
To manually reload your [[VIMRC]] you can use the {[Editor: Vim: Load VIMRC]} command.
Also, you can use [[VIMRC]]