Custom CSS to prevent indented bullets in Textbox for PDF

I tried to add to this post yesterday about a workaround for removing indents in a textbox, but it still hasn’t been approved yet.

I’m having the same problems, with indents in bulleted items in a textbox. Using the Clarke theme.

I applied No Indent from the Format dropdown. Looks okay in a browser and in the editor. When I export to a PDF, the indents are back again. The padding on the right side of the box is too close as well.

Maybe this is a bug?

Can anyone suggest what to add in the Custom CSS area? This is the only change we need to make to our book and then it’s done!

Hi @JenniferNM it might well be a bug. Can you drop in the URL to your book so that folks can see the issue you’re talking about or try to reproduce the issue locally?

Thanks, Steel! Do I have to make the book public to do that?

You don’t have to, but it helps (it’s the only way for forum readers that aren’t Pressbooks admins to see the book and offer suggestions)

Thanks. I made the book public. Not sure if this will work to just share a chapter link.

The problem is, the textboxes look just fine in this view. But as I said, as soon as we export to a Print PDF, the indents are back again.

We have 11 textboxes and they start in Chapter 2.

I realize Pressbooks doesn’t offer tech support or custom CSS, but this seems more like broken functionality to me. Does it matter if this book is the Premium print/ebook package?

Thanks for your help!

Hi @JenniferNM makes total sense. What you’re showing/describing looks like a ‘bug’ to me at first glance. We’ll attempt to reproduce it and file as a bug if it meets that criteria. We’ll also try to give you a quick CSS based workaround until that happens. Tomorrow’s a holiday in Canada, but hopefully we can get you something usable by end of week.

Thank you so much, Steel! That would be great.

Is there any other information you need from me? I’d like to make the book private again since we haven’t published it yet.

You can go ahead and make the book private. I think we have what we need for now. Thanks!

Will do. Thanks again!

Hi @JenniferNM try adding the following to the Custom CSS for your PDF exports:

.textbox p.no-indent, .bcc-box p.no-indent {
text-indent: 0;
}

What’s happening here is that there are two CSS rules in conflict – one that sets text-indents for .textbox p, .bcc-box p (paragraphs inside of textboxes) and another that sets text-indents for elements with the no-indent class. In this particular theme, the .textbox p selector is more specific than the no-indent selector, so it’s not being applied. We’ll try to fix in a future release, but for now, that CSS should do the trick.

1 Like

That works perfectly! Thank you so much for your help. :slight_smile:

1 Like