EPUB compile produces faulty CSS file (in Default Stylesheet)

when compiling my project , Scrivener 3 gives out a faulty line in the .css file in the EPUB container. This leads to my eReader (Kobo Aura; Tolino ones might be affected as well) ignoring the stylesheet file altogether. The faulty line is in the Default Stylesheet part, so I do not see a way to edit it, except to remove it manually after compiling via Sigil, which is what I did so far.

Scrivener creates this “.ps1” style. The problem is with the spaces in what should be “text-indent” and now is text - indent".

I can not get Scrivener to get rid of this class. I already removed everything it assigned that class, to see if that fixes it, but at some point it just assigns it to the standard paragraphs.

While compiling earlier versions, the faulty line did not exist at one point (recognizable by the fact that the eReader considered the stylesheet file). After multiple alterations to the settings, the line suddenly appeared. I do not know, which change might have caused it.

Is there a way to fix this? Thank you.

I could upload an image, showing the faulty line in the Default Stylesheet preview of the compile window, but I receive “Sorry, you can’t embed media items in a post.”

Can you copy the contents of the Default stylesheet to the Custom stylesheet (if the default is not already there) and set the drop-down list to Custom stylesheet, then edit the stylesheet as you will, removing the spaces?

Either you added it to the Amend stylesheet or it is a consequence of a Editor Style or a Compile Style.

So one problem you’re running into here is that the compiler is way too noisy about inserting CSS all over the place when it shouldn’t be. If you’re using regular old paragraphs and a section layout that uses default paragraph settings (the default setup, to be clear), then you should be getting nothing but <p> … </p> in the output.

But that aside, it shouldn’t be generating invalid CSS, and doesn’t normally. We may need to see a sample of this in action in order to pin down precisely what is happening. Feel free to send a copy via PM or technical support, if you cannot demonstrate it with non-personal information.

I don’t think that will work since the .css file will still contain the invalid syntax that is causing some ereaders to abort processing the file, even if the line in question is never used. Even so it’s going to be difficult overriding a serial number generated CSS class in the first place, since they can change from one compile to the next (and that’s precisely why the compiler shouldn’t be spamming these everywhere).

So I think until we figure out what is going on, fixing the file in Sigil is going to be necessary.

Thanks both of you for taking the time and for your help.
AntoniDol, your fix works as well as fixing the line via Sigil. I set scrivener to “Use Custome CSS Stylesheet”, copied the whole Default Stylesheet over to the custom one and removed the spaces. Compiling, checking, no error. Of course, this is completely manual and I would rather have Scrivener work its magic the intended way on my project. Still, thanks a bunch.

the forum software is not letting me “embed media” (screenshots) or upload files (the .css file zipped or unzipped), in a post or via PM.
Trying to include links from my personal dropbox is forbidden as well. Any suggestion?

Just go ahead and send it to support via email and make sure to specify this thread URL so that whoever gets it can link it up to me. I linked to the contact page above.

The forum software needs to learn a bit more about you before granting link and embed/upload permissions. Just read a little, post a little, and you’ll be fine in no time.

Thanks for the sample project!

I had a chance to look at it and it is very strange, I don’t have issues with CSS, and the CSS I do get is different from what you get:

/* Direct formatting styles */
.ps1 {line-height: 1.2em; margin-left: 0rem; text-indent: 0rem}
.ps2 {line-height: 1.2em; margin-left: 0rem; text-indent: 1.50rem}

In the screenshot you provided, what you get is:

/* Direct formatting styles */
.ps1 { text - indent: 0rem; }

/* Direct formatting styles */
.ps1 {line-height: 1.3em; margin-left: 0rem; text-indent: 0.77rem}

There are also as you can see weirdly two sections commented this way, as “Direct formatting styles”.

The other oddity I noticed is that the sample project was set to use the “Default” compile Format, but the sample ePub you sent looks to have been generated using a more complete format, like “Ebook”. So maybe the problem is that I need to make some changes to the compile settings, from the way you left them?