Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 11-01-2012, 07:20 AM   #1
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
Cleaning the stylesheet

Hi

The new Sigil 0.6 feature"saved searches" allow us to make a lot of things in a very short time and in a very orderly way. I use it for more and more things. I wonder how I could live without it before...

Among them, I am considering suppressing many null parameters which clutter the stylesheet using a simple search and (not) replace. It is a tedious task that can easily be automated this way. Here they are. There are probably many others, but let's begin with these ones.

All margins:0, border:none, padding:0

Is there a drawback? I mean are these 0 or 'none' values of any utility? Ideally we should only keep the parameters which carry a value (+ or -). A missing parameter should be understood like carrying a 0 or 'none' value. Or am I wrong?

Do you do any cleaning this way? What do you systematically suppress?

Last edited by roger64; 11-01-2012 at 07:34 AM.
roger64 is offline   Reply With Quote
Old 11-01-2012, 07:37 AM   #2
Serpentine
Evangelist
Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.
 
Posts: 416
Karma: 1045911
Join Date: Sep 2011
Location: Cape Town, South Africa
Device: Kindle 3
They are fairly important to preserve. Different readers, browsers and software in general will come with defaults for everything from padding to fonts and colours. Hardcoding these values helps you keep things uniform. I quite often just use * { padding: 0; margin: 0; } etc, to kill any possible padding and margins at the start, then I can define those later on as I see fit.

In short : removing them is often a bad idea and for padding and the basic attributes, does not really give you any benefit performance wise. Rather spend the time culling and merging tags/classes/ids in your actual markup.
Serpentine is offline   Reply With Quote
Advert
Old 11-01-2012, 07:48 AM   #3
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
So it was not a good idea. Thanks for your advice. I will follow it and keep my margins 0.
roger64 is offline   Reply With Quote
Old 11-01-2012, 08:05 AM   #4
Serpentine
Evangelist
Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.
 
Posts: 416
Karma: 1045911
Join Date: Sep 2011
Location: Cape Town, South Africa
Device: Kindle 3
It's also worth pointing out that if you're targeting readers, the defaults set by the vendor are often really good and help to keep a uniform style. For example padding/margins on normal paragraphs is something best left alone. It takes a bit of thinking to use minimal styling, but at the end of the day, you usually end up with easily portable stylesheets and saving a lot of time.
Serpentine is offline   Reply With Quote
Old 11-08-2012, 04:15 AM   #5
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
Quote:
Originally Posted by Serpentine View Post
.../...For example padding/margins on normal paragraphs is something best left alone. It takes a bit of thinking to use minimal styling, but at the end of the day, you usually end up with easily portable stylesheets and saving a lot of time.
I try to achieve this "minimal styling" step by step.

One example: I usually do not use padding. In one book, I have 12 paragraph styles (out of 12) with the argument padding:0.. I wonder if it would not make sense to factorize it and give this argument to body instead of repeating it so many times...

Another example: I have a well defined main paragraph style (I tag it only with the letter p). Out of this one, I created many others with just a small difference: either indent, or margin, or font-style, or font-size... Why repeat all the p arguments?
p class something does not mean p with a difference?
roger64 is offline   Reply With Quote
Advert
Old 11-08-2012, 06:15 AM   #6
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,547
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Another example: I have a well defined main paragraph style (I tag it only with the letter p). Out of this one, I created many others with just a small difference: either indent, or margin, or font-style, or font-size...
That's how I do it. I like being able to browse through the code, and see at a glance, the plain-jain, every-day paragraphs. And conversely, when I see a 'p' with a class name, I know that something "special" in the way of formatting must be going on there.

I think what you're running into is ebooks that are being generated as opposed to ebooks being built. With programs such as calibre or other automated generation programs, the "every tag a class, every class/every parameter" approach makes logical, programmatic sense. The exact same code must work for every situation--every book every paragraph--, after all. But it certainly does't make as much sense (aesthetically anyway) when lovingly hand-crafting an ePub.

I don't see Sigil exacerbating this in any way, though... or is this just a general ePub styling discussion?
DiapDealer is offline   Reply With Quote
Old 11-08-2012, 07:20 AM   #7
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
No no, Sigil exacerbates nothing. Sigil is not the problem. Sigil could be the solution. I am evaluating the -huge- possibilities given by the new Sigil features "saved searches" and the clip editor (not to speak about "unused classes").

I can now perfect a check-list and try to improve my style-sheet.

You are right, my stylesheet is made by a converter. It's very handy and hassle-free. On the other hand, it's verbose and not nice-looking.

Another example that comes to my mind: I have way too many font-family., one for every style (I use embedded fonts). I already placed the biggest one in body and I have no problem. I only attribute a font to a style when it's a very special one (like smallcaps or Display).

I will try to simplify this way, item by item.


Edit: I did a careful trial but I surely missed some fine points. The resulting EPUB had a lot of defects. Putting a style sheet in order is not for the faint of heart... So for the time being, I keep my style sheet as it is.. Verbose but working.

Last edited by roger64; 11-08-2012 at 09:30 AM. Reason: Result
roger64 is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Link Stylesheet Does Not Appear smallstate Sigil 2 09-20-2012 07:43 AM
Cleaning a stylesheet of unused styles roger64 Sigil 49 06-13-2012 05:23 AM
How NOT to use a stylesheet? karyan Sigil 12 03-07-2012 12:43 PM
Stylesheet examples? Skitzman69 Sigil 15 09-24-2010 08:24 PM
Where is the stylesheet.css? roger64 Sigil 4 03-23-2010 02:12 PM


All times are GMT -4. The time now is 08:45 PM.


MobileRead.com is a privately owned, operated and funded community.