Auto-load RTL stylesheet

This commit is contained in:
Brian Miyaji
2014-10-22 18:51:53 +11:00
parent 13cb8cbada
commit 9796ec1f18
4 changed files with 84 additions and 10 deletions

View File

@@ -0,0 +1,58 @@
/* SportsPress RTL */
/* Thumbnails and Details */
.sp-template-logo,
.sp-template-photo {
float: right;
margin-right: 0;
margin-left: 2em;
}
/* Pagination */
.sp-pagination tfoot tr td.prev {
text-align: right;
}
.sp-pagination tfoot tr td.next {
text-align: left;
}
/* League Table and Player List */
.sp-league-table .data-name .team-logo,
.sp-player-list .data-name .player-photo {
margin-right: 0;
margin-left: 0.25em;
float: right;
}
/* Event Calendar */
.sp-event-calendar #next {
text-align: left;
}
.sp-event-calendar #prev {
text-align: right;
}
/* Event List */
.sp-event-list .data-article a .dashicons {
padding-right: 0;
padding-left: 3px;
}
/* Event Blocks */
.sp-event-blocks .logo-odd {
float: right;
}
.sp-event-blocks .logo-even {
float: left;
}
@media only screen and (max-width: 40em) {
.sp-pinned-table {
left: auto;
right: 0;
}
.sp-responsive-table-wrapper .scrollable {
margin-left: 0;
margin-right: 50%;
}
}

View File

@@ -6,12 +6,20 @@
overflow: visible;
}
/* Title */
.sp-event-logos {
margin-top: 0.5em;
margin-bottom: 0.5em;
/* Thumbnails and Details */
.sp-template-logo,
.sp-template-photo {
float: left;
margin-bottom: 2em;
margin-right: 2em;
max-width: 50%;
}
.sp-template-event-logos {
text-align: center;
}
.sp-template-details {
display: inline-block;
}
/* Data Tables */
.sp-scrollable-table-wrapper {
@@ -243,7 +251,6 @@
.sp-responsive-table {
margin-bottom: 0;
}
.sp-pinned-table {
position: absolute;
left: 0;
@@ -265,7 +272,6 @@
.sp-pinned-table td:last-child {
border-bottom: 0;
}
.sp-responsive-table-wrapper {
position: relative;
overflow: hidden;
@@ -278,7 +284,6 @@
overflow: scroll;
overflow-y: hidden;
}
.sp-responsive-table-wrapper .scrollable td,
.sp-responsive-table-wrapper .scrollable th {
position: relative;

View File

@@ -25,14 +25,25 @@ class SP_Frontend_Scripts {
* @return array
*/
public static function get_styles() {
return apply_filters( 'sportspress_enqueue_styles', array(
$styles = array(
'sportspress-general' => array(
'src' => str_replace( array( 'http:', 'https:' ), '', SP()->plugin_url() ) . '/assets/css/sportspress.css',
'deps' => '',
'version' => SP_VERSION,
'media' => 'all'
),
));
);
if ( is_rtl() ):
$styles['sportspress-rtl'] = array(
'src' => str_replace( array( 'http:', 'https:' ), '', SP()->plugin_url() ) . '/assets/css/sportspress-rtl.css',
'deps' => '',
'version' => SP_VERSION,
'media' => 'all'
);
endif;
return apply_filters( 'sportspress_enqueue_styles', $styles );
}
/**

View File

@@ -64,7 +64,7 @@ if ( isset( $columns ) )
$j++;
if ( has_post_thumbnail ( $team ) ):
if ( $link_teams ):
$logo = '<a href="' . get_post_permalink( $team ) . '" title="' . get_the_title( $team ) . '">' . get_the_post_thumbnail( $team, 'sportspress-fit-icon', array( 'class' => 'team-logo logo-' . ( $j % 2 ? 'odd' : 'even' ) ) ) . '</a>';
$logo = '<a class="team-logo logo-' . ( $j % 2 ? 'odd' : 'even' ) . '" href="' . get_post_permalink( $team ) . '" title="' . get_the_title( $team ) . '">' . get_the_post_thumbnail( $team, 'sportspress-fit-icon' ) . '</a>';
else:
$logo = get_the_post_thumbnail( $team, 'sportspress-fit-icon', array( 'class' => 'team-logo logo-' . ( $j % 2 ? 'odd' : 'even' ) ) );
endif;