-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Predefined set of font sizes (#5269)
* Add ButtonGroup UI component. This component renders a row of button controls. * Add predefined sets of font size values paired with classes. When font size control is used and the value matches one of the predefined values, the editor would output a special class instead of an inline fontSize number. * Load default font-sizes in the front. * Use button-group for font-size buttons. * Use a more sensible max value for the slider. * Group reset button with predefined sizes. * Add aria-pressed attr and display afterIcon in range slider. * Refactored to the two attributes approach customFontSize and fontSize. * Implemented deprecation logic to convert existing paragraph blocks.
- Loading branch information
Showing
6 changed files
with
205 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,13 @@ | ||
.editor-block-list__block:not( .is-multi-selected ) .wp-block-paragraph { | ||
background: white; | ||
} | ||
|
||
.blocks-font-size__main { | ||
display: flex; | ||
justify-content: space-between; | ||
} | ||
|
||
.blocks-font-size .blocks-range-control__slider + .dashicon { | ||
width: 30px; | ||
height: 30px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
import classnames from 'classnames'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import './style.scss'; | ||
|
||
function ButtonGroup( { className, ...props } ) { | ||
const classes = classnames( 'components-button-group', className ); | ||
|
||
return ( | ||
<div { ...props } className={ classes } role="group" /> | ||
); | ||
} | ||
|
||
export default ButtonGroup; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
.components-button-group { | ||
display: inline-block; | ||
margin-bottom: 20px; | ||
|
||
.components-button { | ||
border-radius: 0; | ||
& + .components-button { | ||
margin-left: -1px; | ||
} | ||
|
||
&:first-child { | ||
border-radius: 3px 0 0 3px; | ||
} | ||
|
||
&:last-child { | ||
border-radius: 0 3px 3px 0; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters