View Single Post
Old 04-14-2024, 12:54 PM   #1
st_albert
Guru
st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'
 
Posts: 698
Karma: 150000
Join Date: Feb 2010
Device: none
Can preview's User Agent Stylesheet be disabled?

Edited to add:
The title of this thread is misleading. It turns out that Preview's "User Agent Stylesheet" is not the culprit, nor is Sigil version 2.1.0. If your Preview doesn't display bold text when it ought to, read on. Otherwise, "never mind." --Albert [/edit]

I don't think this is a bug, but more likely ignorance on my part.

That said, I am recently seeing a problem in the preview window of a newly-built Sigil 2.1.0 (and also in PageEdit 2.1.0 using Qt 6.4.2.). The computer is running Kubuntu 23.10.

The problem is that when I code for a header to be bold, it does not show up bold in the preview window. Looking at the inspector window shows that this is because the "font-weight:bold;" directive is being over-ridden by the User Agent Stylesheet in preview.

On an older machine, with Sigil 1.9.30 and Qt 5.15.10, preview doesn't show this behavior. (I.e. no over-ride)

I've poked around in the inspector's settings, but didn't see anything helpful. Nor did adding !important to the "font-weight: bold" directive prevent the override. The stylesheet passes the CSS validator.

Naturally, I realize that the User Agent Stylesheet applies only to the preview window, and is not inserted into the stylesheet of the epub itself. The epub displays properly in ADE and Calibre's epub viewer, for example. It's only an annoyance, but I would like preview to be a "what you see is what you coded" viewer.

example code:
Code:
h1 {
     margin-left:0;
     margin-right:0;
     margin-top:2.0em;
     margin-bottom:1.5em;
     border:none;
     padding:0;
     text-align:center;
     font-weight:bold !important;
     font-size:125%;
     clear:left;
}
Thanks in advance for any insights y'all can provide!
Albert

Last edited by st_albert; 04-14-2024 at 08:08 PM. Reason: misleading topic title
st_albert is offline   Reply With Quote