3

In macOS Mojave dark mode, the Dictionary app became unusable because of coloring issues: in application itself some of the text is white on white, and in definition popup that appears if you right click a word and select Look Up (or use force touch or three-finger press) the text is black on a dark grey background:

screenshot of the problem

How can it be fixed?

2
  • Thanks for your solution, it's working very well.
    – keramzyt
    Commented Oct 15, 2019 at 7:20
  • Hi @keramzyt they must be glad it worked for you. Please vote for good content as only the asker can tick the accepted control on an answer.
    – anki
    Commented Oct 15, 2019 at 7:41

1 Answer 1

6

After searching the Internet and experimenting I was able to produce a solution. You have to create a DefaultStyle.css file and put it in Contents subdirectory for each dictionary you want to fix. The dictionaries are located at ~/Library/Dictionaries or at /System/Library/Assets/com_apple_MobileAsset_DictionaryServices_dictionaryOSX/ folders. You can easily open them in Finder by pressing Cmd+Shift+G and pasting the folder path. Here's the DefaultStyle.css contents:

@charset "UTF-8";
@namespace d url(http://www.apple.com/DTDs/DictionaryService-1.0.rng);


@media (prefers-dark-interface)
{

    html {
        -apple-color-filter: apple-invert-lightness();
    }

    a {
        -apple-color-filter: none;
        color: -webkit-link;
    }

    img {
        filter: invert(100%);
    }

    html.apple_client-panel body div {
        color: text;
    }

    html.apple_client-panel body div.L1 {
        color: -apple-system-label;
    }

}

It uses @media (prefers-dark-interface) selector to apply this CSS only in dark mode. The html.apple_client-panel is the selector for a popup window that appears when you use the Define/Look Up feature. After applying the fix the Dictionary looks good and is readable again:

screenshot of the fixed problem

1
  • Thank you for troubleshooting the issue and for the workaround! Could you mark your answer as accepted? To do this, click on the check mark beside the answer to toggle it from greyed out to filled in. This shows other people who have this issue that this question has a "good" answer.
    – jaume
    Commented Oct 15, 2019 at 8:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .