Skip to content

Commit

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

* 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 and huubl committed Jul 10, 2024
1 parent 3e45827 commit 9380fd0
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 9380fd0

Please sign in to comment.