ankitects / anki

Anki's shared backend and web components, and the Qt frontend
https://apps.ankiweb.net
Other
18.7k stars 2.13k forks source link

Add box-sizing: border-box to Reviewer's Default CSS #2586

Open jorgebucaran opened 1 year ago

jorgebucaran commented 1 year ago

Hi Ankitects! I'd like to suggest we add

* { box-sizing: border-box; } 

to the Reviewer's default CSS. This CSS rule ensures that padding and border are included in an element's total width and height. This rule can help keep card layouts consistent, from simple to complex designs, for example:

If this change sounds good, I'm happy to take it.

Can you show me which file or files need updating? Is it just this one: /main/ts/reviewer/reviewer.scss?

Thanks!

dae commented 1 year ago

It's a logical default, but I'm afraid it will likely make some existing card templates render differently. Some shared decks use fancy styling and are used by thousands of users, so such changes can be disruptive.

jorgebucaran commented 1 year ago

So, adding this rule could interfere with users who've created styles around its absence. I see. Would it be out of the question to include this in the next minor release (2.2)? I guess a major release isn't the horizon any time soon.

dae commented 1 year ago

That doesn't really help, because people with such templates will want to be able to update to the latest Anki version without it breaking their templates :-) If this were introduced, we'd need some way to only apply it to newly-created templates, and even then it could potentially cause confusion if people copied+pasted layout from an old template unfortunately.