Skip to content

Commit

Permalink
Use different sizes for buttons and render.
Browse files Browse the repository at this point in the history
  • Loading branch information
mtias committed Sep 11, 2018
1 parent ff061f2 commit b470109
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
6 changes: 3 additions & 3 deletions packages/block-library/src/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,13 @@
}

.has-regular-font-size {
font-size: 18px;
font-size: 20px;
}

.has-large-font-size {
font-size: 22px;
font-size: 36px;
}

.has-larger-font-size {
font-size: 32px;
font-size: 42px;
}
4 changes: 2 additions & 2 deletions packages/components/src/font-size-picker/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ export default function FontSizePicker( { fontSizes = [], fallbackFontSize, valu
>
<div className="components-font-size-picker__buttons">
<ButtonGroup aria-label={ __( 'Font Size' ) }>
{ map( fontSizes, ( { name, size, shortName } ) => (
{ map( fontSizes, ( { name, size, shortName, slug } ) => (
<Tooltip text={ name || shortName }>
<Button
key={ size }
isLarge
isPrimary={ value === size }
aria-pressed={ value === size }
onClick={ () => onChange( size ) }
style={ { fontSize: size } }
className={ 'is-font-' + slug }
>
<span>A</span>
</Button>
Expand Down
8 changes: 8 additions & 0 deletions packages/components/src/font-size-picker/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@
> span {
line-height: 1;
}

&.is-font-medium {
font-size: 18px;
}

&.is-font-large {
font-size: 22px;
}
}
}

Expand Down
4 changes: 2 additions & 2 deletions packages/editor/src/store/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,13 @@ export const EDITOR_SETTINGS_DEFAULTS = {
{
name: __( 'Medium' ),
shortName: __( 'M' ),
size: 18,
size: 20,
slug: 'medium',
},
{
name: __( 'Large' ),
shortName: __( 'L' ),
size: 22,
size: 36,
slug: 'large',
},
],
Expand Down

0 comments on commit b470109

Please sign in to comment.