Encapsulate the card styles from the main site code

Hello. I just started learning Anki and am still in the process, so be patient.

I ran into a problem that the layout in the online version is broken. After searching the forum and github, I did not find any topic with a similar case.

After doing some research, I discovered that not all decks break the web version’s layout. It turned out that my deck inserts CSS through the style tag, and their global styles are overridden for a lot of things.

We should use style encapsulation using web components. I am still new to this technology and am in the process of learning it. Or use the good old iframe? What are your ideas?

P.S: I also have a question: where can I find the source code for AnkiWeb?

2 Likes

Sorry, AnkiWeb is not open source. An iframe or shadow root may be used in the future; for now I suggest you scope such global styling under .card, which should work across the clients.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.