-
Notifications
You must be signed in to change notification settings - Fork 10
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
Add RTL Styles #3
Comments
When the LTR stylesheet has been generated, the RTL task runs and converts `style.css` to `rtl.css`. See #3
Like I did with my separate zip tasks, we could have two separate tasks ( |
Now we've got #41 (Allow multiple CSS files), we may have more flexibility to identify those which should have RTL files generated as well. |
The default behaviour is to save the output to
However, this not only means loading two stylesheets, but the We might consider outputting to \add_action( 'wp_enqueue_scripts', __NAMESPACE__ . '\\enqueue_assets' );
/**
* Allow style-rtl.css to be referenced instead of style.css.
*
* @since 1.0.0
*
* @link http://www.poststat.us/automating-i18n-wordpress-themes/
*/
function enqueue_assets(): void {
$handle = defined( 'CHILD_THEME_NAME' ) && CHILD_THEME_NAME ? \sanitize_title_with_dashes( CHILD_THEME_NAME ) : 'child-theme';
\wp_style_add_data( $handle, 'rtl', 'replace' );
} Either way, the name of the RTL CSS file should be configurable, instead of being hard-coded as it is currently in the |
https://github.com/MohammadYounes/gulp-rtlcss
Some themes need right-to-left styles, and this package can help generate them.
The gotcha here, is being able to generate the right sourcemap when building SCSS into CSS, AND minifying, AND producing RTL versions.. Separating the styles task up into subtasks that save an intermediary file might be needed.
The text was updated successfully, but these errors were encountered: