Closed ralf3u closed 2 years ago
CSS is supposed to apply the most specific rule. If multiple rules match, it's supposed to use the rule that was defined last.
extra_css
is added to the webview early. So whatever CSS is defined in the document is given priority.
So with the first few snippets, the document stylesheet can override extra_css
. For later snippets, the document stylesheet is cut off and extra_css
rules take over.
Ideally, stylesheets from the document would be preserved for all snippets. But I don't know a good way to do that because HTML is variable. Trying to do too much processing can break things (as has happened before) and affect performance.
@xiota To your last comment: I think that there is a misunderstanding. The title of this issue is "txt-documents" and not html-documents. I don't use stylesheet for txt-documents. And I use in all documents nowhere the color #808080
. And it is
.... sometimes not the first snippet but the second, third or fourth snippet.
What filetype is the txt document being interpreted as?
What filetype is the txt document being interpreted as?
How can I know this? Maybe this could help: I use the default settings of preview.conf, so I didn't change preview.conf.
Plain documents don't have internal CSS to cut off, so I don't know why snippets would change anything.
The fountain.css
has #707070
. preview.css
uses "lightgray", but it applies only to the "geany_preview_headers" class.
I'd need to see an example of one of the problem files.
Do you know of a file with this problem that I can download from somewhere?
The used document has personal content. I tried a txt-document with 40x "lorem ipsum..." as content, but I can't reproduce the issue. It is only that special document. In the editor in the tab-title there is txt as format. When I rename the document, then the issue is still there. I will try in the next days to reproduce the issue with an other document.
The fountain.css has #707070. preview.css uses "lightgray"
The color of lightgray is #d3d3d3
. Are you sure that #808080
is not being used somewhere?
It is only that special document.
Let me know when you find an example that reproduces the problem.
Are you sure that
#808080
is not being used somewhere?
You can look at the CSS files in the config folder to see if you find anything.
You can look at the CSS files in the config folder to see if you find anything.
I couldn't find anything. The color #808080
is gray or RGB (128, 128, 128)
.
I couldn't find anything.
I don't know where the color would be from either.
I found the cause. Somewhere in the txt-document there was one single line of html:
<body style="background:gray">
I erased the line and the issue was solved. As consequence of this issue I just opened a new issue, issue number 24.
I made tests with
extra_css=extra-media.css
and withextra_css=disable
. Some snippets have the background color #808080, sometimes the first snippet, or sometimes not the first snippet but the second, third or fourth snippet. I have no idea where the color comes from.