kennethormandy / normalize-opentype.css

Adds OpenType features—ligatures, kerning, and more—to Normalize.css.
http://kennethormandy.com/journal/normalize-opentype-css
MIT License
791 stars 29 forks source link

@extend body; in table produces undesired results #24

Closed matt-bailey closed 9 years ago

matt-bailey commented 9 years ago

In the code there is:

/**
 * 1. Resets tables to the same settings as the body.
 * 2. Turns on tabular, lining numerals and slashed zero
 */

table {
  @extend body; /* 1.*/
}

However, this can have unfortunate results depending on the styles you have applied to body. For example, the site I'm currently working on has a dark background colour applied to body, which is subsequently being applied to all tables.

It took me ages to figure out why my tables were 'inheriting' the dark background colour - it was only by disabling some of my imports that I was able to narrow it down to normalize-opentype, and then to this specific line of code.

I can, of course, get round this by overriding the background colour on tables, but I wondered what your thoughts are on this? Isn't this @extend a bit 'far reaching'?

rolandschuetz commented 9 years ago

I just ran into a similar issue, having min-width on the body element.

kennethormandy commented 9 years ago

This is definitely an oversight on my part, thanks for bringing it to my attention. I pushed a patch release which removes the use of @extends. You should be able to get it through npm or Bower:

npm install --save normalize-opentype.css
bower install normalize-opentype.css

I’ll be doing a bigger pass on what the Sass file should and shouldn’t be doing in the future, so if anything else like this comes up, definitely feel free to open more issues. Thanks!

matt-bailey commented 9 years ago

Thanks @kennethormandy, I'll update through bower.

rolandschuetz commented 9 years ago

Thanks for the fast fix!