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

View File

@@ -25,14 +25,25 @@ class SP_Frontend_Scripts {
* @return array * @return array
*/ */
public static function get_styles() { public static function get_styles() {
return apply_filters( 'sportspress_enqueue_styles', array( $styles = array(
'sportspress-general' => array( 'sportspress-general' => array(
'src' => str_replace( array( 'http:', 'https:' ), '', SP()->plugin_url() ) . '/assets/css/sportspress.css', 'src' => str_replace( array( 'http:', 'https:' ), '', SP()->plugin_url() ) . '/assets/css/sportspress.css',
'deps' => '', 'deps' => '',
'version' => SP_VERSION, 'version' => SP_VERSION,
'media' => 'all' '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++; $j++;
if ( has_post_thumbnail ( $team ) ): if ( has_post_thumbnail ( $team ) ):
if ( $link_teams ): 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: else:
$logo = get_the_post_thumbnail( $team, 'sportspress-fit-icon', array( 'class' => 'team-logo logo-' . ( $j % 2 ? 'odd' : 'even' ) ) ); $logo = get_the_post_thumbnail( $team, 'sportspress-fit-icon', array( 'class' => 'team-logo logo-' . ( $j % 2 ? 'odd' : 'even' ) ) );
endif; endif;