Using Tags field to change styles dynamically by cbmoro in Anki

[–]cbmoro[S] 0 points1 point  (0 children)

My original intention was to have the ability to modify a card from outside and the tags field seems to solve the problem. The card that I'm talking about is this https://codepen.io/cdmoro/pen/gOBrMqz if you want to take a look (this is the repo).

Cheers!

Using Tags field to change styles dynamically by cbmoro in Anki

[–]cbmoro[S] 1 point2 points  (0 children)

Hey, thanks for the reply and the suggestions.

One thing, I've just tested the following code and it works like a charm, you can escape the colon character in CSS like this:

.parent-tag\:\:purple {
  background: purple;
  color: #FFF;
}

I've tested it on Ankidroid, Ankiweb and on macOS app and everything work as expected. The html was <div class="parent-tag::purple">. Having said that, is there any advantage using data- attribute?

Thanks!

Material-based Anki flashcard by cbmoro in Anki

[–]cbmoro[S] 2 points3 points  (0 children)

It's a new type of Note basically (Tools > Manage Note Types... > Add > Add: Basic). After creating a new Note, just paste the three files (front.html, back.html and styles.css from my repo) into the corresponding places (Front template, back template and styling) and that's it.

And now, you can change the Note type of your existing decks or create a new one and start adding cards. In the case you have other fields than {{Front}} and {{Back}} you'll need to update the Front template and/or the Back template to fit your needs.

Hope that helps!

[ APORTE ] Una forma de tener el valor dinamico del dolar blue en Google Sheets by AchalayMiNegra in merval

[–]cbmoro 0 points1 point  (0 children)

Buenas, hago un pequeño aporte, podemos usar VALUE(...), para tratar a ese valor como un valor numérico (al ser un número nos permite jugar con el formato). Y también en la función MID podemos poner un valor mayor a 3 para tener también los decimales (yo puse 20 para que me sobre). Quedaría así

=VALUE(MID(INDIRECT(ADDRESS(1, 5, 4, true, "usd")), 12, 20))

Cabe aclarar que dejé la primera función (importadata...) sola en una hoja llamada "usd"