Custom styles not working for .mobi

Hello. I’ve added custom CSS to override what’s in the theme (Austen theme - https://pressbooks.com/themes/austenclassic) but it still seems to be overridden by something else.

But besides the fact that my custom styles aren’t showing up (when viewing the .mobi on the Kindle Previewer software), I’m finding it very difficult to SEE what styles to target. Some advice seems to say “export the XHTML and view that to know what styles” but the XHTML seems to be the Web view and doesn’t have the indents on paragraphs that the .mobi does. So looking at the CSS in the XHTML page isn’t helping me.

I finally tried the Calibre viewer and was able to look at the .mobi and “inspect” the paragraphs and CSS code, which points to a 0001.CSS file. My customizations are there at the end, BUT then there’s another few lines added afterward that negate my styles.

Any idea what could be inserting more styles AFTER my customizations? Are there any tools to edit .mobi file code after it has been exported?

My only goal at this moment is to increase the indent from “text-indent: 1em” to 3em. It frustrating that I’ve spent over 8 hours on ONE ridiculous, easy, small change and made ZERO headway.

I don’t know whether it matters that I’m using PressBooks via a company called AuthorLab.

Sounds like you should talk to AuthorLab first. If that’s not meeting your needs, perhaps you’d want to try our Pressbooks.com offering for sulf-published authors?

Thanks for the suggestion, SteelWagstaff. In the end, I’m working on installing my own copy of Pressbooks (now that I realize it’s an open source offering that I could set up for myself). Maybe that will resolve the issue.

But I’m still curious: Does Pressbooks natively override certain styles regardless of user customization? What I discovered was that the CSS file generated and exported showed the default Austen theme CSS, then it had my custom styles, and THEN there were just a couple of styles added AFTER my custom CSS section (ones for the

tags and for invisible elements). Since CSS files are applied with the ones at the end overriding ones earlier in the list, my adjustments were being overridden. In the end, I was able to edit it out manually with Calibre.

But it still leaves me with the question:

Is that a native Pressbooks functionality? Or do you think AuthorLab added that somehow?

Or to put my question another way: When a book creator adds custom styles into the custom styles section of the interface, will those always override the default CSS of the selected theme (and remain the last CSS lines of code in the exported CSS)?

I appreciate any light you can shine on this question. I haven’t gotten far enough along in my own Pressbooks install to be able to test the functionality myself to see if it’s different from AuthorLab’s install.

Thank you!

I’m not aware of our creating a 0001.css file nor do I believe that we apply additional CSS that would be processed after user-entered CSS. Good luck with your open-source install – there’s a lot too it, but it’s doable! If you find it’s taking you too much time/energy, it costs less than $20 to create ebook exports for a book on Pressbooks.com – might save you time & money by giving that a shot?