Giter Site home page Giter Site logo

css not loaded into the editor in 2.1.60 (and presumably .55+) about anki__editor__apply__font_color__background_color__custom_class__custom_style HOT 6 OPEN

ijgnd avatar ijgnd commented on August 17, 2024
css not loaded into the editor in 2.1.60 (and presumably .55+)

from anki__editor__apply__font_color__background_color__custom_class__custom_style.

Comments (6)

ijgnd avatar ijgnd commented on August 17, 2024 1

Could you update the text on ankiweb with these three points:

  • it's not working on 2.1.50-2.1.54
  • it's not working with qt5
  • the css is not loaded into the editor in 2.1.55 or later by this add-on so that workarounds are needed.

I have added these three points into https://github.com/ijgnd/anki__editor__apply__font_color__background_color__custom_class__custom_style/blob/master/ankiweb.html

from anki__editor__apply__font_color__background_color__custom_class__custom_style.

ijgnd avatar ijgnd commented on August 17, 2024

simplest solution is probably to reuse the add-on css injector which has been updated pretty reliably since Anki version 2.1.41 and 2021-05

add one line into injector.js

change from

  injectStylesheet(root, editable, `/_addons/${addonPackage}/user_files/field.css`);

to

  injectStylesheet(root, editable, `/_addons/${addonPackage}/user_files/field.css`);
  injectStylesheet(root, editable, `_editor_button_styles.css`);

see (the ts version) https://github.com/kleinerpirat/anki-css-injector/blob/f5e94989f79b7a01cd73783487cff0ef838d0c9d/ts/src/injector.ts#L52

from anki__editor__apply__font_color__background_color__custom_class__custom_style.

hgiesel avatar hgiesel commented on August 17, 2024

I'm looking into this right now

from anki__editor__apply__font_color__background_color__custom_class__custom_style.

hgiesel avatar hgiesel commented on August 17, 2024

Can you explain again, what you mean by "new code" here? I got the add-on running again without touching the injection routine.

from anki__editor__apply__font_color__background_color__custom_class__custom_style.

ijgnd avatar ijgnd commented on August 17, 2024

Thanks for your quick reply.

This post was a reminder for me so it's unclear. I meant that just the css is not applied in the editor in Anki 2.1.60, the appyling of the class still works. That's why I mentioned the add-on css injector as a workaround.

My js skills are too limited to find a quick solution for this at the moment.

from anki__editor__apply__font_color__background_color__custom_class__custom_style.

ijgnd avatar ijgnd commented on August 17, 2024

actually the current version of this add-on modifies the css of the editor, e.g. on my machine the editor font and font size is overriden. I fixed this by commenting out

so adding the three points from my last post is probably not enough ...

I don't know lately all my bug reports are full of holes.

from anki__editor__apply__font_color__background_color__custom_class__custom_style.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.