2

I'm using the Tern plugin for CodeMirror, which adds intellisense features to the editor (i.e. pops up inline hint-labels).

I want to change the hint-labels style, how to do so?

Eliran Malka
  • 15,821
  • 6
  • 77
  • 100
Ciel
  • 4,290
  • 8
  • 51
  • 110

1 Answers1

3

Tern attaches CSS classnames to the hint box, you can utilize them to style it, e.g.:

.CodeMirror-Tern-tooltip:before {
    content: url('http://n5.nabble.com/images/smiley/smiley_thinking.gif');
    width: 20px;
    height: 20px;
}

… which will result in this:

tern hint custom styling

Eliran Malka
  • 15,821
  • 6
  • 77
  • 100
  • 1
    You can find the stylesheet in "./addon/tern/tern.css" , there you will find couple of sections which would help you customize your labels. Eg : .CodeMirror-Tern-completion:before – djadmin Apr 02 '14 at 09:27
  • 1
    You are so awesome. There are no words for how awesome you are. I know this seems pointless, but this is actually for a small game where we need a light "scripting" engine. Getting our staff to learn how to program is not going to happen, but if I can rig up an "editor" with very simple labels ("THIS IS THE CHARACTER. THIS IS THE ACTION") then I can make it easy for them. – Ciel Apr 02 '14 at 13:14
  • 1
    cheers, man. you're the awesome one, building abstractions for non-programmers. good luck! – Eliran Malka Apr 02 '14 at 14:07
  • 1
    I appreciate the sentiment. Most have looked at me like a retard, with comments like "That's stupid. Just make them learn it." or "There's no reason you should ever do that". People seem to fail to understand that the customer is the most - and only - important part of a product. Programming (in my mind) should solve problems for them, not be something that we (as programmers) find satisfying to ourselves. If they have trouble using the product, there is a modicum of "Having to learn", I agree - but I can also meet in the middle and try to help them. – Ciel Apr 04 '14 at 14:08
  • 1
    well put, miss/mister (sorry for pre-assuming you're a guy before, i actually haven't a clue...). – Eliran Malka Apr 04 '14 at 16:46
  • @Eliran Malka can you answer to my question in this link http://stackoverflow.com/questions/42467975/can-i-create-my-tooltip-in-codemirror – code Feb 26 '17 at 13:08
  • @Ciel can you answer to my question in this link http://stackoverflow.com/questions/42467975/can-i-create-my-tooltip-in-codemirror – code Feb 26 '17 at 13:09