question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Option to Use Classes Instead of Style

See original GitHub issue

Hey there! First, I wanted to say that this is a neat plugin idea. Thanks for writing it, and for sharing it with the community!

Currently, if I highlight some text, example text, and pick, say, blue, I get the following:

<mark style="background: #ADCCFFA6;">example text</mark>

If I were to change the value of “Blue” (which, an “edit” option doesn’t seem to currently be available in the plugin’s settings near as I can tell, but I can delete and recreate that name, for instance), if the file is open, I think it removes any instances of the highlight, and if it’s not, then the highlight’s mark remains configured to the old color. This makes it so notes can become “outdated” relative to a given configuration, which I think is not really compatible with the idea of a knowledge database.

Is there anything I’m missing, like some practical reason why classes cannot or should not be used for this?

My proposed solution would instead have it so your interface curates its own list of classes, while the plugin adds classes to notes, which can be updated / changed over time to reflect the user’s current use of / view on highlights, e.g.

So the markdown could look something like:

<mark class="highlightr-blue">example text</mark>

and elsewhere, something like: highlightr-user.css

.highlightr-blue {
  background: #ADCCFFA6;
}

Thanks again for sharing your plugin!

EDIT: An option to cost classes versus inline styling would likely be appropriate to cover all use cases.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:24 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
akadormousecommented, Oct 29, 2021

Personally, I prefer the way it works at the moment. I use my Obsidian files outside Obsidian all the time. Wouldn’t work if it depended on class.

4reactions
ryanpcmcquencommented, Oct 28, 2021

I’m suggesting that the current solution is more in line with the ideals of Obsidian than the proposal here.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Styles and classes - The Modern JavaScript Tutorial
We should always prefer CSS classes to style . The latter should only be used if classes “can't handle it”. For example, style...
Read more >
What's the difference between inline styles vs classes?
So the difference between both is you can re-use classes whereas you can't re-use inline styles. Share.
Read more >
CSS Class Selectors: How to Use to Style an HTML Element
Do you want to stylize HTML elements without hassle? CSS classes will help you do the job! Here, you'll learn how to use...
Read more >
Why use Classes or IDs on the HTML element? - CSS-Tricks
A top-level class can serve to identify which page is currently being viewed and thus apply styling to that a different page may...
Read more >
CSS Id vs Class: Reasons not to use IDs in CSS
Using only the class attribute to define styles is easier for others to understand instead of a combination of the class and id...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found