Skip to content

Commit

Permalink
Add prettier suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
oandregal committed Aug 25, 2020
1 parent 27ac99d commit e9bb4ec
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 16 deletions.
20 changes: 9 additions & 11 deletions packages/edit-site/src/components/editor/global-styles-renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export const getGlobalStyles = ( blockData, baseTree, userTree ) => {
) {
declarations.push(
`${ key }: ${ get( blockStyles, STYLE_PROPS[ key ] ) }`
)
);
}
} );

Expand All @@ -79,17 +79,15 @@ export const getGlobalStyles = ( blockData, baseTree, userTree ) => {
*/
const getBlockPresetsDeclarations = ( blockPresets ) => {
const declarations = [];
PRESET_CATEGORIES.forEach(
( category ) => {
if ( blockPresets?.[ category ] ) {
blockPresets[ category ].forEach( ( { slug, value } ) =>
declarations.push(
`--wp--preset--${ category }--${ slug }: ${ value }`
)
);
}
PRESET_CATEGORIES.forEach( ( category ) => {
if ( blockPresets?.[ category ] ) {
blockPresets[ category ].forEach( ( { slug, value } ) =>
declarations.push(
`--wp--preset--${ category }--${ slug }: ${ value }`
)
);
}
);
} );
return declarations;
};

Expand Down
10 changes: 5 additions & 5 deletions packages/edit-site/src/components/editor/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ export const LINE_HEIGHT = 'line-height';
export const GLOBAL_CONTEXT = 'global';
export const PRESET_CATEGORIES = [ 'color', 'font-size', 'gradient' ];
export const STYLE_PROPS = {
[ FONT_SIZE ]: 'typography.fontSize',
[ LINE_HEIGHT ]: 'typography.lineHeight',
[ TEXT_COLOR ]: 'color.text',
[ BACKGROUND_COLOR ]: 'color.background',
[ LINK_COLOR ]: 'color.link',
[ FONT_SIZE ]: 'typography.fontSize',
[ LINE_HEIGHT ]: 'typography.lineHeight',
[ TEXT_COLOR ]: 'color.text',
[ BACKGROUND_COLOR ]: 'color.background',
[ LINK_COLOR ]: 'color.link',
};
export const LINK_COLOR_DECLARATION = `a { color: var(${ LINK_COLOR }, #00e); }`;

0 comments on commit e9bb4ec

Please sign in to comment.