![]() |
#1 |
Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 517
Karma: 8500000
Join Date: Aug 2013
Location: Hamden, CT
Device: Kindle Paperwhite (11th gen), Scribe, Kindle 4 Touch
|
Feature Request: User stylesheet
The Calibre ebook viewer allows us to set a user stylesheet that gets applied to all books opened. I think the same concept in the editor would be useful, because it would allow us to more easily see the results of our edits.
Basically, if a user has a complex user stylesheet on the reader, then it's hard to tell if the edits are ending up looking right. After a while, you do get good at mentally changing the preview with what the user stylesheet does, but sometimes it's still tricky. The biggest one for me is that my user stylesheet has no space by default before/after <p> elements, so seeing if there is extra space when there should be (scene break, etc.) isn't easy. I know I could simulate this by copying the user stylesheet and pasting it to the front of the stylesheet of the book I am editing, but then I need to remember to remove it before I save (since all my readers/devices have their own version of this stylesheet installed, tweaked for their idiosyncrasies). Also, for some users, the "theme" functionality of the reader that allows quickly changing settings (which includes the user stylesheet) might be useful, but I suspect that's a lot more work. |
![]() |
![]() |
![]() |
#2 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,889
Karma: 59840450
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Do you understand how CSS interact?
The first word is Cascade. That means the LAST definition read prevails. You can always import (add files) ANY valid file type Then you link Stylesheets to the (x)HTML (the link tool allows selection of which. those not selected are unlinked) Note: class=<name> only works if there is a matching style defined |
![]() |
![]() |
Advert | |
|
![]() |
#3 | ||
Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 517
Karma: 8500000
Join Date: Aug 2013
Location: Hamden, CT
Device: Kindle Paperwhite (11th gen), Scribe, Kindle 4 Touch
|
Quote:
Note that there is no explicit declaration of "margin-top" on the paragraph, which is good coding practice for CSS, as it allows user stylesheets to override it if they wish. In the reader, the "margin-top: 0" in my user stylesheet sets that up the way I like it. Other users can choose differently, and end up with the book looking the way they like it. It also makes it easier for readers that support a "line spacing" or "paragraph spacing" option, so they can use a "default" stylesheet for these kinds of options, allowing cascade: reader default->user stylesheet->document stylesheet(s). On the other hand, in the editor, not only does it display with a top margin that is non-zero (obviously from some built-in user stylesheet that I can't edit), but the "Computed final style" doesn't show that non-zero top margin anywhere. The problem in this case is actually with the fact that -webkit-margin-before doesn't have a default of zero in the editor's built-in stylesheet. Quote:
|
||
![]() |
![]() |
![]() |
#4 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,163
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Trying to simulate how a user stylesheet on a device will work in the editor is not so straightforward. It depends on how the user stylesheet is implemented in the device. For instance, some readeing software simply insert the stylesheet as an extra sheet in the document, at the start or at the eend. Some use the webkit user stylesheet facility, and so on. So just inserting a user sheet in the editormay or may not simulate what the sheet does on the device accurately.
|
![]() |
![]() |
![]() |
#5 | |
Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 517
Karma: 8500000
Join Date: Aug 2013
Location: Hamden, CT
Device: Kindle Paperwhite (11th gen), Scribe, Kindle 4 Touch
|
Quote:
Mostly, I just want to be able to undo the bad webkit defaults. I know I could do that by installing from source and changing to what I want, but that can get tedious with the rapid release schedule of Calibre (which is one of the things I like about it). |
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,163
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Actually running from source is trivial. Just set a single environment variable and if you want to update calibre, run a single git pull command. https://manual.calibre-ebook.com/develop.html
But, I have no problem with adding a stylesheet setting to the editor. It's just that I am a bit swamped at the moment, so open a bug report requesting the feature, and I'll get to it when I can. |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Feature Request: Mask calibre server connection string with user configurable name | Zealousky | Calibre Companion | 8 | 02-20-2015 08:17 AM |
User agent stylesheet: a proposal | roger64 | Editor | 4 | 12-27-2014 02:00 AM |
Feature request: Cleaning stylesheet | Terisa de morgan | Editor | 7 | 01-26-2014 10:24 AM |
Novice - Need help with user stylesheet | Dan__ | Library Management | 2 | 01-27-2013 05:59 AM |
User Stylesheet for Adobe Digital Editions | wallcraft | ePub | 6 | 09-15-2009 03:53 PM |