Skip to content

Commit

Permalink
FontAppearanceControl: use CustomSelectControl V2 legacy adapter (#63179
Browse files Browse the repository at this point in the history
)

* FontAppearanceControl: use CustomSelectControl V2 legacy adapter

* Remove unnecessary __nextHasNoMarginBottom and avoid console error

---

Co-authored-by: ciampo <mciampini@git.wordpress.org>
Co-authored-by: mirka <0mirka00@git.wordpress.org>
  • Loading branch information
3 people authored Jul 8, 2024
1 parent f6133cd commit 6c434b0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
/**
* WordPress dependencies
*/
import { CustomSelectControl } from '@wordpress/components';
import { privateApis as componentsPrivateApis } from '@wordpress/components';
import { useMemo } from '@wordpress/element';
import { __, sprintf } from '@wordpress/i18n';

/**
* Internal dependencies
*/
import { getFontStylesAndWeights } from '../../utils/get-font-styles-and-weights';
import { unlock } from '../../lock-unlock';

const { CustomSelectControlV2Legacy: CustomSelectControl } = unlock(
componentsPrivateApis
);
/**
* Adjusts font appearance field label in case either font styles or weights
* are disabled.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
.components-font-appearance-control {
ul {
li {
color: $gray-900;
text-transform: capitalize;
}
[role="option"] {
color: $gray-900;
text-transform: capitalize;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,6 @@ export default function TypographyPanel( {
hasFontWeights={ hasFontWeights }
fontFamilyFaces={ fontFamilyFaces }
size="__unstable-large"
__nextHasNoMarginBottom
/>
</ToolsPanelItem>
) }
Expand Down

0 comments on commit 6c434b0

Please sign in to comment.