Add LTR and RTL stylesheets

This commit is contained in:
Brian Miyaji
2017-01-11 00:25:10 +11:00
parent e9005036ae
commit 9947216dc6
4 changed files with 90 additions and 18 deletions

View File

@@ -0,0 +1,25 @@
/* SportsPress Templates LTR */
/*
* Note: !important everything to enforce overrides.
* This stylesheet can be disabled via SportsPress General Settings.
*/
.sp-tournament-bracket .sp-team .sp-team-name:before {
border-left-color: #e5e5e5 !important;
border-right-color: #e5e5e5 !important;
left: -10px !important;
}
.sp-tournament-bracket .sp-team-flip .sp-team-name:before {
left: auto !important;
right: -10px !important;
}
.sp-tournament-bracket .sp-team.sp-first-round .sp-team-name {
margin-left: -1px !important;
}
.sp-tournament-bracket .sp-team.sp-last-round .sp-team-name {
margin-right: -1px !important;
}

View File

@@ -0,0 +1,25 @@
/* SportsPress Templates RTL */
/*
* Note: !important everything to enforce overrides.
* This stylesheet can be disabled via SportsPress General Settings.
*/
.sp-tournament-bracket .sp-team .sp-team-name:before {
border-right-color: #e5e5e5 !important;
border-left-color: #e5e5e5 !important;
right: -10px !important;
}
.sp-tournament-bracket .sp-team-flip .sp-team-name:before {
right: auto !important;
left: -10px !important;
}
.sp-tournament-bracket .sp-team.sp-first-round .sp-team-name {
margin-right: -1px !important;
}
.sp-tournament-bracket .sp-team.sp-last-round .sp-team-name {
margin-left: -1px !important;
}

View File

@@ -91,6 +91,7 @@
/* Images */
.sp-template img {
display: inline-block !important;
box-shadow: none !important;
}
@@ -354,7 +355,9 @@
color: #333 !important;
}
.sp-template-event-logos a,
.sp-template-event-logos a:hover {
border: none !important;
text-decoration: none !important;
}
@@ -478,26 +481,40 @@
background: #00a69c !important;
}
/* Timelines */
.sp-template-timeline .sp-timeline * {
color: initial !important;
}
/* Tournaments */
.sp-tournament-bracket {
color: #333 !important;
background: transparent !important;
width: 100% !important;
border-collapse: separate !important;
}
.sp-tournament-bracket a,
.sp-tournament-bracket a:hover {
text-decoration: none !important;
color: inherit !important;
border: none! important;
}
.sp-tournament-bracket th {
.sp-tournament-bracket tr,
.sp-tournament-bracket th,
.sp-tournament-bracket td {
border: none !important;
}
.sp-tournament-bracket thead th {
font-size: 12px !important;
font-weight: 500 !important;
color: rgba(51,51,51,0.5) !important;
text-align: center !important;
border: none !important;
border-bottom: 1px solid #e5e5e5 !important;
}
.sp-tournament-bracket .sp-team-name {
@@ -508,24 +525,13 @@
border: 1px solid #e5e5e5 !important;
}
.sp-tournament-bracket .sp-team-name:hover,
.sp-tournament-bracket .sp-heading {
.sp-tournament-bracket .sp-heading,
.sp-tournament-bracket .sp-heading:hover {
color: #fff !important;
background: #00a69c !important;
border-color: #00a69c !important;
}
.sp-tournament-bracket .sp-team .sp-team-name:before {
border-left-color: #e5e5e5 !important;
border-right-color: #e5e5e5 !important;
left: -10px !important;
}
.sp-tournament-bracket .sp-team-flip .sp-team-name:before {
left: auto !important;
right: -10px !important;
}
.sp-tournament-bracket .sp-event {
border-color: #e5e5e5 !important;
border-width: 1px !important;

View File

@@ -89,6 +89,22 @@ class SportsPress_Style {
'media' => 'all'
);
if ( is_rtl() ) {
$styles['sportspress-style-rtl'] = array(
'src' => str_replace( array( 'http:', 'https:' ), '', SP()->plugin_url() ) . '/assets/css/sportspress-style-rtl.css',
'deps' => 'sportspress-style',
'version' => SP_STYLE_VERSION,
'media' => 'all'
);
} else {
$styles['sportspress-style-ltr'] = array(
'src' => str_replace( array( 'http:', 'https:' ), '', SP()->plugin_url() ) . '/assets/css/sportspress-style-ltr.css',
'deps' => 'sportspress-style',
'version' => SP_STYLE_VERSION,
'media' => 'all'
);
}
return $styles;
}
@@ -123,16 +139,16 @@ class SportsPress_Style {
// Background
echo '.sp-table-caption,.sp-data-table,.sp-data-table tfoot,.sp-template .sp-view-all-link,.sp-template-gallery .sp-gallery-group-name,.sp-template-gallery .sp-gallery-wrapper,.sp-template-countdown .sp-event-name,.sp-countdown time,.sp-template-details dl,.sp-event-statistics .sp-statistic-bar,.sp-tournament-bracket .sp-team-name,.sp-profile-selector{background:' . $colors['background'] . ' !important}';
echo '.sp-table-caption,.sp-data-table,.sp-data-table td,.sp-template .sp-view-all-link,.sp-template-gallery .sp-gallery-group-name,.sp-template-gallery .sp-gallery-wrapper,.sp-template-countdown .sp-event-name,.sp-countdown time,.sp-countdown span,.sp-template-details dl,.sp-event-statistics .sp-statistic-bar,.sp-tournament-bracket .sp-team-name,.sp-tournament-bracket .sp-event,.sp-profile-selector{border-color:' . $colors['background_border'] . ' !important}';
echo '.sp-table-caption,.sp-data-table,.sp-data-table td,.sp-template .sp-view-all-link,.sp-template-gallery .sp-gallery-group-name,.sp-template-gallery .sp-gallery-wrapper,.sp-template-countdown .sp-event-name,.sp-countdown time,.sp-countdown span,.sp-template-details dl,.sp-event-statistics .sp-statistic-bar,.sp-tournament-bracket thead th,.sp-tournament-bracket .sp-team-name,.sp-tournament-bracket .sp-event,.sp-profile-selector{border-color:' . $colors['background_border'] . ' !important}';
echo '.sp-tournament-bracket .sp-team .sp-team-name:before{border-left-color:' . $colors['background_border'] . ' !important;border-right-color:' . $colors['background_border'] . ' !important}';
echo '.sp-data-table .sp-highlight,.sp-data-table .highlighted td{background:' . $colors['background_highlight'] . ' !important}';
// Text
echo '.sp-template *,.sp-data-table *,.sp-table-caption,.sp-data-table tfoot a:hover,.sp-template .sp-view-all-link a:hover,.sp-template-gallery .sp-gallery-group-name,.sp-template-details dd,.sp-template-event-blocks .sp-event-results,.sp-tournament-bracket,.sp-tournament-bracket .sp-event .sp-event-title:hover,.sp-tournament-bracket .sp-event .sp-event-title:hover *{color:' . $colors['text'] . ' !important}';
echo '.sp-template *,.sp-data-table *,.sp-table-caption,.sp-data-table tfoot a:hover,.sp-template .sp-view-all-link a:hover,.sp-template-gallery .sp-gallery-group-name,.sp-template-details dd,.sp-template-event-logos .sp-team-name,.sp-template-event-logos .sp-team-result,.sp-template-event-blocks .sp-event-results,.sp-tournament-bracket,.sp-tournament-bracket .sp-event .sp-event-title:hover,.sp-tournament-bracket .sp-event .sp-event-title:hover *{color:' . $colors['text'] . ' !important}';
echo '.sp-template .sp-view-all-link a,.sp-countdown span small,.sp-template-event-calendar tfoot a,.sp-template-event-blocks .sp-event-date,.sp-template-details dt,.sp-template-scoreboard .sp-scoreboard-date,.sp-tournament-bracket th,.sp-tournament-bracket .sp-event .sp-event-title,.sp-tournament-bracket .sp-event .sp-event-title *{color:' . $colors['text_muted'] . ' !important}';
// Heading
echo '.sp-data-table th,.sp-template-countdown .sp-event-venue,.sp-template-countdown .sp-event-league,.sp-template-gallery .gallery-item a,.sp-template-gallery .gallery-caption,.sp-tournament-bracket .sp-team-name:hover,.sp-tournament-bracket .sp-heading{color:' . $colors['heading'] . ' !important}';
echo '.sp-data-table th,.sp-template-countdown .sp-event-venue,.sp-template-countdown .sp-event-league,.sp-template-gallery .gallery-item a,.sp-template-gallery .gallery-caption,.sp-tournament-bracket .sp-team-name:hover,.sp-tournament-bracket thead th,.sp-tournament-bracket .sp-heading{color:' . $colors['heading'] . ' !important}';
// Link
echo '.sp-template a,.sp-data-table a,.sp-tab-menu-item-active a, .sp-tab-menu-item-active a:hover{color:' . $colors['link'] . ' !important}';