Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define new badge types including icons #7

Open
akhtsang opened this issue Dec 27, 2023 · 2 comments
Open

Define new badge types including icons #7

akhtsang opened this issue Dec 27, 2023 · 2 comments

Comments

@akhtsang
Copy link

I see that you can use the CSS Snippets to define new badges, but they seem to only have color settings exposed and I cannot find a way to specify the icon to be associated with that badge. Can this be added? (Or added to the example snippet if the feature is already available?) Thanks!

P.S. Love the Live Preview integration!

@todearaujo
Copy link

todearaujo commented Jan 23, 2024

@akhtsang, the custom badge's syntax is real simple and there is some examples on README.MD file of this repo.

SYNTAX

`[!!|ICON|KEY:VAL|COLOR-RGB]`
Element Detail
| Start pipe symbol
!! Double exclamation points
ICON name of icon from lucide.dev
| Pipe symbol
KEY:VAL KEY is the type or label, VAL is the value text displayed.
| Pipe symbol
COLOR-RGB (optional, defaults to currentColor) 3 (R.G.B.) numeric (0-255) values, separated by commas. e.g. 144,144,144 or a CSS variable e.g. var(--color-red-rgb)

EXAMPLES

`[!!|message-square|comment:edited by j.d.|var(--color-cyan-rgb)]`
`[!!|dice|roll:eleven|120,82,238]`
`[!!|gem|mineral:emerald|var(--my-custom-rgb)]`
`[!!|apple|fruit:snack|var(--color-red-rgb)]`
`[!!|brain|brain:pkm|var(--color-purple-rgb)]`
`[!!|sun|weather:sunny|var(--color-yellow-rgb)]`
`[!!|cloudy|weather:cloudy|var(--mono-rgb-100)]`
`[!!|sunset|weather:8.44pm|var(--color-orange-rgb)]`
`[!!|dumbbell|reps:3 sets of 50|var(--mono-rgb-00)]`
`[!!|gift|event:wedding|var(--color-blue-rgb)]`
`[!!|plus-square|credit:$100|var(--color-green-rgb)]`
`[!!|minus-square|debit:$10|var(--color-pink-rgb)]`

RESULTS

image image

@gapmiss
Copy link
Owner

gapmiss commented Jan 24, 2024

Yes @todearaujo you can use any lucide icon using the custom badge syntax. Thank you for pointing that out.

As time permits, I am working on some improvements to the plugin to allow a more simple syntax including a prompt for inserting new badges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants