Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Post social icon styles updates #951

Merged
merged 13 commits into from
Nov 3, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 38 additions & 26 deletions css/editor-style.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion css/editor-style.min.css

Large diffs are not rendered by default.

86 changes: 56 additions & 30 deletions css/style.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion css/style.min.css

Large diffs are not rendered by default.

30 changes: 14 additions & 16 deletions inc/post-tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,39 +160,37 @@ function largo_byline( $echo = true, $exclude_date = false, $post = null ) {
function largo_post_social_links( $echo = true ) {
$utilities = of_get_option( 'article_utilities' );

$output = '<div class="post-social clearfix"><div class="left">';
$output = '<div class="largo-follow post-social clearfix">';

if ( $utilities['twitter'] === '1' ) {
$twitter_share = '<span class="twitter"><a target="_blank" href="https://twitter.com/intent/tweet?text=%1$s&url=%2$s&via=%3$s"><i class="icon-twitter"></i> %4$s</a></span>';
if ( $utilities['facebook'] === '1' ) {
$fb_share = '<span class="facebook"><a target="_blank" href="http://www.facebook.com/sharer/sharer.php?u=%1$s"><i class="icon-facebook"></i><span class="hidden-phone">%2$s</span></a></span>';
$output .= sprintf(
$twitter_share,
esc_attr( get_the_title() ),
$fb_share,
esc_attr( get_permalink() ),
esc_attr( get_the_author_meta( 'twitter' ) ),
esc_attr( __( 'Tweet', 'largo' ) )
esc_attr( ucfirst( of_get_option( 'fb_verb' ) ) )
);
}

if ( $utilities['facebook'] === '1' ) {
$fb_share = '<span class="facebook"><a target="_blank" href="http://www.facebook.com/sharer/sharer.php?u=%1$s"><i class="icon-facebook"></i> %2$s</a></span>';
if ( $utilities['twitter'] === '1' ) {
$twitter_share = '<span class="twitter"><a target="_blank" href="https://twitter.com/intent/tweet?text=%1$s&url=%2$s&via=%3$s"><i class="icon-twitter"></i><span class="hidden-phone">%4$s</span></a></span>';
$output .= sprintf(
$fb_share,
$twitter_share,
esc_attr( get_the_title() ),
esc_attr( get_permalink() ),
esc_attr( ucfirst( of_get_option( 'fb_verb' ) ) )
esc_attr( get_the_author_meta( 'twitter' ) ),
esc_attr( __( 'Tweet', 'largo' ) )
);
}

$output .= '</div><div class="right">';

if ( $utilities['print'] === '1' ) {
$output .= '<span class="print"><a href="#" onclick="window.print()" title="' . esc_attr( __( 'Print this article', 'largo' ) ) . '" rel="nofollow"><i class="icon-print"></i> ' . esc_attr( __( 'Print', 'largo' ) ) . '</a></span>';
$output .= '<span class="print"><a href="#" onclick="window.print()" title="' . esc_attr( __( 'Print this article', 'largo' ) ) . '" rel="nofollow"><i class="icon-print"></i><span class="hidden-phone">' . esc_attr( __( 'Print', 'largo' ) ) . '</span></a></span>';
}

if ($utilities['email'] === '1' ) {
$output .= '<span data-service="email" class="email custom-share-button icon-mail share-button"> Email</span>';
$output .= '<span data-service="email" class="email custom-share-button share-button"><i class="icon-mail"></i> <span class="hidden-phone">Email</span></span>';
}

$output .= '</div></div>';
$output .= '</div>';

if ( $echo ) {
echo $output;
Expand Down
3 changes: 0 additions & 3 deletions less/inc/responsive-767px-max.less
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,6 @@
// UP TO LANDSCAPE PHONE
// ---------------------
@media (max-width: 480px) {
.post-social .print {
display: none;
}
#header-search {
float:right;
}
Expand Down
75 changes: 46 additions & 29 deletions less/inc/single.less
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,6 @@ body.normal.page {
padding-right: 0;
}
}
.post-social {
border-top: none;
border-bottom: none;
}
}

#comments,
Expand Down Expand Up @@ -217,41 +213,62 @@ body.normal.page {

/* 2.2 - Social media links */

@media (max-width: 768px) {
.post-social > span {
min-width: 50px;
text-align: center;
display: inline-block;
}
}

@media (min-width: 769px) {
.post-social > span {
display: inline-block;
}
// Fudging to prevent overlap between the icon and the text
.post-social i {
margin-right: 0.5em;
margin-left: 0.2em;
}
}
.post-social {
margin-bottom: @baseline;
border-top: 1px solid @grayLighter;
border-bottom: 1px solid @grayLighter;
.right,
.left {
margin: 0;
height: auto;
}
span {
font-family: Verdana, Helvetica, sans-serif;
&> span {
// copied from widgets/largo-follow.less
line-height: 1.5em;
max-width: 250px;
margin: 0.5em 0;
padding: 0.3em 0.6em;
text-align: center;

text-transform: uppercase;
font-weight: 300;
font-family: @sansFontFamily;
position: relative;
margin-right: @baseFontSize;
font-size: @baseFontSize - 2;
font-size: @baseFontSize;
color: white;
&:hover {
.opacity(85);
}
&:last-child {
margin-right: 0;
}
a {
color: black;
&:hover {
text-decoration: none;
i {
.opacity(85);
}
}
a {
color: white;
&:hover {
color: white;
text-decoration: none;
i {
.opacity(85);
}
}
i, &::before {
position: relative;
}
&.email:hover {
cursor: pointer;
}
}
i, &::before {
position: relative;
}
.email:hover {
cursor: pointer;
}
}

Expand All @@ -264,7 +281,7 @@ body.normal.page {
text-transform: uppercase;
font-size: @baseFontSize * 0.815;
&:first-child {
padding-left: 0;
padding-left: 0;
}
}
}
Expand Down
5 changes: 4 additions & 1 deletion less/inc/widgets.less
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
/* 1.1 - Base styles */

.widget {
padding: 0 @baseline;
margin-bottom: @baseline * 1.5;
p, ul {
font-size: @baseFontSize;
Expand Down Expand Up @@ -96,6 +95,10 @@
max-width: 100%;
}

/* 1.6 - sidebar styles */
#sidebar .widget {
padding: 0 @baseline;
}
/*------------------------------------------------------------------------------
2 - Wordpress default widget styles

Expand Down
15 changes: 15 additions & 0 deletions less/inc/widgets/largo-follow.less
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
}
}

// These colors also used in .post-social in single.less
.largo-follow {
.rss {
background-color: @rss;
Expand Down Expand Up @@ -73,6 +74,20 @@
background-color: darken(@youtube, 5%);
}
}
.print {
background-color: #85898F;
color:#fff;
&:hover {
background-color: darken(#85898F, 5%);
}
}
.email {
background-color: #62656F;
color:#fff;
&:hover {
background-color: darken(#62656F, 5%);
}
}
.social-btn {
line-height: 1.5em;
max-width: 250px;
Expand Down
2 changes: 0 additions & 2 deletions tests/inc/test-post-tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ function test_largo_post_social_links() {
largo_post_social_links();
$ret = ob_get_clean();
$this->assertRegExp('/post-social/', $ret, "The .post-social class was not in the output");
$this->assertRegExp('/left/', $ret, "The .left class was not in the output");
$this->assertRegExp('/right/', $ret, "The .right class was not in the output");
unset($ret);

// Test that this outputs the expected data for each of the button types
Expand Down