Skip to content

Commit

Permalink
Remove additional Typeset screen and surface typesets in the typograp…
Browse files Browse the repository at this point in the history
…hy panel.
  • Loading branch information
jffng committed Sep 23, 2024
1 parent 4a91d32 commit bffc6ab
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 161 deletions.
42 changes: 0 additions & 42 deletions packages/edit-site/src/components/global-styles/screen-typeset.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import { store as editorStore } from '@wordpress/editor';
*/
import TypographyElements from './typography-elements';
import ScreenHeader from './header';
import TypographyVariations from './variations/variations-typography';
import FontSizesCount from './font-sizes/font-sizes-count';
import TypesetButton from './typeset-button';
import FontFamilies from './font-families';

function ScreenTypography() {
Expand All @@ -32,7 +32,7 @@ function ScreenTypography() {
/>
<div className="edit-site-global-styles-screen">
<VStack spacing={ 7 }>
<TypesetButton />
<TypographyVariations title={ __( 'Typesets' ) } />
{ fontLibraryEnabled && <FontFamilies /> }
<TypographyElements />
<FontSizesCount />
Expand Down
100 changes: 0 additions & 100 deletions packages/edit-site/src/components/global-styles/typeset-button.js

This file was deleted.

5 changes: 0 additions & 5 deletions packages/edit-site/src/components/global-styles/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import {
} from './screen-block-list';
import ScreenBlock from './screen-block';
import ScreenTypography from './screen-typography';
import ScreenTypeset from './screen-typeset';
import ScreenTypographyElement from './screen-typography-element';
import FontSize from './font-sizes/font-size';
import FontSizes from './font-sizes/font-sizes';
Expand Down Expand Up @@ -325,10 +324,6 @@ function GlobalStylesUI() {
<FontSize />
</GlobalStylesNavigationScreen>

<GlobalStylesNavigationScreen path="/typography/typeset">
<ScreenTypeset />
</GlobalStylesNavigationScreen>

<GlobalStylesNavigationScreen path="/typography/text">
<ScreenTypographyElement element="text" />
</GlobalStylesNavigationScreen>
Expand Down
25 changes: 13 additions & 12 deletions packages/edit-site/src/components/global-styles/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,20 @@ function getFontFamilyFromSetting( fontFamilies, setting ) {
}

export function getFontFamilies( themeJson ) {
const themeFontFamilies =
themeJson?.settings?.typography?.fontFamilies?.theme;
const customFontFamilies =
themeJson?.settings?.typography?.fontFamilies?.custom;
const fontFamilies = themeJson?.settings?.typography?.fontFamilies.theme;
// const themeFontFamilies =
// themeJson?.settings?.typography?.fontFamilies?.theme;
// const customFontFamilies =
// themeJson?.settings?.typography?.fontFamilies?.custom;

let fontFamilies = [];
if ( themeFontFamilies && customFontFamilies ) {
fontFamilies = [ ...themeFontFamilies, ...customFontFamilies ];
} else if ( themeFontFamilies ) {
fontFamilies = themeFontFamilies;
} else if ( customFontFamilies ) {
fontFamilies = customFontFamilies;
}
// let fontFamilies = [];
// if ( themeFontFamilies && customFontFamilies ) {
// fontFamilies = [ ...themeFontFamilies, ...customFontFamilies ];
// } else if ( themeFontFamilies ) {
// fontFamilies = themeFontFamilies;
// } else if ( customFontFamilies ) {
// fontFamilies = customFontFamilies;
// }
const bodyFontFamilySetting = themeJson?.styles?.typography?.fontFamily;
const bodyFontFamily = getFontFamilyFromSetting(
fontFamilies,
Expand Down

0 comments on commit bffc6ab

Please sign in to comment.