migaku-official / Migaku-Dictionary-Addon

Migaku Dictionary allows users to lookup word definitions, export definitions to their cards in real-time, hear word audio and see word frequency, etc. If you have an issue please report it in the "Issues" tab. Reponses to issues can be slow on GitHub, for faster support consider joining our Discord server through our Patreon page.
GNU General Public License v3.0
64 stars 24 forks source link

Card template/CSS not displaying correctly #28

Closed lostasock closed 3 years ago

lostasock commented 4 years ago

Type:

Environment:

I'm going to open a PR to resolve the issue:

Description: Something is stopping my card template/CSS from displaying correctly. It displays correctly without MIA Dictionary open, but as soon as I have MIA dictionary open, then go to edit a card, it will discard all my styling and won't display it correctly until I reopen anki. The code below is the only note type of mine that I noticed is causing his behaviour. Others seem to work fine.

Code and screenshots:

Front

{{Expression}}

Styling

.win rt {
font-size: 20px; /* ankidroid 17px PC 45px */
line-height:100%;
padding:0px;
margin:3px;
}

.win hr {
padding:0px;
margin:3px;
}

.win .card {
font-family: myfont;
 font-size: 35px; /* ankidroid 25px PC 57px */
 text-align: left;
/* color: black;*/
/* background-color: white; */
 line-height: 95%;

@font-face { font-family: myfont; src: url('_NotoSansJP-Regular.ttf');
}
}

.mobile rt {
font-size: 17px; /* ankidroid 17px PC 55px */
line-height:100%;
padding:0px;
margin:3px;
}

.mobile hr {
padding:0px;
margin:3px;
}

.mobile .card {
font-family: myfont;
 font-size: 25px; /* ankidroid 25px PC 70px */
 text-align: left;
/* color: black;*/
/* background-color: white; */
 line-height: 95%;

@font-face { font-family: myfont; src: url('_NotoSansJP-Regular.ttf');
}
}

Back

{{FrontSide}}

<hr>

{{furigana:Reading}}
<hr style="font-size:1px">
{{origMeaning}}

{{#Word}}
{{Word}}: {{Meaning}}
{{/Word}}

{{#Notes}}<br>
{{Notes}}
{{/Notes}}

{{#Image}}
<br>
{{Image}}
{{/Image}}

{{#mmTarget}}
<br>
FocusMorph: {{mmTarget}}</p>
{{/mmTarget}}

Displaying correctly: image

Not displaying correctly: image

lostasock commented 4 years ago

I removed the .mobile classes/section, and removed .win from the remaining parts, and it is now working. Obviously though I've lost the ability for it to automatically change between mobile / win platforms.

working styling:

rt {
font-size: 20px; /* ankidroid 17px PC 45px */
line-height:100%;
padding:0px;
margin:3px;
}

hr {
padding:0px;
margin:3px;
}

.card {
font-family: myfont;
 font-size: 35px; /* ankidroid 25px PC 57px */
 text-align: left;
/* color: black;*/
/* background-color: white; */
 line-height: 95%;

@font-face { font-family: myfont; src: url('_NotoSansJP-Regular.ttf');
}
}
KieranBrannigan commented 3 years ago

Thank you for supporting Migaku.

We have closed this issue since this it is >6 months old; if you feel that this issue is still a problem in the latest version, please comment below and we will reopen and begin investigating this issue.

We apologise that recently we didn't have the manpower to maintain these repos properly, but we aim to maintain them better from here on out.