Remove Button Outline

I just upgraded to .41 and I have a blue border/outline around the answer buttons. Is there any way to remove this? I had been using “Large and Colorful Buttons” which has a “outline: none;” line but that seems to be getting overridden now. I gave Anking’s button add-on a shot, as he also has an option to disable the outline, but once again, it’s being overridden.

I would like to thank @abdo for walking me through what to do step-by-step in order to get rid of the button outline.

If anyone is using the “Large and Colorful Buttons” add on and wants to get rid of the border outline, simply paste the below in the init.py file. Thank you once again to @abdo.

from aqt import gui_hooks
from aqt.reviewer import ReviewerBottomBar

def myhook(web_content, context):
if not isinstance(context, ReviewerBottomBar):
return
css = “”"
button {
outline: none !important;
}
“”"
web_content.head += f"{css}"

gui_hooks.webview_will_set_content.append(myhook

2 Likes

Bumping this up because I got asked and to note that the code @nmeed had pasted here is not correct because the forum editor is stripping HTML tags as it’s not formatted using the preformatted text option. Here is the correct code for anyone who needs it:

from aqt import gui_hooks
from aqt.reviewer import ReviewerBottomBar

def myhook(web_content, context):
    if not isinstance(context, ReviewerBottomBar):
        return
    css = """
    button {
        outline: none !important;
    }
    """
    web_content.head += f"<style>{css}</style>"

gui_hooks.webview_will_set_content.append(myhook)

2 Likes