You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+20
Original file line number
Diff line number
Diff line change
@@ -3,3 +3,23 @@
3
3
This repository contains the vault for the Obsidian Developer Docs.
4
4
5
5
A hosted version of this vault is available at https://docs.obsidian.md/.
6
+
7
+
## Contributing
8
+
9
+
**You can contribute in several ways**:
10
+
11
+
-**Fix typos and mistakes**: If you want to fix a typo or other small modifications, you can submit a pull request without creating an issue. For smaller edits, you can use the GitHub web interface instead of cloning the repository.
12
+
-**Add missing, outdated, or clarifying content**: If you want to add, remove, or expand on current content, please [submit an issue](https://github.com/obsidianmd/obsidian-developer-docs/issues/new) before you start working on it. We will let you know if this is something that should be worked on, or not.
13
+
- Any contributions to the docs must follow our [Style guide](https://help.obsidian.md/Contributing+to+Obsidian/Style+guide).
14
+
15
+
> [!warning]
16
+
> Any page in `References/TypeScript API` is automatically generated by scripts that pull from our codebase. We **can** accept issues on these files, but **cannot** accept direct PR's on them.
17
+
18
+
**To make changes to Obsidian Developer docs**:
19
+
20
+
- Fork the [obsidian-developer-docs](https://github.com/obsidianmd/obsidian-developer-docs) repository
21
+
- In the Obsidian vault switcher, select Open folder as vault
22
+
- Make your change in Obsidian
23
+
- Confirm the change is presentable in **Reading View**
24
+
- Commit your change to your fork
25
+
- Submit your PR to the obsidian-developer-docs repo for final review
Copy file name to clipboardExpand all lines: en/Home.md
+4-1
Original file line number
Diff line number
Diff line change
@@ -29,4 +29,7 @@ If you get stuck, or if you're looking for feedback, [join the community](https:
29
29
30
30
## Contributing
31
31
32
-
If you see any errors or room for improvement on this site, feel free to open an issue or pull request on [our GitHub repository](https://github.com/obsidianmd/obsidian-developer-docs). Thank you in advance for contributing!
32
+
If you see any errors or room for improvement on this site, or want to submit a PR, feel free to open an issue on [our GitHub repository](https://github.com/obsidianmd/obsidian-developer-docs).
33
+
Additional details are available on our [readme](https://github.com/obsidianmd/obsidian-developer-docs#readme).
Many of the [[CSS variables]] utilised in the Obsidian app can also be employed in Obsidian Publish (Publish), with corresponding selectors. However, to address to the differing requirements of Publish, the variables in this section were specifically created for Publish, and are to be inserted within the `.published-container` selector.
Copy file name to clipboardExpand all lines: en/Themes/App themes/Build a theme.md
+38-2
Original file line number
Diff line number
Diff line change
@@ -108,10 +108,46 @@ Themes can support both light and dark color schemes. Define your CSS variables
108
108
109
109
You'll see that Obsidian picks the colors based on the color scheme you've selected. Try changing the colors to `red`, `green`, or `blue` for a more dramatic change.
110
110
111
+
## Step 6: Change the input hover border color
112
+
113
+
The `:root` selector is commonly used when you want a variable to be accessible by every child element within the theme. This selector is often filled with Plugin variables.
114
+
115
+
Here's an example to illustrate its usage:
116
+
117
+
> [!example]
118
+
> Let's consider an input field that can be found in various places within Obsidian, such as settings and note content. To define the variables specific to this input field, we can use the `:root` selector.
119
+
>
120
+
> ```css
121
+
>:root {
122
+
> --input-focus-border-color: Highlight;
123
+
> --input-focus-outline: 1pxsolid Canvas;
124
+
> --input-unfocused-border-color: transparent;
125
+
> --input-disabled-border-color: transparent;
126
+
> --input-hover-border-color: black;
127
+
> /* Default Input Variables for Root */
128
+
> }
129
+
> ```
130
+
131
+
132
+
Now, let's modify the hover border color in our CSS:
133
+
134
+
```css
135
+
:root {
136
+
--input-hover-border-color: red;
137
+
/* Change from Black to Red */
138
+
}
139
+
```
140
+
141
+
With this update, when you hover over any input field, the border color will change to a bright red.
142
+
111
143
> [!tip]
112
-
> Define any style that should be the same for both light and dark under `body`. Only define styles under `.theme-dark` or `.theme-light` if they are specific to that base color scheme.
144
+
> When defining styles that should remain the same for both light and dark themes, it is recommended to use the `body` selector.
145
+
>
146
+
> Only use `.theme-dark` or `.theme-light` selectors if you want the styles to change when switching between light and dark themes.
147
+
>
148
+
> It's also important to use `:root` with caution and consideration. If your variable can be placed within `body`, `.theme-dark`, or `.theme-light` selectors instead, it is recommended to do so.
113
149
114
-
## Step 6: Discover CSS variables in use
150
+
## Step 7: Discover CSS variables in use
115
151
116
152
Obsidian exposes more than 400 different CSS variables for customizing different parts of the user interface. In this step, you'll find the CSS variable for changing the ribbon background.
Copy file name to clipboardExpand all lines: en/Themes/Obsidian Publish themes/Build a Publish theme.md
+26-5
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,7 @@
1
1
You can build themes for your [Obsidian Publish](https://help.obsidian.md/Obsidian+Publish/Introduction+to+Obsidian+Publish) site. Themes for Obsidian Publish use the same [[CSS variables]] as the Obsidian app along with [[CSS variables#Obsidian Publish|Publish-specific CSS variables]].
2
2
3
+
> [!tip] See [[Build a theme]] for more in-depth information on the `body`, `:root`, `.theme-dark`, and `.theme-light` selectors.
4
+
3
5
To build a theme for your site:
4
6
5
7
1. Add a file called `publish.css` to the root folder of your vault.
@@ -8,18 +10,37 @@ To build a theme for your site:
8
10
**Example:**
9
11
10
12
```css
13
+
:root {
14
+
--input-unfocused-border-color: transparent;
15
+
--input-disabled-border-color: transparent;
16
+
--input-hover-border-color: black;
17
+
18
+
/* ... By default, nothing is placed within :root in Publish. However, CSS variables here are considered global, and accessible to all sub-elements such as body and .theme-light. */
19
+
}
20
+
11
21
.published-container {
12
-
--readable-width: 1000px;
13
-
--bold-weight: 600;
14
-
/* ... CSS variables */
22
+
--page-width: 800px;
23
+
--page-side-padding: 48px;
24
+
25
+
/* ... CSS variables for Publish that do not change when light or dark mode is enabled. They sometimes link to color variables in .theme-light or .theme-dark */
26
+
}
27
+
.body {
28
+
--inline-title-color: var(--h1-color);
29
+
--h2-color: red;
30
+
31
+
/* ... CSS variables that do not change when light or dark mode is enabled. They sometimes link to color variables in .theme-light or .theme-dark */
15
32
}
16
33
.theme-light {
17
34
--background-primary: #ebf2ff;
18
-
/* ... CSS color variables for light mode */
35
+
--h1-color: #000000;
36
+
37
+
/* ... CSS color variables for when light mode is enabled */
19
38
}
20
39
.theme-dark {
21
40
--background-primary: #1f2a3f;
22
-
/* ... CSS color variables for dark mode */
41
+
--h1-color: #ffffff;
42
+
43
+
/* ... CSS color variables for when dark mode is enabled */
0 commit comments