Use CSS Custom Properties (Variables) for Styling
masterSupercharged Links automatically converts registered attributes into CSS custom properties prefixed with --data-link-. This allows you to use note metadata directly in your CSS.
Usage Patterns
- Direct Colors: If a property contains a color value (e.g.,
colour:: #8bc34a), usevar(--data-link-colour). - Images/Avatars: If a property contains an HTTP URL (e.g.,
photo:: https://...), it is treated as a URL. You can use it withbackground-image: var(--data-link-photo);.
Note: When using URLs, the plugin treats them as url() compatible values in CSS.
/* Using a custom color property from a note */
[data-link-colour] {
color: var(--data-link-colour);
}
/* Using an avatar URL from a note */
.data-link-icon[data-link-photo^="https" i]:empty {
background-image: var(--data-link-photo);
background-size: cover;
border-radius: 100%;
}