UnoCSS
unlistedby Nólëbase
A Obsidian.md plugin that allows you to generate and apply UnoCSS and Tailwind CSS supported styles right in your notes.
Obsidian Plugin UnoCSS
[!NOTE] This is one of the plugins of the collections of plugins called Nólëbase Integrations. You can explore the other plugins in the collection in the official documentation site of Nólëbase Integrations.
Write your notes in Obsidian with UnoCSS.
🤔 Why
If you're not yet familiar with Nólëbase or the accompanying Nólëbase Integrations, let me introduce you. Nólëbase is an open-source knowledge base that utilizes VitePress for rendering, and it is a collaborative effort from its community of contributors.
To integrate Obsidian plugins with VitePress-rendered pages effectively, we launched the Nólëbase Integrations project. This initiative aims to create a suite of plugins that enhance the functionality of popular Obsidian plugins, enabling them to be able to work in the browsers as rendered pages.
When crafting documentation in Nólëbase, creating numerous visual components is crucial for enhancing the documents with dynamic and interactive user interfaces. This not only makes the content more digestible but also more engaging. Previously, Obsidian lacked the functionality to effectively integrate and apply styles from atomic CSS frameworks like Tailwind CSS and Windi CSS to HTML elements within its platform.
This is where Obsidian UnoCSS Plugin kicks in, it allows you to write your notes in Obsidian with UnoCSS. By doing so, it has built a bridge by allowing the use of sufficiently simple and user-friendly atomic CSS classes, which enhances the aesthetics and functionality of the notes and documents we write in Obsidian.
🎨 Features
- 🪄 Whatever UnoCSS supports.
- 📦 Out of the box supports for atomic CSS classes that used by famously known Tailwind CSS and Windi CSS.
- 🚀 Blazingly fast hot-reloading capabilities during editing.
- 🎁 Stunning icons from Iconify.
💡 What can you do with it
- Embed interactive components in your notes.
- Style your notes with atomic CSS classes.
- Use themes and color schemes from UnoCSS communities.
- Import the icons from Iconify.
- Animate your notes.
- Documenting color theories.
- Documenting UI/UX knowledge.
- Demonstrating the back scene of Mathemathics and Physics like manim
- And more...
📺 Demos
Show me what you can do
How it looks like
What is the markup like
It's all basic just a set of HTML.
[!WARNING] To learn more about what are the meanings of classes, I recommend you to use the documentation sites of Tailwind CSS and Windi CSS as references.
Hot-reloading capabilities in live preview mode
[!NOTE] To do so, you need to split your Obsidian view into two panes, and choose "Source mode" for the editing pane where you wanted to view and edit the HTML markup.
😎 How to install
[!WARNING] Currently Obsidian UnoCSS Plugin is in alpha stage, it wasn't guaranteed to work properly and keep the compatibility with the future versions of itself.
But it is encouraged to try it out and give feedbacks. If you find and bugs or have any suggestions, please feel free to open an issue on GitHub.
Currently, it is a bit hard to install the plugin for now before it is published to the official Obsidian plugin store. Manual downloading and installation is required.
Install with beta testing helper BRAT plugin
- Install the BRAT plugin right from the official Obsidian plugin store.
- Enable the BRAT plugin in the community plugins settings menu.
- Open Command palette to choose
BRAT: Plugins: Add a beta plugin for testing. - Copy and paste the following link to the first field of the new prompted dialog:
https://github.com/nolebase/obsidian-plugin-unocss
- Find the needed released version on Release page of Obsidian UnoCSS Plugin, for example, fill in
0.1.0. - Enable the "UnoCSS" plugin from the
Installed pluginslist.
Install manually
- Navigate to the Release page of Obsidian UnoCSS Plugin
- Find the latest version of the plugin.
- Download the
main.jsfile andmanifest.jsonfile. - Open up the
.obsidian/pluginsdirectory of your Obsidian vault. - If no
.obsidian/pluginsdirectory exists, create one. - Create a new directory named
obsidian-plugin-unocssinside the.obsidian/pluginsdirectory. - Move
main.jsfile andmanifest.jsonfile into theobsidian-plugin-unocssdirectory.
The directory structure should look like this after these steps:
❯ tree
.
├── main.js
├── manifest.json
- Enable the "UnoCSS" plugin from the "Installed plugins" list.
⏳ TODOs
- Auto completion for CSS classes.
- Annotation decoration for UnoCSS identifiable classes.
💻 How to develop
- As Build a plugin - Developer Documentation has suggested, create a separate vault for development.
- (Optional) Install the hot-reload plugin: pjeby/hot-reload.
- Create a
.obsidian/pluginsdirectory in the vault root. - Clone this repository into the
.obsidian/pluginsdirectory. - Install dependencies
pnpm install
If you use @antfu/ni, you can also use the following command:
ni
- Build the plugin
pnpm run build
If you use @antfu/ni, you can also use the following command:
nr build
- Reload Obsidian to see the changes. (If you use the hot-reload plugin, you don't need to reload Obsidian manually.)
Reloading can be called from the command palette with
Reload app without savingcommand.
🔨 How to build
pnpm run build
If you use @antfu/ni, you can also use the following command:
nr build
Written with ♥
For plugin developers
Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.