Skip to content

Commit

Permalink
change manifest
Browse files Browse the repository at this point in the history
  • Loading branch information
imshenshen committed Jan 22, 2024
1 parent 49baabd commit 3178f00
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ https://github.com/imshenshen/obsidian-sticky-heading/assets/19701958/12f8e9c6-f


## config
when use different theme, the space of sticky heading is different, so
you need install [Style Settings plugin](obsidian://show-plugin?id=obsidian-style-settings) , allows you to config top space when sticky.
![](https://github.com/imshenshen/obsidian-sticky-heading/assets/19701958/7ffbe469-053c-487a-af50-0b11b3a47e71)

Expand Down
3 changes: 1 addition & 2 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@ export default class MyPlugin extends Plugin {

// This adds a settings tab so the user can configure various aspects of the plugin
// this.addSettingTab(new SampleSettingTab(this.app, this));

this.registerEditorExtension([HeadingPlugin()])
this.app.workspace.trigger("parse-style-settings")
this.registerEditorExtension([HeadingPlugin()])

}

Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"id": "obsidian-sticky-heading",
"id": "sticky-heading",
"name": "Sticky Headings",
"version": "1.0.0",
"minAppVersion": "0.15.0",
Expand Down
18 changes: 11 additions & 7 deletions styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,26 @@ If your plugin does not need CSS, delete this file.

/* @settings
name: obsidian-sticky-heading
id: obsidian-sticky-heading
name: sticky-heading
id: sticky-heading
settings:
-
id: obsidian-sticky-heading-top-space
id: sticky-heading-top-space
title: top space when sticky
description: when sticky, how much space should be left at the top of the screen. like 5px, -1rem, etc.
type: variable-text
default: 0px
default: calc(-1 * var(--size-4-8));
*/

body {
--sticky-heading-top-space: calc(-1 * var(--size-4-8));
}

.obsidian-sticky-heading {
position: sticky !important;
top: var(--obsidian-sticky-heading-top-space);
background-color: var(--titlebar-background) ;
top: var(--sticky-heading-top-space);
background-color: var(--titlebar-background);
z-index: 1;
}

Expand All @@ -38,5 +42,5 @@ settings:
font-weight: normal;
color: var(--text-faint);
font-size: 14px;
background-color: var(--background-primary) ;
background-color: var(--background-primary);
}

0 comments on commit 3178f00

Please sign in to comment.