Giter Club home page Giter Club logo

obsidian-emoji-styling's Introduction

Obsidian Emoji Styling Plugin

Very simple plugin to wrap all emoji characters in span elements with the class emoji, to allow theme developers or CSS snippets to style emoji separately in reader mode.

This plugin is useful if you use emoji in text with gradients or background images applied, which break the colour of the emoji, for example in Royal Velvet theme.

You could do other things like make emoji characters larger or smaller, or have some extra space around them.

Define what emoji look like by adding some CSS to target the .emoji class, for example:

.emoji {
  color: var(--text-normal);
  -webkit-text-fill-color: var(--text-normal);
  background: red;
  border-radius: 100%;
  font-size: 1.5em;
}

This snippet makes emoji have the right colour, be 1.5x as large as the surrounding text and be inside a red circle.

To achieve the same effect in edit mode, use the Dynamic Highlights plugin and import the configuration:

{
  "emoji": {
    "class": "emoji",
    "color": "",
    "regex": true,
    "query": "\\p{Extended_Pictographic}",
    "mark": ["match", "start", "end"]
  }
}

Manually installing the plugin

  • Copy over main.js, and manifest.json from a release to your vault VaultFolder/.obsidian/plugins/obsidian-emoji-styling/.

Technical stuff

Releasing new releases
  • Update your manifest.json with your new version number, such as 1.0.1, and the minimum Obsidian version required for your latest release.
  • Update your versions.json file with "new-plugin-version": "minimum-obsidian-version" so older versions of Obsidian can download an older version of your plugin that's compatible.
  • Create new GitHub release using your new version number as the "Tag version". Use the exact version number, don't include a prefix v. See here for an example: https://github.com/obsidianmd/obsidian-sample-plugin/releases
  • Upload the files manifest.json, main.js, styles.css as binary attachments. Note: The manifest.json file must be in two places, first the root path of your repository and also in the release.
  • Publish the release.

You can simplify the version bump process by running npm version patch, npm version minor or npm version major after updating minAppVersion manually in manifest.json. The command will bump version in manifest.json and package.json, and add the entry for the new version to versions.json

Adding your plugin to the community plugin list

obsidian-emoji-styling's People

Contributors

aidenlx avatar caro401 avatar chrisgrieser avatar clemens-e avatar edo78 avatar fyears avatar gitmurf avatar kostapc avatar lishid avatar phibr0 avatar taurelas avatar tfthacker avatar tokuhirom avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

rscircus

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.