Home

Awesome

logseq-custom-files

custom.js and custom.css utilities for Logseq.

Current Version v20240317

Query table view resizer :

Add handles on the query table headers to resize column width

20220312_NUC8_M49yriOEAH

Namespace prefixes collapser :

Collapse namespace prefixes eg: [[prefix/page/test]] becomes [[../test]] (use the hover tootip to see the original name or enter edit mode)

20220314_NUC8_cMu56YIkrd

Twitter embeds :

Fetches and embeds tweets and timelines without using logseq's internal syntax {{tweet https://twitter.com/username/status/id}}. Instead, you can just write the tweet url inline.

Benefits:

A demo with Logtool's kanban css to display latest tweets :

Logseq_DASHBOARD_20220517_1586

Better sidebar :

Enhance the right sidebar by replacing the vertical scroll with horizontal panes which are collapsible and resizable. Inspired by the sliding panes/matuschak mode with improved usability.

This works in conjunction with a custom.js snippet. If you don't want to use this sidebar mod, you need to REMOVE the better-sidebar javascript (edit the custom.js and comment out or remove the lines)

ss_Logseq_All_pages_20230213_V5ihMcrohP

How-to use/install

No exisiting custom.css/custom.js

If you are not using any custom.js1 or custom.css, copy the files into your %graph-name%/logseq/ folder.

Existing custom.css/custom.js

Alternatively, if you don't want to overwrite your current files or are only interested in some of the utilites :

  1. Open the desired file with a text editor/code editor
  2. Copy-paste the relevant sections into your own custom.js/custom.css files. Some utilities require to copy sections from both custom.js and custom.css to work. Make sure to include the mutation observer declaration at the start of the custom.js)
  3. Use the search function to find the relevant snippets delimited by comments with descriptive names. For custom.css, it's possible to add @import url("https://cdn.jsdelivr.net/gh/cannibalox/logseq-custom-files@latest/custom.css"); at the beginning of your file.

Help me improve the utilities

More js snippets and css customizations are coming soon, stay tuned

changelog

Footnotes

    • custom.js has been introduced in logseq on 2021-11-10, see details here https://github.com/logseq/logseq/pull/2943
    • The custom.js file is not created by the default installer; it has to be created manually in /logseq.
    • Before executing the code, the user will be asked for execution permission.
    • When the content of the custom.js file is modified, it needs to be restarted or refreshed to take effect.