Skip to content

Commit 9b600de

Browse files
musaleMnickii
andauthored
feat: add custom CSS properties for the people picker flyout text (#2162)
* Add new tokens for flyout text custom styling * Document new css props * Add new props to the people custom styling story * Refactor the tokens to variables --------- Co-authored-by: Nickii Miaro <[email protected]>
1 parent 8f7eac6 commit 9b600de

File tree

3 files changed

+20
-5
lines changed

3 files changed

+20
-5
lines changed

packages/mgt-components/src/components/mgt-people-picker/mgt-people-picker.scss

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99
@import '../../styles/shared-styles.scss';
1010
@import './mgt-people-picker.theme.scss';
1111

12+
$flyout-line1-text-font-size: var(--people-picker-flyout-line1-text-font-size, 14px);
13+
$flyout-line1-text-font-weight: var(--people-picker-flyout-line1-text-font-weight, normal);
14+
$flyout-line2-text-font-size: var(--people-picker-flyout-line2-text-font-size, 12px);
15+
$flyout-line2-text-font-weight: var(--people-picker-flyout-line1-text-font-weight, normal);
16+
1217
// Main
1318
:host {
1419
font-family: $font-family;
@@ -130,13 +135,13 @@ mgt-people-picker .root {
130135
.people-person-text-area {
131136
margin-left: 13px;
132137
flex: 1 1 0;
133-
max-height: 40px;
138+
min-height: 40px;
134139
overflow: hidden;
135140
color: $dropdown-item__text__color;
136141

137142
.people-person-text {
138-
font-size: 14px;
139-
font-weight: normal;
143+
font-size: $flyout-line1-text-font-size;
144+
font-weight: $flyout-line1-text-font-weight;
140145
margin: 0;
141146
padding: 0;
142147
&.highlight-search-text {
@@ -288,8 +293,8 @@ mgt-people-picker .message-parent {
288293
mgt-people-picker .people-person-job-title {
289294
flex: 100%;
290295
order: 3;
291-
font-weight: normal;
292-
font-size: 12px;
296+
font-size: $flyout-line2-text-font-size;
297+
font-weight: $flyout-line2-text-font-weight;
293298
&.uppercase {
294299
text-transform: uppercase;
295300
}

packages/mgt-components/src/components/mgt-people-picker/mgt-people-picker.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,11 @@ interface IFocusable {
8181
* @cssprop --placeholder-color--focus - {Color} Color of placeholder text during focus state
8282
* @cssprop --placeholder-color - {Color} Color of placeholder text
8383
*
84+
* @cssprop --people-picker-flyout-line1-text-font-size - {String} the font size of the line 1 text on the flyout results. Default is 14px.
85+
* @cssprop --people-picker-flyout-line1-text-font-weight - {String} the font weight of the line 1 text on the flyout results. Default is normal.
86+
* @cssprop --people-picker-flyout-line2-text-font-size - {String} the font size of the line 2 text on the flyout results. Default is 12px.
87+
* @cssprop --people-picker-flyout-line2-text-font-weight - {String} the font weight of the line 2 text on the flyout results. Default is normal.
88+
*
8489
*/
8590
@customElement('mgt-people-picker')
8691
export class MgtPeoplePicker extends MgtTemplatedComponent {

stories/components/peoplePicker/peoplePicker.style.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ export const customCssProperties = () => html`
4747
--color-sub1: white;
4848
--placeholder-color: whitesmoke; /* placeholder text color */
4949
--placeholder-color--focus: black ; /* placeholder text focus color */
50+
51+
--people-picker-flyout-line1-text-font-size: 28px;
52+
--people-picker-flyout-line1-text-font-weight: 500;
53+
--people-picker-flyout-line2-text-font-size: 24px;
54+
--people-picker-flyout-line2-text-font-weight: 600;
5055
}
5156
</style>
5257
`;

0 commit comments

Comments
 (0)