From 762c6a0b188efda2d4a8575fed64988d97bc6045 Mon Sep 17 00:00:00 2001 From: Jeff Siegel Date: Fri, 29 Oct 2010 02:06:18 -0600 Subject: [PATCH] IE8 compat for :last-child selector --- doc-src/content/CHANGELOG.markdown | 1 + .../compass/utilities/lists/_horizontal-list.scss | 6 +++++- .../stylesheets/compass/utilities/lists/_inline-list.scss | 8 +++++++- .../stylesheets/compass/utilities/tables/_borders.scss | 8 +++++++- 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/doc-src/content/CHANGELOG.markdown b/doc-src/content/CHANGELOG.markdown index 25793da7..ac55fb8e 100644 --- a/doc-src/content/CHANGELOG.markdown +++ b/doc-src/content/CHANGELOG.markdown @@ -16,6 +16,7 @@ COMPASS CHANGELOG * You can now pass --no-line-comments to the Compass command line to disable line comments. * Make the compass configuration file more self documenting by adding comments for `preferred_syntax`, `output_style`, and `line_comments`. +* Work around IE compatibility issues with the :last-child selector. [Commit](http://github.com/jdsiegel/compass/commit/c1fb764dba9c54cc5d02f2f7de213fb21ac6ca09). 0.10.6 (10/11/2010) ------------------- diff --git a/frameworks/compass/stylesheets/compass/utilities/lists/_horizontal-list.scss b/frameworks/compass/stylesheets/compass/utilities/lists/_horizontal-list.scss index 297e895a..159b6599 100644 --- a/frameworks/compass/stylesheets/compass/utilities/lists/_horizontal-list.scss +++ b/frameworks/compass/stylesheets/compass/utilities/lists/_horizontal-list.scss @@ -31,6 +31,9 @@ // // :last-child is not fully supported // see http://www.quirksmode.org/css/contents.html#t29 for the support matrix +// +// IE8 ignores rules that are included on the same line as :last-child +// see http://www.richardscarrott.co.uk/posts/view/ie8-last-child-bug for details // // Setting `$padding` to `false` disables the padding between list elements @mixin horizontal-list-item($padding: 4px, $direction: left) { @@ -43,7 +46,8 @@ right: $padding; } &:first-child, &.first { padding-#{$direction}: 0; } - &:last-child, &.last { padding-#{opposite-position($direction)}: 0; } + &:last-child { padding-#{opposite-position($direction)}: 0; } + &.last { padding-#{opposite-position($direction)}: 0; } } } diff --git a/frameworks/compass/stylesheets/compass/utilities/lists/_inline-list.scss b/frameworks/compass/stylesheets/compass/utilities/lists/_inline-list.scss index 6a26f1b4..29bc74fc 100644 --- a/frameworks/compass/stylesheets/compass/utilities/lists/_inline-list.scss +++ b/frameworks/compass/stylesheets/compass/utilities/lists/_inline-list.scss @@ -17,12 +17,18 @@ // // `:last-child` is not fully supported. // see quirksmode for the [support matrix](http://www.quirksmode.org/css/contents.html#t29). +// +// IE8 ignores rules that are included on the same line as :last-child +// see http://www.richardscarrott.co.uk/posts/view/ie8-last-child-bug for details @mixin comma-delimited-list { @include inline-list; li { &:after { content: ", "; } - &:last-child, &.last { + &:last-child { + &:after { content: ""; } + } + &.last { &:after { content: ""; } } } diff --git a/frameworks/compass/stylesheets/compass/utilities/tables/_borders.scss b/frameworks/compass/stylesheets/compass/utilities/tables/_borders.scss index 81434d9f..120896dc 100644 --- a/frameworks/compass/stylesheets/compass/utilities/tables/_borders.scss +++ b/frameworks/compass/stylesheets/compass/utilities/tables/_borders.scss @@ -20,8 +20,14 @@ &:last-child, &.last { border-right-width: 0px; } } + +// IE8 ignores rules that are included on the same line as :last-child +// see http://www.richardscarrott.co.uk/posts/view/ie8-last-child-bug for details + tbody, tfoot { - tr:last-child, + tr:last-child { + th, td { + border-bottom-width: 0px; } } tr.last { th, td { border-bottom-width: 0px; } } } }