Conditional frame when there is no Cloze in cloze field

I want to add a simple frame that would indicate a field where cloze sentence is located in template but remove it when cloze is made.

<div class=mystyle>{{cloze:Cloze_Sentence}}</div>

.mystyle {  
 border: 2px; 
 border-style: groove;
}

When I add it it it looks like this

and I want this frame to be gone when I add cloze. So I think the condition would be to check if there is this sign { in a Cloze field.

Something like: if there is no { display:none ; else=mystyle

I guess some script can do it. I think Anki uses the same piece of code to display:
“Please run Tools>Empty Cards”
It can be done but requires some sound coding skills.
I found for example this piece of code in reviewer.py starting from line 569

if not self.typeCorrect:            
if self.typeCorrect is None:                
if clozeIdx:  warn =
tr.studying_please_run_toolsempty_cards()

I need this because it helps with “Edit Field During Review (Cloze)” add-on when it is used with different templates.

2 Likes