[SOLVED] Can Anki Tags become CSS class?

sabayon11's Avatar

sabayon11

22 Dec, 2018 03:43 PM

This doesn't work:

<div class="Tags {{Tags}}"></div>


div.Tags {
    font-size: 18px;
    color: #006fa3;
}

The idea is to display specified tag in colour. This is the follow up of other discussions:
https://anki.tenderapp.com/discussions/add-ons/26263-add-on-request...

https://www.reddit.com/r/Anki/comments/9z8gje/a_useful_trick_for_st...

Similar request
https://www.reddit.com/r/Anki/comments/a5m74o/text_appearing_based_...

  1. Support Staff 1 Posted by Damien Elmes on 23 Dec, 2018 11:29 PM

    Damien Elmes's Avatar
  2. 2 Posted by sabayon11 on 24 Dec, 2018 12:04 PM

    sabayon11's Avatar

    Ok. But my idea is to colour all Tags in one colour for example blue (or blue background - whatever) and set a specific colour for specific tag (something that would work as styling exception).

    For example when I have tags: Business, General, L3000 I want tags to have colour blue.

    When I have tags: Biology, L3000 I want tag tag L3000 to have colour blue and Biology to have colour red.

    https://i.imgur.com/Nhy0pAm.png

    In my example when on card I have Biology tag, all tags becomes red when L3000 tag should stay blue.

    So my idea was to use
    .Tags as a class for all tags to colour all Tags in blue and then set colourful exceptions for single tags, for example red for Biology, yellow for phrasal_verb, etc.

  3. Support Staff 3 Posted by Damien Elmes on 26 Dec, 2018 09:13 AM

    Damien Elmes's Avatar

    Sorry, I misunderstood what you were asking. I'm not sure what you want is possible with just CSS.

  4. 4 Posted by sabayon11 on 21 Mar, 2019 04:28 PM

    sabayon11's Avatar

    Just for the record. Here is a solution that works for me:

    https://www.reddit.com/r/Anki/comments/b2986q/beautiful_custom_them...

Comments are closed, but you can start a new discussion.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac