Permalink
Browse files

simplify CSS rules for service icons, make them work properly when ne…

…sted. fixes #58
  • Loading branch information...
1 parent 8f63e35 commit e7eec86eced1969eb835bd1d4cd7115bb971c94f @alexkingorg alexkingorg committed Apr 25, 2012
Showing with 19 additions and 11 deletions.
  1. +4 −10 assets/comments.css
  2. +15 −1 views/comment/comment.php
View
@@ -606,25 +606,19 @@ override submit styles in TwentyEleven theme */
text-align: right;
}
-#social .social-comment .social-comment-meta,
-#social ol li ul li.social-comment .social-comment-meta {
+#social .social-comment-meta {
background-position: right -1px;
}
-#social .social-twitter .social-comment-meta,
-#social ol li ul li.social-twitter .social-comment-meta {
+#social .social-comment-meta-twitter {
background-position: right -100px;
}
-#social .social-facebook .social-comment-meta,
-#social .social-facebook-like .social-comment-meta,
-#social ol li ul li.social-facebook .social-comment-meta,
-#social ol li ul li.social-facebook-like .social-comment-meta {
+#social .social-comment-meta-facebook {
background-position: right -200px;
}
-#social .social-pingback .social-comment-meta,
-#social ol li ul li.social-pingback .social-comment-meta {
+#social .social-comment-meta-pingback {
background-position: right -400px;
}
View
@@ -3,6 +3,20 @@
if (strpos($comment_type, 'social-') === false) {
$comment_type = 'social-'.$comment_type;
}
+
+// set up the comment meta class (used for icon indicator)
+switch ($comment_type) {
+ case 'social-twitter':
+ case 'social-facebook':
+ case 'social-pingback':
+ case 'social-wordpress':
+ $parts = explode('-', $comment_type);
+ $comment_meta_class = $parts[0].'-comment-meta-'.$parts[1];
+ break;
+ default:
+ $comment_meta_class = 'social-comment-meta-wordpress';
+}
+
?>
<li <?php comment_class('social-comment social-clearfix '.esc_attr($comment_type)); ?> id="li-comment-<?php comment_ID(); ?>">
<div class="social-comment-inner social-clearfix" id="comment-<?php comment_ID(); ?>">
@@ -28,7 +42,7 @@
?>
</div>
<!-- .comment-author .vcard -->
- <div class="social-comment-meta">
+ <div class="social-comment-meta <?php echo esc_attr($comment_meta_class); ?>">
<span class="social-posted-from">
<?php if ($status_url !== null): ?>
<a href="<?php echo esc_url($status_url); ?>" title="<?php _e(sprintf('View on %s', $service->title()), 'social'); ?>" target="_blank">

0 comments on commit e7eec86

Please sign in to comment.