Skip to content

Commit

Permalink
fix: add a custom font-size token to people-picker (#3069)
Browse files Browse the repository at this point in the history
* add custom font-size  token to people-picker

* add --people-picker-font-size custom style to story

* add cssprop

---------

Co-authored-by: Musale Martin <martinmusale@microsoft.com>
  • Loading branch information
Mnickii and musale committed Feb 28, 2024
1 parent 949c2c2 commit bc8423c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
Expand Up @@ -11,6 +11,7 @@

$people-picker-result-person-avatar-size: var(--people-picker-result-person-avatar-size, 40px);
$people-picker-selected-person-avatar-size: var(--people-picker-selected-person-avatar-size, 24px);
$people-picker-font-size: var(--people-picker-font-size, 14px);

:host {
--person-details-wrapper-width: 0;
Expand All @@ -19,6 +20,7 @@ $people-picker-selected-person-avatar-size: var(--people-picker-selected-person-

fluent-text-field {
width: 100%;
font-size: $people-picker-font-size;

&::part(root) {
display: flex;
Expand Down
Expand Up @@ -99,6 +99,7 @@ export const registerMgtPeoplePickerComponent = () => {
* @cssprop --people-picker-remove-selected-close-icon-color - {Color} the remove selected person close icon color.
* @cssprop --people-picker-result-person-avatar-size - {Length} the avatar size of the person in the result. Default is 40px.
* @cssprop --people-picker-selected-person-avatar-size - {Length} the avatar size of the selected person. Default is 24px.
* @cssprop --people-picker-font-size - {Length} the font size of the text in the people picker input. Default is 14px.
*/
export class MgtPeoplePicker extends MgtTemplatedTaskComponent {
/**
Expand Down
Expand Up @@ -37,6 +37,7 @@ export const customCSSProperties = () => html`
--people-picker-input-placeholder-text-color: white;
--people-picker-search-icon-color: yellow;
--people-picker-remove-selected-close-icon-color: blue;
--people-picker-font-size: 16px;
/** You can also change the person tokens **/
--person-line1-text-color: blue;
Expand Down

0 comments on commit bc8423c

Please sign in to comment.