diff options
| author | Oliver <oliver@mohlin.dev> | 2025-09-22 16:00:33 +0200 |
|---|---|---|
| committer | Tobias Järvelöv <tobias.jarvelov@mullvad.net> | 2025-09-30 11:22:22 +0200 |
| commit | 703c8b6ac92042fa3006fba8769094c85df615c4 (patch) | |
| tree | b2e48e9521a15408a3bba1d800f82da27d1f45be | |
| parent | 00e1a26b3466c44a80fe49a2698c68b926e9c25a (diff) | |
| download | mullvadvpn-703c8b6ac92042fa3006fba8769094c85df615c4.tar.xz mullvadvpn-703c8b6ac92042fa3006fba8769094c85df615c4.zip | |
Fix text-align property getting applied as when not passed
| -rw-r--r-- | desktop/packages/mullvad-vpn/src/renderer/lib/components/typography/Text.tsx | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/desktop/packages/mullvad-vpn/src/renderer/lib/components/typography/Text.tsx b/desktop/packages/mullvad-vpn/src/renderer/lib/components/typography/Text.tsx index aa4b0f1fca..e8b58488b4 100644 --- a/desktop/packages/mullvad-vpn/src/renderer/lib/components/typography/Text.tsx +++ b/desktop/packages/mullvad-vpn/src/renderer/lib/components/typography/Text.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import styled from 'styled-components'; +import styled, { css } from 'styled-components'; import { Colors, colors, Typography, typography } from '../../foundations'; import { PolymorphicProps, TransientProps } from '../../types'; @@ -20,11 +20,18 @@ const StyledText = styled.span<TransientProps<TextBaseProps>>( --color: ${color}; color: var(--color); - text-align: ${$textAlign || undefined}; font-family: ${fontFamily}; font-size: ${fontSize}; font-weight: ${fontWeight}; line-height: ${lineHeight}; + ${() => { + if ($textAlign) { + return css` + text-align: ${$textAlign}; + `; + } + return null; + }} `; }, ); |
