Skip to content

Commit

Permalink
Merge pull request #439 from WordPress/add/icon-button-class
Browse files Browse the repository at this point in the history
Add proper label to IconButton number element.
  • Loading branch information
jasmussen authored Apr 18, 2017
2 parents ffc663c + 46ea902 commit 87e158b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 15 deletions.
3 changes: 1 addition & 2 deletions editor/components/icon-button/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ function IconButton( { icon, children, label, className, ...additionalProps } )
const classes = classnames( 'editor-icon-button', className );

return (
<Button { ...additionalProps } aria-label={ label } className={ classes }>
<Button { ...additionalProps } aria-label={ label } className={ classes } data-level={ children ? children : null }>
<Dashicon icon={ icon } />
{ children ? <span>{ children }</span> : null }
</Button>
);
}
Expand Down
10 changes: 8 additions & 2 deletions editor/components/icon-button/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,13 @@
}
}

span {
font-size: 12px;
&:after {
content: attr( data-level );
font-family: $default-font;
font-size: 10px;
font-weight: bold;
position: absolute;
bottom: 8px;
right: 4px;
}
}
11 changes: 0 additions & 11 deletions editor/components/toolbar/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,6 @@
background-color: $dark-gray-500;
color: $white;
}

/* Optional number, e.g. for headings */
span {
font-family: $default-font;
font-size: 10px;
font-weight: bold;
position: absolute;
bottom: 8px;
right: 4px;
}

}

.editor-toolbar__control .dashicon {
Expand Down

0 comments on commit 87e158b

Please sign in to comment.