Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Editor

Notices

Reply
 
Thread Tools Search this Thread
Old Today, 09:25 AM   #1
enuddleyarbl
Guru
enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.
 
enuddleyarbl's Avatar
 
Posts: 738
Karma: 1077122
Join Date: Sep 2013
Device: Kobo Forma
Confused About Computed Final Style

I'm having a bit of trouble understanding where Calibre's Editor is getting its Computed Final Style here (I've included all the details below). Specifically:
  1. How is it coming up with its computed "font-size" -- it's 13.9392px for the headline, but 15.84px for the plain paragraph? As far as I can tell, those sizes should be the same (the only references to font-size and font-weight are 0.88em and bold (which both styles have)). Unless smallcaps have an inherent smaller size than regular text (which might be implied from the "small" in the name)?
  2. Why is it referencing identically named <p> styles in my stylesheet instead of just the <div> styles that I think should apply? I thought <div> styles took precedence over <p> styles. Or, do just the specifically mentioned elements of those styles just get overridden if duplicated and unique entries just carry through?
  3. The "div.status p.headline" Live CSS for the headline includes various "font-variant" entries. Are those brought in automatically from my use of "font-variant: small-caps" in the headline style?

Unfortunately, this is going to be long.

Here's the chunk of text in the book that I'm wondering about:

CSS in Book
Code:
  <div class="status">

    <p class="headline">Absorb Condition</p>

    <p>Cost: 10 For Duration: Instant</p>

    <p>...</p>

  </div>
The CSS for those styles in the stylesheet is:

Stylesheet Information
Code:
div.status {
  /* Status Styling for Computer Screen Responses */
  display: block;
  font-size: 0.88em;
  font-weight: bold;
  margin-left: 2em;
  margin-right: 2em;
  text-align: left;
}
div.status p {
  /* Status Paragraph Style for Computer Screen Responses */
  display: block;
  margin-top:	0;
  margin-bottom:	0;
  text-indent: 0;
}
div.status p.headline {
	/* Status Heading for Computer Screen Responses */
	display: block;
	font-variant: small-caps;
	text-align: center;
}
If I click in the headline of that <div>, here's the Live CSS:

Status Headline Live CSS
Code:
Matched CSS rules for p @216
stylesheet.css div.status p.headline
display: block 
font-variant-ligatures: normal 
font-variant-numeric: normal 
font-variant-east-asian: normal 
font-variant-caps: small-caps 
font-variant-alternates: normal 
font-variant-position: normal 
text-align: center 
--------------------------

stylesheet.css div.status p
display: block  [overridden]
margin-top: 0px 
margin-bottom: 0px 
text-indent: 0px 
--------------------------

stylesheet.css .headline
display: block  [overridden]
font-size: 0.88em 
font-weight: bold 
padding-bottom: 0.6em 
padding-top: 0.6em 
text-align: center  [overridden]
text-indent: 0px  [overridden]
--------------------------

stylesheet.css p
display: block  [overridden]
text-indent: 1.2em  [overridden]
--------------------------

Inherited from div @214
stylesheet.css div.status
font-size: 0.88em  [overridden]
font-weight: bold  [overridden]
text-align: left  [overridden]
--------------------------

Inherited from body @9
stylesheet.css body
orphans: 1 
widows: 1 
--------------------------

Computed final style
display: block 
font-size: 13.9392px 
font-variant-alternates: normal 
font-variant-caps: small-caps 
font-variant-east-asian: normal 
font-variant-ligatures: normal 
font-variant-numeric: normal 
font-variant-position: normal 
font-weight: 700 
margin-bottom: 0px 
margin-top: 0px 
orphans: 1 
padding-bottom: 8.36352px 
padding-top: 8.36352px 
text-align: center 
text-indent: 0px 
widows: 1 
--------------------------
If I click in a plain ol' paragraph in that <div>, the Live CSS is:

Status Paragraph Live CSS
Code:
Matched CSS rules for p @218
stylesheet.css div.status p
display: block 
margin-top: 0px 
margin-bottom: 0px 
text-indent: 0px 
--------------------------

stylesheet.css  .headline + p
text-indent: 0px  [overridden]
--------------------------

stylesheet.css p
display: block  [overridden]
text-indent: 1.2em  [overridden]
--------------------------

stylesheet.css * + *
margin-top: 0.6em  [overridden]
--------------------------

Inherited from div @214
stylesheet.css div.status
font-size: 0.88em 
font-weight: bold 
text-align: left 
--------------------------

Inherited from body @9
stylesheet.css body
orphans: 1 
widows: 1 
--------------------------

Computed final style
display: block 
font-size: 15.84px 
font-weight: 700 
margin-bottom: 0px 
margin-top: 0px 
orphans: 1 
text-align: left 
text-indent: 0px 
widows: 1 
--------------------------

Last edited by enuddleyarbl; Today at 01:42 PM.
enuddleyarbl is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
confused about style inheritance lumpynose ePub 8 05-14-2019 10:07 AM
Showing template-computed columns as [rating] stars isn't possible? kaoruAngel Library Management 2 11-06-2017 08:49 AM
Feature request: new CSS class from computed style kat7 Sigil 23 01-02-2015 01:30 PM
Final Round 3: Calling Sony Style re: PRS-500 Firmware upgrade AprilHare Sony Reader 10 12-09-2009 10:02 PM


All times are GMT -4. The time now is 02:21 PM.


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