-
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.
Add elements support to the typography panel in global styles (#36718)
- Loading branch information
1 parent
97629ab
commit 8d258e5
Showing
6 changed files
with
194 additions
and
11 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
39 changes: 39 additions & 0 deletions
39
packages/edit-site/src/components/global-styles/screen-typography-element.js
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,39 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { __ } from '@wordpress/i18n'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import TypographyPanel from './typography-panel'; | ||
import ScreenHeader from './header'; | ||
|
||
const elements = { | ||
text: { | ||
description: __( 'Manage the fonts used on the site.' ), | ||
title: __( 'Text' ), | ||
}, | ||
link: { | ||
description: __( 'Manage the fonts and typography used on the links.' ), | ||
title: __( 'Link' ), | ||
}, | ||
}; | ||
|
||
function ScreenTypographyElement( { name, element } ) { | ||
const parentMenu = | ||
name === undefined ? '/typography' : '/blocks/' + name + '/typography'; | ||
|
||
return ( | ||
<> | ||
<ScreenHeader | ||
back={ parentMenu } | ||
title={ elements[ element ].title } | ||
description={ elements[ element ].description } | ||
/> | ||
<TypographyPanel name={ name } element={ element } /> | ||
</> | ||
); | ||
} | ||
|
||
export default ScreenTypographyElement; |
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
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