A double post but here I think that I've got some
better suggestions and even a possible "bug".
I upload a small test book (don't worry about its title, it's just the book I use for several testings) where I've been playing a little with styles...
I don't know what the HTML/CSS/ePub specs actually say but it really seems that the priority of CSS styles is:
- style attribute inside the tag.
- id referenced styles.
- class referenced styles.
- tag referenced styles.
- inherited styles.
- In case of conflictive definitions, the highest priority goes to the style defined in the same html file and then to the linked css style files.
- Within the same location, the highest priority goes to the last defined entry. I mean a style in line 2 has lower priority than a style in line 85
- More over, even without being conflictive, classes can be defined in several places and also several classes can be applied to the same tag. In this case:
- The first rule is the location one. Classes from the very same html file have higher priority than classes from linked CSS files.
- Within the same location, when they are not conflictive, they are alphabetically sorted. .a class has higher priority than .z one
Well, I have two suggestions:
- Would it be possible to strike through the overridden settings in the same way the Inspector does?
- (In this one there's a very high possibility about saying tons of nonsense per second. Be warned). Kovid, please check the displayed order you have in Live CSS. It appears that you are displaying the styles from the very same html file always before the styles from linked CSS files, even if they have lower priority. I mean compare both "full" screenshots, you are displaying the blue p style from the html file before the orange and gold classes and even the much higher priority magenta id style from the linked CSS style file.
Nevertheless this is just a "rendering" issue. The computed final style is correctly evaluated. See the "Wrong order in CSS Live but good evaluation" screenshot where I've just deleted the in-tag red style color.
But if I have not made any mistake, "fixing" the shown order to match the real one (as Inspector does) would be great, as it can be confusing.