01-25-2020, 05:27 AM | #1 |
Wizard
Posts: 3,305
Karma: 10259306
Join Date: May 2016
Device: kobo forma, Kobo Libra, Huawei media Tab, fire HD10, PW3 HDX8.9,
|
styles not shown alphabetically?
when styles such as pcalibre get introduced by a conversion
why are they not shown in the expected alphabetic place i.e. next to other styles beginning with .p.... I was struggling to find one, which I could see in the book code, but not in the styles list...eventually i find it with a search - and it's not with the .p... CSS entries, but below the .X... entries is there some subtle reason for that? e.g. ( copied from sigil CSS list) note that the .pcalibre... styles come after all of the .x styles .x13-bm-index2 { display: block; font-size: 0.7em; margin-bottom: 0; margin-left: 3.06em; margin-right: 0; margin-top: 0; orphans: 2; text-indent: -0.94em; widows: 2 } .pcalibre4:visited { -webkit-text-fill-color: rgb(255, 102, 0); color: rgb(255, 102, 0); text-decoration: underline } .pcalibre6:link { -webkit-text-fill-color: rgb(255, 102, 0); color: rgb(255, 102, 0); text-decoration: underline } .pcalibre1:first-letter { color: #818180; float: left; font-size: 2.6em; margin-bottom: 0; margin-left: 0; margin-right: 0.05em; margin-top: 0 } .pcalibre:first-letter { color: #818180; float: left; font-size: 4em; margin-bottom: 0; margin-left: 0; margin-right: 0.05em; margin-top: 0 } |
01-25-2020, 06:26 AM | #2 |
Grand Sorcerer
Posts: 27,549
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
To my knowledge, the content of a css file have never been alphabetized by Sigil. Was this perhaps intended for a calibre forum? Or am I just somehow missing the gist of the question?
Last edited by DiapDealer; 01-25-2020 at 06:29 AM. |
Advert | |
|
01-25-2020, 06:47 AM | #3 |
Wizard
Posts: 3,305
Karma: 10259306
Join Date: May 2016
Device: kobo forma, Kobo Libra, Huawei media Tab, fire HD10, PW3 HDX8.9,
|
strange. i have been using sigil for years, and stuff looks alphabetized ( except for the above). you are suggesting that happens in calibre, before I get to opening and editing in sigil?
my usual workflow ( initial epub-> epub convert ( to do various automated add/remove things) then a final tweak/edit in sigil. one think i do regularly in sigi is remove unused CSS classes. I assumed that CSS stuff got tidied and sorted then? i could ask again in calibre forum except that it against the rules to ask the same Q in 2 places. i guess that the .pcalibre things are some subset of styles in that they apply tweaks to the main styles? because when calibre creates or renames styles they usually go .calibre1, .calibre2... and are filed under c. e.g. there is often a "pcalibre" style that is only used for a dropcap. Its not obvious from the book code but a detailed inspect of .pcalibre class, once I find it , shows a :firstletter bit inside so what happens is that I look in book view ( shock, horror, but old dogs can't learn new tricks), I see some hideous misplaced (post conversion) dropcap and go looking for the style that's putting it there.. in most books the offending style will still be called "dropcap", but some books will have a structure like <p someclass pcalibre> first para of text </p> where pcalibre is acting only on a single letter the query got posted after staring at the styles page in sigil for ages and not finding pcalibre listed with the p... styles I'd be happy for some empowered person to move the whole thread Last edited by stumped; 01-25-2020 at 06:56 AM. |
01-25-2020, 08:18 AM | #4 |
A Hairy Wizard
Posts: 3,095
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
No, Sigil has never rearranged the order of CSS, nor should it.
CSS rules have a hierarchy and the most recently applied style (the one at the bottom of the list) has priority over any others unless those others have a higher specificity. If Sigil rearranged that order it would be massively incorrect... If you have been working with an alphabetized CSS sheet, it is because it was originally designed that way. IMO, you lose a lot of readability/editability/understandability (and maybe a few other abilities) when you have a straight up alphabetization rather than actual descriptive names. Code:
style1 {} style2 {} style3 {} style4 {} VS. .title {} .underline {} .firstpara {} .newsection {} Spoiler:
In Sigil (and I think Calibre has a similar feature) you can be taken directly to the correct style by ctrl-click on the class in the code view. This assumes, of course, that the CSS file is correctly linked to the html file, and that there, in fact, IS a defined style... Last edited by Turtle91; 01-25-2020 at 08:30 AM. |
01-25-2020, 08:20 AM | #5 | |
Grand Sorcerer
Posts: 27,549
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
If anyone has any first-hand knowledge of Sigil alphabetizing the list in the past when reformatting, I'd be happy to investigate, but I certainly don't recall it. Do you have a preference where? |
|
Advert | |
|
01-25-2020, 08:47 AM | #6 |
Wizard
Posts: 3,305
Karma: 10259306
Join Date: May 2016
Device: kobo forma, Kobo Libra, Huawei media Tab, fire HD10, PW3 HDX8.9,
|
Duh, CSS heirarchy rules. I knew that once, then completely overlooked it, thanks to Turtle91 for reminding me.
As to where to move the thread to, I think the bin would now be best. Sorry to all. |
01-25-2020, 09:14 AM | #7 |
Grand Sorcerer
Posts: 27,549
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
No problem. It may prove educational to others, so I'll just let it fall off the screen of its own accord.
|
01-25-2020, 09:41 AM | #8 |
Well trained by Cats
Posts: 29,803
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
IIRC there were CSS SORT plugins you could install and use at your whim
(by my choice ) BTW this can also break a styling that made use ( worms for the unsuspecting ) of the Cascade by later redefining an attribute |
01-25-2020, 09:56 AM | #9 |
Wizard
Posts: 3,305
Karma: 10259306
Join Date: May 2016
Device: kobo forma, Kobo Libra, Huawei media Tab, fire HD10, PW3 HDX8.9,
|
|
01-25-2020, 11:37 AM | #10 |
mostly an observer
Posts: 1,515
Karma: 987654
Join Date: Dec 2012
Device: Kindle
|
I've been using Sigil since January 2012, and my (unalphabetized) style sheet has never changed. All paragraph styles are together, but they precede the heading styles. If there's any order, it's probably by frequency of my using them.
|
01-25-2020, 02:48 PM | #11 |
Running with scissors
Posts: 1,552
Karma: 14325282
Join Date: Nov 2019
Device: none
|
On the other hand, in your example it also looks like within each selector the declarations / properties are sorted, e.g. widows comes after font-size. That I like to do.
|
01-26-2020, 07:19 AM | #12 |
Wannabe Connoisseur
Posts: 425
Karma: 2516674
Join Date: Apr 2011
Location: Geelong, Australia
Device: Kobo Libra 2, Kobo Aura 2, Sony PRS-T1, Sony PRS-350, Palm TX
|
I prefer to see margin options in top,bottom,left,right order. That makes more sense to me. Otherwise order of items in each selector seems to vary on what I think is most important at the time, and this definitely has changed over time.
|
01-26-2020, 10:47 AM | #13 | |
A Hairy Wizard
Posts: 3,095
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
Quote:
eg: Spoiler:
I typically will just copy/paste a previous style definition then make mods as needed. That may be why the order of style definitions is similar between selectors. When I am done editing a book I use the cssRemoveUnusedSelectors plugin to get rid of anything I don't need in that book. It also reformats the stylesheet to make it look pretty, but it doesn't rearrange anything. |
|
01-26-2020, 11:03 AM | #14 |
Well trained by Cats
Posts: 29,803
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
I think many of us have saved clips of OUR way of doing things.
The only WRONG ones, are the one that do not work (or cause devices to crash) |
01-26-2020, 05:35 PM | #15 |
null operator (he/him)
Posts: 20,570
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Sort Libraries Alphabetically | MerlinMama | Calibre | 2 | 08-20-2017 02:28 PM |
Reorder alphabetically the tags of a book | BlackWinny | Library Management | 1 | 06-24-2017 10:26 PM |
Sort TOC alphabetically | 1v4n0 | ePub | 12 | 05-10-2014 12:48 PM |
Books not listed alphabetically on glo | Nascarfan1972 | Kobo Reader | 2 | 12-27-2012 03:48 PM |
setting author surname alphabetically | makeitsimple | Library Management | 1 | 03-07-2011 02:52 AM |