Skip to:
Content

BuddyPress.org

Changeset 10841


Ignore:
Timestamp:
05/31/2016 07:48:22 AM (8 years ago)
Author:
r-a-y
Message:

Grunt: Modify RTLCSS to generate RTL files for inline CSS template parts.

As part of our embed templates, we use a template part to render the inline
CSS. (See https://buddypress.trac.wordpress.org/ticket/6772#comment:40.)

To support RTL, we're going to use RTLCSS to generate the accompanying
RTL CSS template part.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Gruntfile.js

    r10807 r10841  
    66
    77        BP_CSS = [
    8             '**/*.css'
     8            '**/*.css',
     9            '**/css-*.php'
    910        ],
    1011
    1112        // CSS exclusions, for excluding files from certain tasks, e.g. rtlcss
    1213        BP_EXCLUDED_CSS = [
    13             '!**/*-rtl.css'
     14            '!**/*-rtl.css',
     15            '!**/*-rtl.php'
    1416        ],
    1517
     
    106108                dest: SOURCE_DIR,
    107109                extDot: 'last',
    108                 ext: '-rtl.css',
    109                 src: BP_CSS.concat( BP_EXCLUDED_CSS, BP_EXCLUDED_MISC )
     110                src: BP_CSS.concat( BP_EXCLUDED_CSS, BP_EXCLUDED_MISC ),
     111                rename: function ( dest, src ) {
     112                    if ( src.endsWith( '.php' ) ) {
     113                        return dest + src.replace( '.php', '-rtl.php' );
     114                    } else {
     115                        return dest + src.replace( '.css', '-rtl.css' );
     116                    }
     117                }
    110118            }
    111119        },
Note: See TracChangeset for help on using the changeset viewer.