kleinerpirat / anki-css-injector Goto Github PK
View Code? Open in Web Editor NEWAllows you to style field content in Anki's editor.
Allows you to style field content in Anki's editor.
It seems like the field
attribute no longer works on the newest version of Anki.
For example, using the Anki webview addon, I get the following information:
<anki-editable contenteditable="true" class="svelte-18uwveo isLin nightMode night_mode" field="" ord="7" editor="svelte" pointversion="55" notetype="JP Mining Note" mid="1637704315966" style="--editor-shrink-max-width:250px; --editor-shrink-max-height:125px;">TEXT<br></anki-editable>
Hey, developer!
I just downloaded this addon the other day, but had quite a bit of problem with the initial editor.css
file. So I tried to find one from the Anki forum, but I still had no clue.
At the same time, I find the demo picture you posted is amazing, which makes me wondering, whether you could be so kind to share that file as a default styling or as a starting point. Thaaaanks!
Your add-on is great. I'd like to have its functionality in other add-ons, e.g. Custom Styles (font color, background colour, classes). I can also imagine other add-ons (apart from the custom classes add-on or some syntax highlighting stuff) that want to style text in the editor.
At the moment each add-on would have to duplicate the code from your add-on and all these add-ons would have to be updated individually. This is not efficient.
It would be very useful (at least for me) if your add-on gathered css from various add-ons and applied it into the editor.
Maybe your add-on could load multiple files (either from the user data folder of your addon or the media folder) or maybe it could collect the css with a custom hook from other add-ons. The latter approach was used by lovac42' ReMemorize, see here.
Would you be interested in this and if so which approach would you accept?
Hey @kleinerpirat,
I really love the idea of injecting css to customize anki. However, I couldn't get it to work following the guide provided. No matter what selectors I use, they have no effect. They don't even show up in the inspector. I tried editing both editor.css and field.css. I am using version 2.1.47. I disabled all other extensions.
What could cause my problem? Do you have any ideas?
Thanks in advance.
After updating to Qt6 I managed to inject to css into some views. But other views remain uneditable (e.g. the congrats "you learned all cards for today" menu). Is there a workaround?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.