@gravityforms/gulp-tasks
Version:
Configurable Gulp tasks for use in Gravity Forms projects.
39 lines (28 loc) • 670 B
JavaScript
const { Token } = require( './token' );
const { render } = require( '../../renderers/as-table' );
class cssProp extends Token {
typeText = 'cssprop';
endCondition( text ) {
if ( text.indexOf( 'cssprop' ) !== -1 ) {
return false;
}
if ( text.trim() === '' ) {
return false;
}
const test = text.split( ':' );
if ( test.length >= 2 ) {
return false;
}
return true;
}
tokenCondition( text ) {
return text.trim() === '@cssprop';
}
getContent() {
for ( let i = 0; i < this.lines.length; i++ ) {
this.lines[ i ] = this.lines[ i ].replace( /^\s+|\s+$/g, '' );
}
return render( this.lines );
}
}
module.exports = { cssProp };