File "getBlockClasses.js"
Full path: /home/webcknlt/admissiontell.com/wp-content/plugins/generateblocks/src/utils/getBlockClasses.js
File
size: 448 B (448 B bytes)
MIME-type: text/plain
Charset: utf-8
Download Open Edit Advanced Editor &nnbsp; Back
export function getBlockClasses( blockSlug, attributes, withBaseClass = false ) {
const {
styles = {},
uniqueId = '',
globalClasses = [],
} = attributes;
const classNames = [];
if ( withBaseClass ) {
classNames.push( blockSlug );
}
if ( globalClasses.length > 0 ) {
classNames.push( ...globalClasses );
}
if ( Object.keys( styles ).length > 0 ) {
classNames.push( `${ blockSlug }-${ uniqueId }` );
}
return classNames;
}