Skip to content

Commit

Permalink
Remove redundant font size reset button and update styles to match
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronrobertshaw authored and ramonjd committed Aug 16, 2021
1 parent 0dab6cf commit f28510c
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 22 deletions.
8 changes: 7 additions & 1 deletion packages/block-editor/src/hooks/font-size.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,13 @@ export function FontSizeEdit( props ) {
const fontSizeValue =
fontSizeObject?.size || style?.typography?.fontSize || fontSize;

return <FontSizePicker onChange={ onChange } value={ fontSizeValue } />;
return (
<FontSizePicker
onChange={ onChange }
value={ fontSizeValue }
allowReset={ false }
/>
);
}

/**
Expand Down
21 changes: 16 additions & 5 deletions packages/block-editor/src/hooks/typography.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
.block-editor-block-inspector,
.edit-site {
.typography-controls {
.block-editor-line-height-control input {
max-width: 100%;
.typography-controls {
.block-editor-line-height-control input {
max-width: 100%;
}

.components-font-size-picker__controls {
.components-font-size-picker__select {
flex: 1;

> button {
width: 100%;
}
}

.components-unit-control-wrapper {
margin-right: 0;
}
}
}
5 changes: 5 additions & 0 deletions packages/components/src/tools-panel/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,9 @@ export const ToolsPanelItem = css`
margin-bottom: 0;
max-width: 100%;
}
> .components-base-control,
.components-base-control__field {
margin-bottom: 0;
}
`;
16 changes: 0 additions & 16 deletions packages/edit-site/src/components/sidebar/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,3 @@
margin-bottom: 0;
}
}

.edit-site {
.components-font-size-picker__controls {
.components-font-size-picker__select {
flex: 1;

> button {
width: 100%;
}
}

.components-unit-control-wrapper {
margin-right: 0;
}
}
}

0 comments on commit f28510c

Please sign in to comment.