CSS Inlay Colors

by Benji Grant
5
4
3
2
1
Score: 54/100

Description

Category: Customization & UI

The CSS Inlay Colors plugin enhances the visual experience in Obsidian by displaying inline color hints for CSS color codes. Users can input any valid CSS color syntax, and the plugin renders a corresponding color block inline, making it easier to visualize and manage color styles within code blocks. A color picker feature allows users to edit colors directly in live preview mode, preserving the original format and opacity settings. The plugin also supports customization, enabling users to style the inlays by targeting the .css-color-inlay class with custom CSS.

Reviews

No reviews yet.

Stats

28
stars
4,294
downloads
0
forks
627
days
149
days
149
days
23
total PRs
0
open PRs
1
closed PRs
22
merged PRs
9
total issues
2
open issues
7
closed issues
47
commits

Latest Version

5 months ago

Changelog

[1.4.1]

Bug Fixes

  • 4394998 Fix color strings with uppercase letters not being recognised

README file from

Github

Obsidian CSS Inlay Colors

GitHub Release Checks Obsidian

Show inline color hints for CSS colors in Obsidian.

To use, just put any valid CSS color syntax in a code block like so: `#8A5CF5`.

Features

Color Picker

Enable the color picker setting to change a color using a color picker in live preview mode. Note that the color picker does not support opacity, and will only let you select from sRGB colors. It will attempt to preserve the existing format you have written, as well as any existing opacity.

Copy On Click

By default, colors can be copied to the clipboard by clicking on them. This only works in reading mode, and can be disabled in the plugin settings.

Hide Color Names

Surround a color with square brackets (`[#663399]`) to hide the color name and only show the inlay swatch in live preview and reading mode.

There's also an option in the plugin settings to hide all color names globally.

Custom Palettes

This plugin supports custom color palettes which you can use by enabling the setting and creating a CSS snippet file that targets the palette names you want to support.

Enabling the setting exposes classes for every inline code block surrounded by parentheses, replacing all spaces with hyphens, and converting to lowercase. For example, `(RAL 170 50 10)` exposes the class .ral-170-50-10. If that class gets a color set, it will show a color inlay.

Note, the plugin detects classes that target .css-color-inlay only, see the example below.

.css-color-inlay.my-cool-color { color: #663399; }
/* Or, use CSS nesting */
.css-color-inlay {
  &.my-hot-color { color: orangered; }
}
/* Now `(my cool color)` and `(my hot color)` will have inlays */
Predefined Palettes

There are 6 predefined color palettes you can download using the button in the settings, and it includes the following:

  • AutoCAD Color Index
  • Australian Color Standard (AS 2700)
  • British Standard Colors (BS 381, BS 4800)
  • Federal Standard (FS 595C, ANA)
  • RAL Colors (Classic, Design, Effect, Plastics)

Custom CSS

Customize the inlays by targeting the .css-color-inlay class. For example, you can make them circular with the following snippet:

.css-color-inlay {
  border-radius: 100px;
}

Development

This project uses Biome for linting/formatting and pnpm for package management. Run pnpm dev to build on changes.

Similar Plugins

info
• Similar plugins are suggested based on the common tags between the plugins.
Snippetor
4 years ago by ebullient
An assist for creating CSS snippets for Obsidian
Group Snippets
4 years ago by Mara-Li
Create folder of snippets to activate them in one click !
Dynamic Background
4 years ago by Samuel Song
Adding dynamic background effects to the Obsidian editor
File Color
3 years ago by ecustic
An Obsidian plugin for setting colors on folders and files in the file tree.
Quote Share
3 years ago by DuocNV
Generate beautifull image from Obsidian.
Canvas CSS class
3 years ago by Lisandra-dev
A plugin that will add a css class to your canvas & adding to each canvas the path to help personnalization
Hyphenation
3 years ago by 7596ff
Enables justified text and hyphenation
Colored Text
3 years ago by Erinc Ayaz
Style Text
3 years ago by Juanjo Arranz
Apply custom CSS styles to selected text in your Obsidian Notes
Colored Tags
3 years ago by Pavel Frankov
Colorizes tags in different colors.
Color Palette
3 years ago by ALegendsTale
Create and insert color palettes into your notes.
Colored Tags Wrangler
2 years ago by AndreasSasDev
Obsidian Plugin : Assign colors to tags. Has integrations with other plugins, like Kanban.
Canvas Card Background Remover
2 years ago by luxmargos
This Obsidian plugin allows you to make the background of cards transparent in the Canvas for specific embed types, including Image (png), Canvas, and even Markdown.
Additional Icons
2 years ago by Matthew Turk
Add additional iconsets to Obsidian
Color cycler
2 years ago by Taylor Brennan
Plugin for Obsidian to dynamically change the accent color
Regex Mark
2 years ago by Mara-Li
CSS Inserter
2 years ago by Erika Gozar
Inserts user-defined css snippets into the selected text.
Minimal Theme Settings
5 years ago by @kepano
Settings plugin to control colors and fonts in Minimal Theme
css snippets
5 years ago by Daniel Brandenburg
Obsidian plugin for css snippets
Snippet Commands
5 years ago by death_au
Registers custom css snippets as commands (which you can bind hotkeys to)
MySnippets
5 years ago by Chetachi
MySnippets is a plugin that adds a status bar menu allowing the user to quickly manage their snippets within the comfort of their workspace 🖌.
Auto Class
4 years ago by Nathonius
Automatically add CSS classes to notes based on file path.
Highlightr
4 years ago by Chetachi
A minimal and aesthetically pleasing highlighting menu that makes color-coded highlighting much easier 🎨.
Colorizelt
2 years ago by Artsem Holub (WiNE-iNEFF)
Easy color and clear selected text
Scrambling Title Animations
2 years ago by HistidineDwarf
Animates the title of an opened note by scrambling it in a few visually-appealing ways
Color Folders and Files
a year ago by Mithadon
Obsidian plugin to customize the appearance of folders and files through a context menu with color picker and style options.
Pixel Perfect Image
a year ago by Johan Sanneblad
Pixel perfect 100% image resizing, copy to clipboard, show image in Finder/Explorer, edit image in external editor, and much more.
Note Favicon
a year ago by mdklab
Obsidian plugin – Show Favicon from Metadata
Heading Decorator
a year ago by dragonish
Implement displaying specific content around headings based on their levels.
Note to RED
a year ago by Yeban
一键将 Obsidian 笔记转换为小红书图片进行导出
Custom Theme Studio
7 months ago by @gapmiss
An Obsidian.md plugin to create and tweak custom themes with live CSS editing, element styling, and instant previews. All without leaving Obsidian.
Colorful Note Background
4 months ago by andresgongora
Set note background based on file location or frontmatter metadata