Skip to content

Commit

Permalink
feat: add css api for user-label
Browse files Browse the repository at this point in the history
  • Loading branch information
NikitaCG committed Apr 9, 2024
1 parent 1c2cab7 commit d251e6d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
7 changes: 7 additions & 0 deletions src/components/UserLabel/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,10 @@ LANDING_BLOCK-->
| className | Custom CSS class for root element | `string` | |
| style | HTML style attribute | `React.CSSProperties` | |
| qa | HTML `data-qa` attribute, used in tests | `string` | |

## CSS API

| Name | Description |
| :--------------------------- | :--------------- |
| `--g-user-label-font-size` | Text font size |
| `--g-user-label-line-height` | Text line height |
7 changes: 2 additions & 5 deletions src/components/UserLabel/UserLabel.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
$block: '.#{variables.$ns}user-label';

#{$block} {
--_--font-size: var(--g-text-body-1-font-size);
--_--line-height: var(--g-text-body-1-line-height);

$transitionDuration: 0.1s;
$transitionTimingFunction: ease-in-out;

Expand Down Expand Up @@ -80,8 +77,8 @@ $block: '.#{variables.$ns}user-label';
}

&__text {
font-size: var(--g-avatar-font-size, var(--_--font-size));
line-height: var(--g-avatar-line-height, var(--_--line-height));
font-size: var(--g-user-label-font-size, inherit);
line-height: var(--g-user-label-line-height, inherit);
min-width: 0;
margin-inline-end: 6px;
white-space: nowrap;
Expand Down

0 comments on commit d251e6d

Please sign in to comment.