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

Added CSS RTL Support. #4

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
63 changes: 63 additions & 0 deletions css/columns-rtl.css
@@ -0,0 +1,63 @@
/**
* CSS (RTL) for handling the [column] shortcode styles.
*
* @version 20121024
* @author Yakir Sitbon (http://www.yakirs.net/)
* @copyright Copyright (c) 2012, Justin Tadlock
* @link http://justintadlock.com
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
*/

.column-grid .column {
float: right;
margin-left: 5%;
margin-right: 0;
}
.column-grid .column-first {
margin-right: 0;
margin-left: auto;
}
.column-grid .column-last {
float: left;
}

/* === 2 columns === */

/* $x = 52.5 */
.column-grid-2 .column-push-1 { margin-right: 52.5%; margin-left: auto; }

/* === 3 columns === */

/* $x = 35 */
.column-grid-3 .column-push-2 { margin-right: 70%; margin-left: auto; }
.column-grid-3 .column-push-1 { margin-right: 35%; margin-left: auto; }

/* === 4 columns === */

/* $x = 26.25 */
.column-grid-4 .column-push-3 { margin-right: 78.75%; margin-left: auto; }
.column-grid-4 .column-push-2 { margin-right: 52.5%; margin-left: auto; }
.column-grid-4 .column-push-1 { margin-right: 26.25%; margin-left: auto; }

/* === 5 columns === */

/* $x = 21 */
.column-grid-5 .column-push-4 { margin-right: 84%; margin-left: auto; }
.column-grid-5 .column-push-3 { margin-right: 63%; margin-left: auto; }
.column-grid-5 .column-push-2 { margin-right: 42%; margin-left: auto; }
.column-grid-5 .column-push-1 { margin-right: 21%; margin-left: auto; }

/* === 12 columns === */

/* $x = 8.75 */
.column-grid-12 .column-push-11 { margin-right: 96.25%; margin-left: auto; }
.column-grid-12 .column-push-10 { margin-right: 87.5%; margin-left: auto; }
.column-grid-12 .column-push-9 { margin-right: 78.75%; margin-left: auto; }
.column-grid-12 .column-push-8 { margin-right: 69%; margin-left: auto; }
.column-grid-12 .column-push-7 { margin-right: 61.25%; margin-left: auto; }
.column-grid-12 .column-push-6 { margin-right: 52.5%; margin-left: auto; }
.column-grid-12 .column-push-5 { margin-right: 43.75%; margin-left: auto; }
.column-grid-12 .column-push-4 { margin-right: 35%; margin-left: auto; }
.column-grid-12 .column-push-3 { margin-right: 26.25%; margin-left: auto; }
.column-grid-12 .column-push-2 { margin-right: 17.5%; margin-left: auto; }
.column-grid-12 .column-push-1 { margin-right: 8.75%; margin-left: auto; }
10 changes: 10 additions & 0 deletions grid-columns.php
Expand Up @@ -128,6 +128,16 @@ public function enqueue_styles() {
null,
'20121007'
);

/* Enqueue the rtl stylesheet. */
if ( is_rtl() ) {
wp_enqueue_style(
'grid-columns-rtl',
trailingslashit( plugin_dir_url( __FILE__ ) ) . "css/columns-rtl.css", // .min rtl stylesheet wiil be add soon.
array( 'grid-columns' ),
'20121024'
);
}
}

/**
Expand Down